BlockBerg commited on
Commit
a8427ea
·
verified ·
1 Parent(s): 84e806c
Files changed (1) hide show
  1. app.py +2 -2
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} # ✅ FIXED HERE
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