Update agent.py
Browse files
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 |
-
|
117 |
-
return
|
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)
|