dawid-lorek commited on
Commit
81fefb0
·
verified ·
1 Parent(s): 3b19200

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +6 -6
agent.py CHANGED
@@ -1,4 +1,4 @@
1
- # agent.py — GAIA-ready async agent with FunctionCallingAgent and tool_call fix
2
 
3
  import os
4
  import asyncio
@@ -110,11 +110,11 @@ Rules:
110
  """
111
  )
112
 
113
- # Async-only interface to avoid tool_call sync error
114
- async def answer_question(question: str) -> str:
115
  try:
116
- resp = await agent.achat(question)
117
- return resp.response.content.strip() if hasattr(resp, "response") else str(resp).strip()
118
  except Exception as e:
119
- print("❌ Agent exception:", e)
120
  return "[ERROR] " + str(e)
 
1
+ # agent.py — GAIA-ready async agent with FunctionCallingAgent + run fix
2
 
3
  import os
4
  import asyncio
 
110
  """
111
  )
112
 
113
+ # Async-only with automatic tool execution
114
+ aSYNC def answer_question(question: str) -> str:
115
  try:
116
+ result = await agent.arun(question)
117
+ return result.strip()
118
  except Exception as e:
119
+ print("❌ Agent error:", e)
120
  return "[ERROR] " + str(e)