Orel MAZOR commited on
Commit
08f3a23
·
1 Parent(s): 32ae503
Files changed (2) hide show
  1. app.py +4 -4
  2. appasync.py +4 -4
app.py CHANGED
@@ -20,18 +20,18 @@ class BasicAgent:
20
  # Initialize your enhanced GAIA agent
21
  self.gaia_agent = GAIAAgent()
22
 
23
- async def __call__(self, question: str) -> str:
24
  try:
25
  question_data = {
26
  "Question": question,
27
  "task_id": "basic_agent_task"
28
  }
29
- answer = await self.gaia_agent.solve_gaia_question(question_data)
30
  return str(answer)
31
  except Exception as e:
32
  return e
33
 
34
- async def run_and_submit_all( profile: gr.OAuthProfile | None):
35
  """
36
  Fetches all questions, runs the BasicAgent on them, submits all answers,
37
  and displays the results.
@@ -94,7 +94,7 @@ async def run_and_submit_all( profile: gr.OAuthProfile | None):
94
  print(f"Skipping item with missing task_id or question: {item}")
95
  continue
96
  try:
97
- submitted_answer = await agent(question_text)
98
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
99
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
100
  except Exception as e:
 
20
  # Initialize your enhanced GAIA agent
21
  self.gaia_agent = GAIAAgent()
22
 
23
+ def __call__(self, question: str) -> str:
24
  try:
25
  question_data = {
26
  "Question": question,
27
  "task_id": "basic_agent_task"
28
  }
29
+ answer = self.gaia_agent.solve_gaia_question(question_data)
30
  return str(answer)
31
  except Exception as e:
32
  return e
33
 
34
+ def run_and_submit_all( profile: gr.OAuthProfile | None):
35
  """
36
  Fetches all questions, runs the BasicAgent on them, submits all answers,
37
  and displays the results.
 
94
  print(f"Skipping item with missing task_id or question: {item}")
95
  continue
96
  try:
97
+ submitted_answer = agent(question_text)
98
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
99
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
100
  except Exception as e:
appasync.py CHANGED
@@ -20,18 +20,18 @@ class BasicAgent:
20
  # Initialize your enhanced GAIA agent
21
  self.gaia_agent = GAIAAgent()
22
 
23
- def __call__(self, question: str) -> str:
24
  try:
25
  question_data = {
26
  "Question": question,
27
  "task_id": "basic_agent_task"
28
  }
29
- answer = self.gaia_agent.solve_gaia_question(question_data)
30
  return str(answer)
31
  except Exception as e:
32
  return e
33
 
34
- def run_and_submit_all( profile: gr.OAuthProfile | None):
35
  """
36
  Fetches all questions, runs the BasicAgent on them, submits all answers,
37
  and displays the results.
@@ -94,7 +94,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
94
  print(f"Skipping item with missing task_id or question: {item}")
95
  continue
96
  try:
97
- submitted_answer = agent(question_text)
98
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
99
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
100
  except Exception as e:
 
20
  # Initialize your enhanced GAIA agent
21
  self.gaia_agent = GAIAAgent()
22
 
23
+ async def __call__(self, question: str) -> str:
24
  try:
25
  question_data = {
26
  "Question": question,
27
  "task_id": "basic_agent_task"
28
  }
29
+ answer = await self.gaia_agent.solve_gaia_question(question_data)
30
  return str(answer)
31
  except Exception as e:
32
  return e
33
 
34
+ async def run_and_submit_all( profile: gr.OAuthProfile | None):
35
  """
36
  Fetches all questions, runs the BasicAgent on them, submits all answers,
37
  and displays the results.
 
94
  print(f"Skipping item with missing task_id or question: {item}")
95
  continue
96
  try:
97
+ submitted_answer = await agent(question_text)
98
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
99
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
100
  except Exception as e: