menaahmed22 commited on
Commit
bd8fc0e
·
verified ·
1 Parent(s): e52c708

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -17,16 +17,16 @@ class BasicAgent:
17
  print("BasicAgent initialized.")
18
  def __call__(self, question: str) -> str:
19
  print(f"Agent received question (first 50 chars): {question[:50]}...")
20
- try:
21
- model = model=HfApiModel() )
22
- agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model, add_base_tools=True)
23
- agent_response = agent.run(question)
24
- except Exception as e:
25
- print(f"Error running agent: {e}")
26
- return f"AGENT ERROR: {e}"
27
 
28
  print(f"Agent returning answer: {agent_response}")
29
- return agent_response
30
  def run_and_submit_all( profile: gr.OAuthProfile | None):
31
  """
32
  Fetches all questions, runs the BasicAgent on them, submits all answers,
 
17
  print("BasicAgent initialized.")
18
  def __call__(self, question: str) -> str:
19
  print(f"Agent received question (first 50 chars): {question[:50]}...")
20
+ try:
21
+ model = model=HfApiModel() )
22
+ agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model, add_base_tools=True)
23
+ agent_response = agent.run(question)
24
+ except Exception as e:
25
+ print(f"Error running agent: {e}")
26
+ return f"AGENT ERROR: {e}"
27
 
28
  print(f"Agent returning answer: {agent_response}")
29
+ return agent_response
30
  def run_and_submit_all( profile: gr.OAuthProfile | None):
31
  """
32
  Fetches all questions, runs the BasicAgent on them, submits all answers,