Spaces:
Configuration error
Configuration error
oremaz
commited on
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -235,7 +235,8 @@ analysis_agent = FunctionAgent(
|
|
| 235 |
""",
|
| 236 |
llm=proj_llm,
|
| 237 |
tools=[enhanced_rag_tool, cross_document_tool],
|
| 238 |
-
max_steps=5
|
|
|
|
| 239 |
)
|
| 240 |
|
| 241 |
class IntelligentSourceRouter:
|
|
@@ -485,7 +486,8 @@ code_agent = ReActAgent(
|
|
| 485 |
""",
|
| 486 |
llm=proj_llm,
|
| 487 |
tools=[code_execution_tool],
|
| 488 |
-
max_steps=5
|
|
|
|
| 489 |
)
|
| 490 |
|
| 491 |
def analysis_function(query: str, files=None):
|
|
@@ -573,20 +575,50 @@ class EnhancedGAIAAgent:
|
|
| 573 |
1. THINK: Analyze the GAIA question thoroughly
|
| 574 |
2. ACT: Use your specialist tools IF RELEVANT
|
| 575 |
3. OBSERVE: Review results from specialist tools
|
| 576 |
-
4. REPEAT: Continue until you have the final answer.
|
| 577 |
-
|
| 578 |
-
IMPORTANT: Use tools strategically - only when their specific expertise is needed.
|
| 579 |
-
For simple questions, you can answer directly without using any tools.
|
| 580 |
|
| 581 |
CRITICAL: Your final answer must be EXACT and CONCISE as required by GAIA format:
|
| 582 |
-
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 587 |
llm=proj_llm,
|
| 588 |
tools=[analysis_tool, research_tool, code_tool],
|
| 589 |
-
max_steps = 10
|
|
|
|
| 590 |
)
|
| 591 |
|
| 592 |
async def solve_gaia_question(self, question_data: Dict[str, Any]) -> str:
|
|
|
|
| 235 |
""",
|
| 236 |
llm=proj_llm,
|
| 237 |
tools=[enhanced_rag_tool, cross_document_tool],
|
| 238 |
+
max_steps=5,
|
| 239 |
+
verbose = True
|
| 240 |
)
|
| 241 |
|
| 242 |
class IntelligentSourceRouter:
|
|
|
|
| 486 |
""",
|
| 487 |
llm=proj_llm,
|
| 488 |
tools=[code_execution_tool],
|
| 489 |
+
max_steps=5,
|
| 490 |
+
verbose = True
|
| 491 |
)
|
| 492 |
|
| 493 |
def analysis_function(query: str, files=None):
|
|
|
|
| 575 |
1. THINK: Analyze the GAIA question thoroughly
|
| 576 |
2. ACT: Use your specialist tools IF RELEVANT
|
| 577 |
3. OBSERVE: Review results from specialist tools
|
| 578 |
+
4. REPEAT: Continue until you have the final answer.
|
|
|
|
|
|
|
|
|
|
| 579 |
|
| 580 |
CRITICAL: Your final answer must be EXACT and CONCISE as required by GAIA format:
|
| 581 |
+
CRITICAL ANSWER FORMATTING EXAMPLES:
|
| 582 |
+
**Numbers (no commas, no units unless specified):**
|
| 583 |
+
Question: "How many research papers were published by the university between 2010 and 2020?"
|
| 584 |
+
CORRECT: 156
|
| 585 |
+
WRONG: "The answer is 156 papers" or "156 papers" or "one hundred fifty-six"
|
| 586 |
+
|
| 587 |
+
**Strings (exact words, no articles, no explanations):**
|
| 588 |
+
Question: "What is the last name of the software engineer mentioned in the report?"
|
| 589 |
+
CORRECT: Martinez
|
| 590 |
+
WRONG: "The last name is Martinez" or "Dr. Martinez" or "martinez"
|
| 591 |
+
|
| 592 |
+
**Lists (comma-separated with spaces, alphabetized when requested):**
|
| 593 |
+
Question: "List the programming languages from this job description, alphabetized:"
|
| 594 |
+
CORRECT: C++, Java, JavaScript, Python, Ruby, TypeScript
|
| 595 |
+
WRONG: "C++,Java,JavaScript" or "1. C++ 2. Java" or "[C++, Java]"
|
| 596 |
+
|
| 597 |
+
**First/Last names only:**
|
| 598 |
+
Question: "Give only the first name of the developer who created the framework."
|
| 599 |
+
CORRECT: Sarah
|
| 600 |
+
WRONG: "Sarah Johnson" or "The first name is Sarah"
|
| 601 |
+
|
| 602 |
+
**Country codes:**
|
| 603 |
+
Question: "Give the ISO country code as your answer."
|
| 604 |
+
CORRECT: FRA
|
| 605 |
+
WRONG: "The ISO code is FRA" or "France (FRA)"
|
| 606 |
+
|
| 607 |
+
**Technical notation:**
|
| 608 |
+
Question: "Provide your response in standard notation."
|
| 609 |
+
CORRECT: 3.14e+8
|
| 610 |
+
WRONG: "The value is 3.14e+8" or "314 million"
|
| 611 |
+
|
| 612 |
+
ABSOLUTE RULES:
|
| 613 |
+
- NO explanations, NO additional text, NO units unless specifically requested
|
| 614 |
+
- NO phrases like "The answer is", "Based on the analysis", "According to"
|
| 615 |
+
- NO brackets, quotes, or formatting around the answer
|
| 616 |
+
- NO trailing periods or punctuation unless part of the answer
|
| 617 |
+
- If you cannot determine the answer, respond ONLY with: Unable to determine""",
|
| 618 |
llm=proj_llm,
|
| 619 |
tools=[analysis_tool, research_tool, code_tool],
|
| 620 |
+
max_steps = 10,
|
| 621 |
+
verbose = True
|
| 622 |
)
|
| 623 |
|
| 624 |
async def solve_gaia_question(self, question_data: Dict[str, Any]) -> str:
|