Spaces:
Runtime error
Runtime error
Bug fix.
Browse files
app.py
CHANGED
|
@@ -72,10 +72,10 @@ def ask_agent(messages, history):
|
|
| 72 |
try:
|
| 73 |
response = agent.run(latest_user_message)
|
| 74 |
print(f"✅ Agent response:\n{response}")
|
| 75 |
-
return {"role": "assistant", "content": response.content} # ✅
|
| 76 |
except Exception as e:
|
| 77 |
print(f"❌ Agent failed: {e}")
|
| 78 |
-
return {"role": "assistant", "content": "Something went wrong on my end. Try again?"}
|
| 79 |
|
| 80 |
print("====== DEBUG: ask_agent END ======")
|
| 81 |
|
|
|
|
| 72 |
try:
|
| 73 |
response = agent.run(latest_user_message)
|
| 74 |
print(f"✅ Agent response:\n{response}")
|
| 75 |
+
return messages + [{"role": "assistant", "content": response.content}] # ✅ RETURN FULL LIST
|
| 76 |
except Exception as e:
|
| 77 |
print(f"❌ Agent failed: {e}")
|
| 78 |
+
return messages + [{"role": "assistant", "content": "Something went wrong on my end. Try again?"}]
|
| 79 |
|
| 80 |
print("====== DEBUG: ask_agent END ======")
|
| 81 |
|