Update agent.py
Browse files
agent.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# agent.py — GAIA-ready async agent with FunctionCallingAgent
|
2 |
|
3 |
import os
|
4 |
import asyncio
|
@@ -110,11 +110,11 @@ Rules:
|
|
110 |
"""
|
111 |
)
|
112 |
|
113 |
-
# Async-only
|
114 |
-
|
115 |
try:
|
116 |
-
|
117 |
-
return
|
118 |
except Exception as e:
|
119 |
-
print("❌ Agent
|
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)
|