diff --git a/api/routers/chat.py b/api/routers/chat.py index 55a385e..b247739 100644 --- a/api/routers/chat.py +++ b/api/routers/chat.py @@ -49,7 +49,7 @@ async def convo_turn(): yield f"Error: {str(e)}" return - await create_messages_and_metamessages( + create_messages_and_metamessages( app.id, user.id, inp.conversation_id, inp.message, thought, response ) @@ -74,26 +74,26 @@ async def convo_turn(): ) -async def create_messages_and_metamessages( +def create_messages_and_metamessages( app_id, user_id, conversation_id, user_message, thought, ai_response ): try: # These operations will use the DB layer's built-in retry logic - await honcho.apps.users.sessions.messages.create( + honcho.apps.users.sessions.messages.create( is_user=True, session_id=str(conversation_id), app_id=app_id, user_id=user_id, content=user_message, ) - new_ai_message = await honcho.apps.users.sessions.messages.create( + new_ai_message = honcho.apps.users.sessions.messages.create( is_user=False, session_id=str(conversation_id), app_id=app_id, user_id=user_id, content=ai_response, ) - await honcho.apps.users.sessions.metamessages.create( + honcho.apps.users.sessions.metamessages.create( app_id=app_id, session_id=str(conversation_id), user_id=user_id,