Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -53,14 +53,15 @@ class GaiaAgent:
|
|
| 53 |
return str(output)
|
| 54 |
|
| 55 |
def answer_question(self, question: Dict) -> str:
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
| 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...")
|