refac/fix: error message

This commit is contained in:
Timothy Jaeryang Baek
2025-08-28 02:35:29 +04:00
parent cf08d34879
commit e7c7c65227
2 changed files with 9 additions and 0 deletions

View File

@@ -1305,6 +1305,13 @@ async def process_chat_response(
"error": {"content": error},
},
)
if isinstance(error, str) or isinstance(error, dict):
await event_emitter(
{
"type": "chat:message:error",
"data": {"error": {"content": error}},
},
)
if "selected_model_id" in response_data:
Chats.upsert_message_to_chat_by_id_and_message_id(