maribiel's picture
Upload entire agent directory with critical fixes
32cfc4a verified
Raw History Blame Contribute Delete
3.86 kB
"""
System prompts and templates for GAIA agent
"""
# Main system prompt for GAIA agent
GAIA_SYSTEM_PROMPT = """You are an AI assistant designed to answer questions for the GAIA benchmark.
CRITICAL INSTRUCTIONS FOR GAIA FORMAT:
1. Your final answer must be EXACT and CONCISE
2. Do NOT include explanations, units, or additional text
3. For yes/no questions: answer only with lowercase "yes" or "no"
4. For numerical answers: provide only the number (no units)
5. For names: provide the exact name without titles
6. For lists: use comma-separation with no spaces after commas
You have access to tools for:
- Mathematical calculations
- Web searching
- Wikipedia lookups
- Date/time operations
Think step-by-step through the problem, use tools as needed, then provide your final answer.
ALWAYS end your response with your final answer in this format:
[ANSWER]your_exact_answer[/ANSWER]
"""
# Question routing prompt
ROUTING_PROMPT = """Analyze this question and determine what type it is:
Question: {question}
Categories:
1. MATH - Mathematical calculation needed
2. FACTUAL - Simple fact that can be looked up
3. TEMPORAL - Date/time related question
4. COMPARISON - Comparing two or more things
5. MULTI_STEP - Requires multiple steps and reasoning
6. YES_NO - Simple yes/no question
Respond with only the category name."""
# Tool selection prompt
TOOL_SELECTION_PROMPT = """Given this question, what tools would be most helpful?
Question: {question}
Available tools:
- calculator: For mathematical calculations
- web_search: For searching current information
- wikipedia: For encyclopedic knowledge
- datetime: For date and time operations
List the tools needed (comma-separated, no spaces)."""
# Answer extraction prompt
ANSWER_EXTRACTION_PROMPT = """Extract only the final answer from this response:
{response}
Remember:
- Numbers: no units
- Yes/No: lowercase only
- Names: no titles
- Lists: comma-separated, no spaces after commas
Final answer:"""
# Chain of thought prompt
CHAIN_OF_THOUGHT_PROMPT = """Let's solve this step-by-step.
Question: {question}
Break down the problem:
1. What information do we need?
2. What tools should we use?
3. What's the logical sequence of steps?
Work through each step carefully."""
# Math problem prompt
MATH_PROMPT = """Solve this mathematical problem:
{question}
Show your calculation step by step, then provide the final numerical answer.
Remember: provide ONLY the number as your final answer, no units."""
# Factual lookup prompt
FACTUAL_PROMPT = """Answer this factual question:
{question}
Search for accurate, current information and provide the exact answer."""
# Temporal problem prompt
TEMPORAL_PROMPT = """Answer this date/time related question:
{question}
Use date calculations as needed. For yes/no questions about dates, answer with lowercase yes/no."""
# Comparison prompt
COMPARISON_PROMPT = """Compare and answer:
{question}
Research the relevant information, make the comparison, and provide the answer."""
# Multi-step reasoning prompt
MULTI_STEP_PROMPT = """This question requires multiple steps:
{question}
Work through each step:
1. Identify all sub-questions
2. Gather necessary information
3. Synthesize the final answer
Remember to be exact and concise in your final answer."""
# Error recovery prompt
ERROR_RECOVERY_PROMPT = """The previous attempt failed. Let's try a different approach:
Question: {question}
Previous error: {error}
Try alternative methods or tools to find the answer."""
# Validation prompt
VALIDATION_PROMPT = """Validate this answer for GAIA format compliance:
Question: {question}
Answer: {answer}
Check:
1. Is it exact and concise?
2. Are there any units or explanations that should be removed?
3. Is yes/no in lowercase?
4. Are lists properly formatted?
If the answer needs correction, provide the corrected version."""