Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from my_memory_logic import run_with_session_memory
|
|
| 4 |
def chat_interface_fn(message, history):
|
| 5 |
"""
|
| 6 |
Multi-turn chat function for Gradio's ChatInterface.
|
| 7 |
-
Returns
|
| 8 |
"""
|
| 9 |
# Initialize history if None
|
| 10 |
history = history or []
|
|
@@ -16,9 +16,8 @@ def chat_interface_fn(message, history):
|
|
| 16 |
print(f"Error in run_with_session_memory: {str(e)}")
|
| 17 |
answer = "I apologize, but I encountered an error processing your request."
|
| 18 |
|
| 19 |
-
# Return
|
| 20 |
-
|
| 21 |
-
return history
|
| 22 |
|
| 23 |
# Custom CSS for chat interface
|
| 24 |
my_chat_css = """
|
|
|
|
| 4 |
def chat_interface_fn(message, history):
|
| 5 |
"""
|
| 6 |
Multi-turn chat function for Gradio's ChatInterface.
|
| 7 |
+
Returns strings for both message and history to match Gradio's expected format.
|
| 8 |
"""
|
| 9 |
# Initialize history if None
|
| 10 |
history = history or []
|
|
|
|
| 16 |
print(f"Error in run_with_session_memory: {str(e)}")
|
| 17 |
answer = "I apologize, but I encountered an error processing your request."
|
| 18 |
|
| 19 |
+
# Return strings directly - this is what Gradio's ChatInterface expects
|
| 20 |
+
return str(answer)
|
|
|
|
| 21 |
|
| 22 |
# Custom CSS for chat interface
|
| 23 |
my_chat_css = """
|