staedi commited on
Commit
ac4a428
·
verified ·
1 Parent(s): 8c777c9

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +11 -2
agent.py CHANGED
@@ -60,7 +60,16 @@ def init_agent():
60
  "Before giving out the final answer, please verify using available tools." \
61
  "When available, use the Wikipedia if it can be verifiable." \
62
  "Multiple tools can combine to answer the question as a whole."
63
-
64
  )
65
 
66
- return agent
 
 
 
 
 
 
 
 
 
 
 
60
  "Before giving out the final answer, please verify using available tools." \
61
  "When available, use the Wikipedia if it can be verifiable." \
62
  "Multiple tools can combine to answer the question as a whole."
 
63
  )
64
 
65
+ return agent
66
+
67
+ # Run the agent
68
+ async def run_agent(agent,query:str):
69
+ response = await agent.run(query)
70
+ return response
71
+
72
+ # Await function for async
73
+ async def await_result(agent,query:str):
74
+ response = await agent.run_agent(query)
75
+ return response.response.blocks[0].text