FD900 commited on
Commit
4d888ec
·
verified ·
1 Parent(s): cf54414

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +9 -8
agent.py CHANGED
@@ -53,14 +53,15 @@ class GaiaAgent:
53
  return str(output)
54
 
55
  def answer_question(self, question: Dict) -> str:
56
- q = question["question"]
57
- print(f"📌 [QUESTION] ID: {question.get('id', 'N/A')} - {q}")
58
-
59
- prompt = f"""You are a helpful agent answering a science question.
60
- Question: {q}
61
- Answer:"""
62
-
63
- return self.generate(prompt).strip()
 
64
 
65
  def run(self):
66
  print("🚀 [RUN] Starting submission...")
 
53
  return str(output)
54
 
55
  def answer_question(self, question: Dict) -> str:
56
+ # Try different keys that might contain the question
57
+ q = question.get("question") or question.get("Question") or question.get("input")
58
+ if not q:
59
+ raise ValueError(f"No question text found in: {question}")
60
+
61
+ prompt = f"""You are a helpful agent answering a science question.
62
+ Question: {q}
63
+ Answer:"""
64
+ return self.generate(prompt).strip()
65
 
66
  def run(self):
67
  print("🚀 [RUN] Starting submission...")