Albannach58 commited on
Commit
e983d19
·
verified ·
1 Parent(s): 5e61022

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -52,7 +52,15 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
52
 
53
  # 1. Instantiate Agent ( modify this part to create your agent)
54
  try:
55
- agent = BasicAgent()
 
 
 
 
 
 
 
 
56
  except Exception as e:
57
  print(f"Error instantiating agent: {e}")
58
  return f"Error initializing agent: {e}", None
@@ -92,7 +100,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
92
  print(f"Skipping item with missing task_id or question: {item}")
93
  continue
94
  try:
95
- submitted_answer = agent(question_text)
96
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
97
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
98
  except Exception as e:
 
52
 
53
  # 1. Instantiate Agent ( modify this part to create your agent)
54
  try:
55
+ # agent = BasicAgent()
56
+ # tools=tools, model=model, additional_authorized_imports=["requests", "bs4"], max_steps=20
57
+ agent = CodeAgent(
58
+ model=model,
59
+ tools=tools,
60
+ max_steps=10, # Set the maximum number of steps here
61
+ additional_authorized_imports=["requests", "bs4"],
62
+ verbosity_level=2
63
+ )
64
  except Exception as e:
65
  print(f"Error instantiating agent: {e}")
66
  return f"Error initializing agent: {e}", None
 
100
  print(f"Skipping item with missing task_id or question: {item}")
101
  continue
102
  try:
103
+ submitted_answer = agent.run(question_text)
104
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
105
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
106
  except Exception as e: