Update app.py
Browse files
app.py
CHANGED
@@ -278,15 +278,14 @@ async def chat_thread(request: Request, user_id: str):
|
|
278 |
message_id = generate_message_id()
|
279 |
|
280 |
# Construct conversation entry
|
281 |
-
|
282 |
|
283 |
# Save conversation history to disk
|
284 |
-
|
285 |
|
286 |
|
287 |
-
|
288 |
# Return response and thread ID
|
289 |
-
return {'response':
|
290 |
except HTTPException as e:
|
291 |
raise e
|
292 |
except Exception as e:
|
|
|
278 |
message_id = generate_message_id()
|
279 |
|
280 |
# Construct conversation entry
|
281 |
+
conversation_thread = {'thread_id': thread_id, 'message_id': message_id, 'user': msg_prompt, 'assistant': response}
|
282 |
|
283 |
# Save conversation history to disk
|
284 |
+
history_thread = ({"user_id": user_id, "thread": conversation_thread})
|
285 |
|
286 |
|
|
|
287 |
# Return response and thread ID
|
288 |
+
return {'response': history_thread}
|
289 |
except HTTPException as e:
|
290 |
raise e
|
291 |
except Exception as e:
|