AxL95 commited on
Commit
3019809
·
verified ·
1 Parent(s): fd2e6bc

Update chat.py

Browse files
Files changed (1) hide show
  1. chat.py +0 -8
chat.py CHANGED
@@ -343,15 +343,7 @@ async def chat(request: Request):
343
  "text": bot_response,
344
  "timestamp": datetime.utcnow()
345
  })
346
-
347
  if conversation_id and current_user:
348
- db.messages.insert_one({
349
- "conversation_id": conversation_id,
350
- "user_id": str(current_user["_id"]),
351
- "sender": "bot",
352
- "text": bot_response,
353
- "timestamp": datetime.utcnow()
354
- })
355
  response_tokens = int(len(bot_response.split()) * 1.3)
356
  total_tokens = current_tokens + message_tokens + response_tokens
357
  db.conversations.update_one(
 
343
  "text": bot_response,
344
  "timestamp": datetime.utcnow()
345
  })
 
346
  if conversation_id and current_user:
 
 
 
 
 
 
 
347
  response_tokens = int(len(bot_response.split()) * 1.3)
348
  total_tokens = current_tokens + message_tokens + response_tokens
349
  db.conversations.update_one(