rwitz commited on
Commit
7d8811f
1 Parent(s): 65f8838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -17,14 +17,12 @@ async def direct_regenerate(model, user_input, chatbot):
17
  adapter = next(entry['adapter'] for entry in chatbots_data if entry['original_model'] == model)
18
  temp_state = {
19
  "history": [
20
- [{"role": "user", "content": user_input}]
21
  ]
22
  }
23
  response = await get_bot_response(adapter, user_input, temp_state, 0)
24
- chatbot[-1] = (user_input, response)
25
  return "", chatbot
26
-
27
-
28
  password=os.environ.get("MONGODB")
29
 
30
  def init_database():
 
17
  adapter = next(entry['adapter'] for entry in chatbots_data if entry['original_model'] == model)
18
  temp_state = {
19
  "history": [
20
+ [{"role": "user", "content": chatbot[-1][0]}] # Keep the user's last message
21
  ]
22
  }
23
  response = await get_bot_response(adapter, user_input, temp_state, 0)
24
+ chatbot[-1] = (chatbot[-1][0], response) # Update only the assistant's response
25
  return "", chatbot
 
 
26
  password=os.environ.get("MONGODB")
27
 
28
  def init_database():