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
05277556
"tests/models/unets/test_models_unet_2d_condition.py" did not exist on "1870fb05a903546b79236d277ae4bc12e626b328"
Commit
05277556
authored
Jul 04, 2024
by
Michael Poluektov
Browse files
use data field
parent
4e433d90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
src/lib/components/chat/Chat.svelte
src/lib/components/chat/Chat.svelte
+13
-18
No files found.
src/lib/components/chat/Chat.svelte
View file @
05277556
...
...
@@ -133,29 +133,24 @@
let message = history.messages[data.message_id];
const type = data?.data?.type ?? null;
if (type === "status") {
const status = {
done: data?.data?.done ?? null,
description: data?.data?.status ?? null
};
const payload = data?.data?.data ?? null;
if (!type || !payload) {
console.log("Data and type fields must be provided.", data);
return;
}
const status_keys = ["done", "description"];
const citation_keys = ["document", "metadata", "source"];
if (type === "status" && status_keys.every(key => key in payload)) {
if (message.statusHistory) {
message.statusHistory.push(
status
);
message.statusHistory.push(
payload
);
} else {
message.statusHistory = [
status
];
message.statusHistory = [
payload
];
}
} else if (type === "citation") {
console.log(data);
const citation = {
document: data?.data?.document ?? null,
metadata: data?.data?.metadata ?? null,
source: data?.data?.source ?? null
};
} else if (type === "citation" && citation_keys.every(key => key in payload)) {
if (message.citations) {
message.citations.push(
citation
);
message.citations.push(
payload
);
} else {
message.citations = [
citation
];
message.citations = [
payload
];
}
} else {
console.log("Unknown message type", data);
...
...
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