mgerlitz commited on
Commit
e04fbcc
·
verified ·
1 Parent(s): 453240c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -58,20 +58,20 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
58
  prompt_templates = yaml.safe_load(stream)
59
 
60
  # We're creating our CodeAgent
61
- #agent = CodeAgent(
62
- # model=model,
63
- # tools=[final_answer, DuckDuckGoSearchTool()], # add your tools here (don't remove final_answer)
64
- # max_steps=6,
65
- # verbosity_level=1,
66
- # grammar=None,
67
- # planning_interval=None,
68
- # name=None,
69
- # description=None,
70
- # prompt_templates=prompt_templates
71
- #)
72
 
73
 
74
- agent = BasicAgent()
75
  except Exception as e:
76
  print(f"Error instantiating agent: {e}")
77
  return f"Error initializing agent: {e}", None
@@ -111,7 +111,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
111
  print(f"Skipping item with missing task_id or question: {item}")
112
  continue
113
  try:
114
- submitted_answer = agent(question_text)
115
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
116
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
117
  except Exception as e:
 
58
  prompt_templates = yaml.safe_load(stream)
59
 
60
  # We're creating our CodeAgent
61
+ agent = CodeAgent(
62
+ model=model,
63
+ tools=[final_answer, DuckDuckGoSearchTool()], # add your tools here (don't remove final_answer)
64
+ max_steps=6,
65
+ verbosity_level=1,
66
+ grammar=None,
67
+ planning_interval=None,
68
+ name=None,
69
+ description=None,
70
+ prompt_templates=prompt_templates
71
+ )
72
 
73
 
74
+ #agent = BasicAgent()
75
  except Exception as e:
76
  print(f"Error instantiating agent: {e}")
77
  return f"Error initializing agent: {e}", None
 
111
  print(f"Skipping item with missing task_id or question: {item}")
112
  continue
113
  try:
114
+ submitted_answer = agent.run(question_text)
115
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
116
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
117
  except Exception as e: