This commit is contained in:
Timothy Jaeryang Baek 2024-12-21 09:45:52 -07:00
parent c611734088
commit 271acb2e67

View File

@ -561,6 +561,15 @@ async def process_chat_response(request, response, user, events, metadata, tasks
} }
) )
# Save message in the database
Chats.upsert_message_to_chat_by_id_and_message_id(
metadata["chat_id"],
metadata["message_id"],
{
**event,
},
)
content = "" content = ""
async for line in response.body_iterator: async for line in response.body_iterator:
line = line.decode("utf-8") if isinstance(line, bytes) else line line = line.decode("utf-8") if isinstance(line, bytes) else line