Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,8 +48,12 @@ class BasicAgent:
|
|
| 48 |
async def run(self, question: str) -> str:
|
| 49 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 50 |
answer = await self.agent.run(question)
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
def __call__(self, question: str) -> str:
|
| 55 |
return asyncio.run(self.run(question))
|
|
|
|
| 48 |
async def run(self, question: str) -> str:
|
| 49 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 50 |
answer = await self.agent.run(question)
|
| 51 |
+
if hasattr(answer, "output"):
|
| 52 |
+
print(f"Agent returning answer: {answer}")
|
| 53 |
+
return str(answer.output)
|
| 54 |
+
else:
|
| 55 |
+
print(f"Agent returning answer: {answer}")
|
| 56 |
+
return str(answer)
|
| 57 |
|
| 58 |
def __call__(self, question: str) -> str:
|
| 59 |
return asyncio.run(self.run(question))
|