mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
refac
This commit is contained in:
@@ -1297,7 +1297,13 @@ async def process_chat_response(
|
|||||||
response_data = response
|
response_data = response
|
||||||
|
|
||||||
if "error" in response_data:
|
if "error" in response_data:
|
||||||
error = response_data["error"].get("detail", response_data["error"])
|
error = response_data.get("error")
|
||||||
|
|
||||||
|
if isinstance(error, dict):
|
||||||
|
error = error.get("detail", error)
|
||||||
|
else:
|
||||||
|
error = str(error)
|
||||||
|
|
||||||
Chats.upsert_message_to_chat_by_id_and_message_id(
|
Chats.upsert_message_to_chat_by_id_and_message_id(
|
||||||
metadata["chat_id"],
|
metadata["chat_id"],
|
||||||
metadata["message_id"],
|
metadata["message_id"],
|
||||||
|
|||||||
Reference in New Issue
Block a user