dawid-lorek commited on
Commit
a1bd715
·
verified ·
1 Parent(s): b4335f9

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +2 -4
agent.py CHANGED
@@ -109,12 +109,10 @@ Rules:
109
  5. Avoid all explanation unless requested.
110
  """
111
  )
112
-
113
- # ✅ Async-only with automatic tool execution
114
  async def answer_question(question: str) -> str:
115
  try:
116
- result = await agent.run(question)
117
- return result.strip()
118
  except Exception as e:
119
  print("❌ Agent error:", e)
120
  return "[ERROR] " + str(e)
 
109
  5. Avoid all explanation unless requested.
110
  """
111
  )
 
 
112
  async def answer_question(question: str) -> str:
113
  try:
114
+ response = await agent.get_response_async(question)
115
+ return response.message.content.strip() if hasattr(response.message, "content") else str(response.message)
116
  except Exception as e:
117
  print("❌ Agent error:", e)
118
  return "[ERROR] " + str(e)