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
fec51342
Commit
fec51342
authored
May 30, 2024
by
Timothy J. Baek
Browse files
fix: filter outlet issue with many model chat
parent
ef8d8429
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+12
-0
No files found.
src/lib/components/chat/Chat.svelte
View file @
fec51342
...
@@ -236,6 +236,15 @@
...
@@ -236,6 +236,15 @@
}
}
};
};
const
createMessagesList
=
(
responseMessageId
)
=>
{
const
message
=
history
.
messages
[
responseMessageId
];
if
(
message
.
parentId
)
{
return
[...
createMessagesList
(
message
.
parentId
),
message
];
}
else
{
return
[
message
];
}
};
//////////////////////////
//////////////////////////
//
Ollama
functions
//
Ollama
functions
//////////////////////////
//////////////////////////
...
@@ -599,6 +608,7 @@
...
@@ -599,6 +608,7 @@
controller.abort('User: Stop Response');
controller.abort('User: Stop Response');
await cancelOllamaRequest(localStorage.token, currentRequestId);
await cancelOllamaRequest(localStorage.token, currentRequestId);
} else {
} else {
const messages = createMessagesList(responseMessageId);
const res = await chatCompleted(localStorage.token, {
const res = await chatCompleted(localStorage.token, {
model: model,
model: model,
messages: messages.map((m) => ({
messages: messages.map((m) => ({
...
@@ -880,6 +890,8 @@
...
@@ -880,6 +890,8 @@
if (stopResponseFlag) {
if (stopResponseFlag) {
controller.abort('
User
:
Stop
Response
');
controller.abort('
User
:
Stop
Response
');
} else {
} else {
const messages = createMessagesList(responseMessageId);
const res = await chatCompleted(localStorage.token, {
const res = await chatCompleted(localStorage.token, {
model: model,
model: model,
messages: messages.map((m) => ({
messages: messages.map((m) => ({
...
...
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