Timothy Jaeryang Baek 4 ماه پیش
والد
کامیت
cd9dae0f3a
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      backend/open_webui/utils/middleware.py

+ 4 - 1
backend/open_webui/utils/middleware.py

@@ -776,7 +776,10 @@ async def process_chat_response(
                                     "content",
                                     "content",
                                     message.get("content", "New Chat"),
                                     message.get("content", "New Chat"),
                                 )
                                 )
-                            )
+                            ).strip()
+
+                            if not title:
+                                title = messages[0].get("content", "New Chat")
 
 
                             Chats.update_chat_title_by_id(metadata["chat_id"], title)
                             Chats.update_chat_title_by_id(metadata["chat_id"], title)