Vitrous commited on
Commit
9544c22
·
verified ·
1 Parent(s): 8203e0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- conversation_entry = {'thread_id': thread_id, 'message_id': message_id, 'user': msg_prompt, 'assistant': response}
282
 
283
  # Save conversation history to disk
284
- conversation_thread = ({"user_id": user_id, "conversation": conversation})
285
 
286
 
287
-
288
  # Return response and thread ID
289
- return {'response': conversation_thread}
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: