Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,11 +26,38 @@ class GaiaAgent:
|
|
| 26 |
tools=tools
|
| 27 |
)
|
| 28 |
|
| 29 |
-
def __call__(self, query: str) -> str:
|
| 30 |
-
return self.agent.run(query)
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
|
| 36 |
|
|
|
|
| 26 |
tools=tools
|
| 27 |
)
|
| 28 |
|
| 29 |
+
#def __call__(self, query: str) -> str:
|
| 30 |
+
#return self.agent.run(query)
|
| 31 |
+
|
| 32 |
+
#def __call__(self, query: str) -> str:
|
| 33 |
+
#result = self.agent.run(query)
|
| 34 |
+
#return result.get("output", "No output returned")
|
| 35 |
+
|
| 36 |
+
def __call__(self, question: str) -> str:
|
| 37 |
+
prompt = f"""You are an agent solving the GAIA benchmark and you are required to provide exact answers.
|
| 38 |
+
Rules to follow:
|
| 39 |
+
1. Return only the exact requested answer: no explanation and no reasoning.
|
| 40 |
+
2. For yes/no questions, return exactly "Yes" or "No".
|
| 41 |
+
3. For dates, use the exact format requested.
|
| 42 |
+
4. For numbers, use the exact number, no other format.
|
| 43 |
+
5. For names, use the exact name as found in sources.
|
| 44 |
+
6. If the question has an associated file, download the file first using the task ID.
|
| 45 |
+
|
| 46 |
+
Examples of good responses:
|
| 47 |
+
- "42"
|
| 48 |
+
- "Pinco Palla"
|
| 49 |
+
- "Yes"
|
| 50 |
+
- "October 5, 2001"
|
| 51 |
+
- "Buenos Aires"
|
| 52 |
+
|
| 53 |
+
Never include phrases like "the answer is..." or "Based on my research".
|
| 54 |
+
Only return the exact answer.
|
| 55 |
+
|
| 56 |
+
QUESTION:
|
| 57 |
+
{question}
|
| 58 |
+
"""
|
| 59 |
+
result = self.agent.run(prompt)
|
| 60 |
+
return result.get("output", "No output returned")
|
| 61 |
|
| 62 |
|
| 63 |
|