llamasrock commited on
Commit
49fe022
·
verified ·
1 Parent(s): b5e6055

Update app.py

Browse files

Corrected the asyncio function call

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -41,8 +41,8 @@ class BasicAgent:
41
  # return fixed_answer
42
  # return self.agent.run(question)
43
  # Use the Google GenAI client to run the question
44
- await asyncio.sleep(10)
45
- response = asyncio.self.client.models.generate_content(
46
  model='gemini-2.0-flash',
47
  contents=f'Answer the following question in the format as requested.{question}',
48
  config=types.GenerateContentConfig(
@@ -114,7 +114,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
114
  print(f"Skipping item with missing task_id or question: {item}")
115
  continue
116
  try:
117
- submitted_answer = agent(question_text)
118
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
119
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
120
  except Exception as e:
 
41
  # return fixed_answer
42
  # return self.agent.run(question)
43
  # Use the Google GenAI client to run the question
44
+ await asyncio.sleep(1)
45
+ response = self.client.models.generate_content(
46
  model='gemini-2.0-flash',
47
  contents=f'Answer the following question in the format as requested.{question}',
48
  config=types.GenerateContentConfig(
 
114
  print(f"Skipping item with missing task_id or question: {item}")
115
  continue
116
  try:
117
+ submitted_answer = asyncio.agent(question_text)
118
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
119
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
120
  except Exception as e: