Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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"{
|
54 |
response = chat_session.send_message(formatted_history)
|
55 |
|
56 |
# Append the assistant's response to history
|
57 |
-
chat_history.append((
|
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:
|