From 54daf3b76515a6b1041a45e027f4668ad20136e6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 28 Dec 2024 18:05:07 -0800 Subject: [PATCH] fix: outlet filter hook --- backend/open_webui/utils/chat.py | 2 ++ src/lib/components/chat/Chat.svelte | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/chat.py b/backend/open_webui/utils/chat.py index 5456ec825..7fce76419 100644 --- a/backend/open_webui/utils/chat.py +++ b/backend/open_webui/utils/chat.py @@ -182,6 +182,7 @@ async def chat_completed(request: Request, form_data: dict, user: Any): "chat_id": data["chat_id"], "message_id": data["id"], "session_id": data["session_id"], + "user_id": user.id, } ) @@ -190,6 +191,7 @@ async def chat_completed(request: Request, form_data: dict, user: Any): "chat_id": data["chat_id"], "message_id": data["id"], "session_id": data["session_id"], + "user_id": user.id, } ) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 6c3d610ad..7699aa572 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -836,7 +836,7 @@ return null; }); - if (res !== null) { + if (res !== null && res.messages) { // Update chat history with the new messages for (const message of res.messages) { history.messages[message.id] = {