kaitwithkwk commited on
Commit
05c0c3c
·
verified ·
1 Parent(s): db389e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -11,7 +11,9 @@ def respond(message, history):
11
 
12
  # add all previous messages to the messages list
13
  if history:
14
- messages.extend(history)
 
 
15
 
16
  # add the current user's message to the messages list
17
  messages.append({"role": "user", "content": message})
 
11
 
12
  # add all previous messages to the messages list
13
  if history:
14
+ for user_msg, assistant_msg in history:
15
+ messages.append({"role": "user", "content": user_msg})
16
+ messages.append({"role": "assistant", "content": assistant_msg})
17
 
18
  # add the current user's message to the messages list
19
  messages.append({"role": "user", "content": message})