Hev832 commited on
Commit
52b9e25
·
verified ·
1 Parent(s): 5a4aaa7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -50,11 +50,11 @@ def generate_response(user_input, chat_history):
50
  chat_session = model.start_chat()
51
 
52
  # Format the history for the model
53
- formatted_history = "\n".join([f"{role}: {msg}" for role, msg in chat_history])
54
  response = chat_session.send_message(formatted_history)
55
 
56
  # Append the assistant's response to history
57
- chat_history.append(("assistant", response.text))
58
  return chat_history
59
 
60
  except Exception as e:
 
50
  chat_session = model.start_chat()
51
 
52
  # Format the history for the model
53
+ formatted_history = "\n".join([f"{msg}" for role, msg in chat_history])
54
  response = chat_session.send_message(formatted_history)
55
 
56
  # Append the assistant's response to history
57
+ chat_history.append((response.text))
58
  return chat_history
59
 
60
  except Exception as e: