From a01ef6cfa09686b46584c6d3cfc0ff55fa3e5508 Mon Sep 17 00:00:00 2001 From: MeteorSky Date: Tue, 4 Mar 2025 00:08:49 +0800 Subject: [PATCH] fix: allow error returns None --- backend/open_webui/utils/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/utils/chat.py b/backend/open_webui/utils/chat.py index 74d0af4f7..e538f761e 100644 --- a/backend/open_webui/utils/chat.py +++ b/backend/open_webui/utils/chat.py @@ -149,7 +149,7 @@ async def generate_direct_chat_completion( } ) - if "error" in res: + if "error" in res and res["error"]: raise Exception(res["error"]) return res