Browse Source

fix: outlet filter hook

Timothy Jaeryang Baek 4 months ago
parent
commit
54daf3b765
2 changed files with 3 additions and 1 deletions
  1. 2 0
      backend/open_webui/utils/chat.py
  2. 1 1
      src/lib/components/chat/Chat.svelte

+ 2 - 0
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,
         }
     )
 

+ 1 - 1
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] = {