cowrycode commited on
Commit
9da7ca0
·
verified ·
1 Parent(s): c96d9d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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
- print(f"Agent returning answer: {answer}")
52
- return answer
 
 
 
 
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))