mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 09:21:22 +00:00
Update Chat.svelte
This commit is contained in:
parent
7b51b27d60
commit
7f402d101d
1 changed files with 19 additions and 1 deletions
|
|
@ -1648,7 +1648,25 @@
|
|||
};
|
||||
|
||||
const chatCompletionEventHandler = async (data, message, chatId) => {
|
||||
const { id, done, choices, content, output, sources, selected_model_id, error, usage } = data;
|
||||
const { id, done, choices, content, output, sources, selected_model_id, error, usage, yjs_update } = data;
|
||||
|
||||
// Handle Yjs updates for streaming
|
||||
if (yjs_update && message.id) {
|
||||
// Get or create Yjs handler for this message
|
||||
if (!message.yjsHandler) {
|
||||
message.yjsHandler = new ChatMessageYjsHandler(
|
||||
message.id,
|
||||
$socket,
|
||||
(content) => {
|
||||
message.content = content;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Apply Yjs update (handled internally by ChatMessageYjsHandler)
|
||||
// The handler will update message.content via the callback
|
||||
return; // Skip traditional processing for Yjs updates
|
||||
}
|
||||
|
||||
// Store raw OR-aligned output items from backend
|
||||
if (output) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue