Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
bcc2bab6
Commit
bcc2bab6
authored
May 19, 2024
by
Timothy J. Baek
Browse files
refac
parent
0260c714
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+2
-4
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+2
-4
No files found.
src/routes/(app)/+page.svelte
View file @
bcc2bab6
...
...
@@ -255,8 +255,6 @@
const
sendPrompt
=
async
(
prompt
,
parentId
,
modelId
=
null
)
=>
{
const
_chatId
=
JSON
.
parse
(
JSON
.
stringify
($
chatId
));
let
userContext
=
null
;
await
Promise
.
all
(
(
modelId
?
[
modelId
]
:
atSelectedModel
!== '' ? [atSelectedModel.id] : selectedModels).map(
async
(
modelId
)
=>
{
...
...
@@ -273,7 +271,7 @@
role
:
'assistant'
,
content
:
''
,
model
:
model
.
id
,
userContext
:
userContext
,
userContext
:
null
,
timestamp
:
Math
.
floor
(
Date
.
now
()
/
1000
)
//
Unix
epoch
};
...
...
@@ -291,6 +289,7 @@
await
tick
();
let
userContext
=
null
;
if
($
settings
?.
memory
??
false
)
{
if
(
userContext
===
null
)
{
const
res
=
await
queryMemory
(
localStorage
.
token
,
prompt
).
catch
((
error
)
=>
{
...
...
@@ -314,7 +313,6 @@
}
}
}
responseMessage
.
userContext
=
userContext
;
if
(
model
?.
external
)
{
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
bcc2bab6
...
...
@@ -261,8 +261,6 @@
const
sendPrompt
=
async
(
prompt
,
parentId
,
modelId
=
null
)
=>
{
const
_chatId
=
JSON
.
parse
(
JSON
.
stringify
($
chatId
));
let
userContext
=
null
;
await
Promise
.
all
(
(
modelId
?
[
modelId
]
:
atSelectedModel
!== '' ? [atSelectedModel.id] : selectedModels).map(
async
(
modelId
)
=>
{
...
...
@@ -279,7 +277,7 @@
role
:
'assistant'
,
content
:
''
,
model
:
model
.
id
,
userContext
:
userContext
,
userContext
:
null
,
timestamp
:
Math
.
floor
(
Date
.
now
()
/
1000
)
//
Unix
epoch
};
...
...
@@ -297,6 +295,7 @@
await
tick
();
let
userContext
=
null
;
if
($
settings
?.
memory
??
false
)
{
if
(
userContext
===
null
)
{
const
res
=
await
queryMemory
(
localStorage
.
token
,
prompt
).
catch
((
error
)
=>
{
...
...
@@ -320,7 +319,6 @@
}
}
}
responseMessage
.
userContext
=
userContext
;
if
(
model
?.
external
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment