Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1845,13 +1845,12 @@ def chatbot_response(message, history):
|
|
| 1845 |
# Save the interaction context
|
| 1846 |
chat_history.extend(
|
| 1847 |
[
|
| 1848 |
-
|
| 1849 |
-
|
| 1850 |
]
|
| 1851 |
)
|
| 1852 |
|
| 1853 |
return response
|
| 1854 |
-
return response
|
| 1855 |
except Exception as e:
|
| 1856 |
logger.error(f"Error generating chatbot response: {e}")
|
| 1857 |
return "Error occurred during response generation"
|
|
|
|
| 1845 |
# Save the interaction context
|
| 1846 |
chat_history.extend(
|
| 1847 |
[
|
| 1848 |
+
HumanMessage(content=message),
|
| 1849 |
+
AIMessage(content=response),
|
| 1850 |
]
|
| 1851 |
)
|
| 1852 |
|
| 1853 |
return response
|
|
|
|
| 1854 |
except Exception as e:
|
| 1855 |
logger.error(f"Error generating chatbot response: {e}")
|
| 1856 |
return "Error occurred during response generation"
|