rwitz commited on
Commit
6eb3c68
1 Parent(s): 0f925b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -98,19 +98,20 @@ def user_ask(state, chatbot1, chatbot2, textbox):
98
  # Updating state with the current ELO ratings
99
  state["elo_ratings"] = read_elo_ratings()
100
  if "history" not in state:
101
- state.update({'history': []})
102
- state["history"].extend([
 
 
103
  {"role": "user", "content": user_input}])
104
  # Chat with bots
105
  bot1_response, bot2_response = chat_with_bots(user_input, state)
106
-
107
- # Update chat history in state
108
- if "history" not in state:
109
- state.update({'history': []})
110
- state["history"].extend([
111
  {"role": "bot1", "content": bot1_response},
112
- {"role": "bot2", "content": bot2_response}
113
  ])
 
 
 
 
114
  chatbot1.append((user_input,bot1_response))
115
  chatbot2.append((user_input,bot2_response))
116
 
 
98
  # Updating state with the current ELO ratings
99
  state["elo_ratings"] = read_elo_ratings()
100
  if "history" not in state:
101
+ state.update({'history': [[],[]]})
102
+ state["history"][0].extend([
103
+ {"role": "user", "content": user_input}])
104
+ state["history"][1].extend([
105
  {"role": "user", "content": user_input}])
106
  # Chat with bots
107
  bot1_response, bot2_response = chat_with_bots(user_input, state)
108
+ state["history"][0].extend([
 
 
 
 
109
  {"role": "bot1", "content": bot1_response},
 
110
  ])
111
+ state["history"][1].extend([
112
+ {"role": "bot2", "content": bot2_response},
113
+ ])
114
+
115
  chatbot1.append((user_input,bot1_response))
116
  chatbot2.append((user_input,bot2_response))
117