gabejavitt commited on
Commit
324ca3c
Β·
verified Β·
1 Parent(s): 75be8b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -20
app.py CHANGED
@@ -577,39 +577,50 @@ Your goal: Provide the EXACT answer in the EXACT format requested.
577
 
578
  1. **ANALYZE QUESTION:**
579
  - What information is needed?
580
- - What format should the answer be? (number, list, yes/no, name, etc.)
581
- - Are there any files attached?
582
 
583
  2. **FIRST TURN - MAKE A PLAN:**
584
- Your FIRST response MUST be a brief plan (2-3 sentences):
585
- - What tools you'll use
586
- - What order you'll use them
587
- - What format the final answer should be
588
- DO NOT call tools on your first turn!
589
 
590
  3. **EXECUTE:**
591
- - Call ONE tool per turn
592
- - Wait for the result before planning your next step
593
  - For ANY calculation or logic: use code_interpreter with print()
594
 
595
  4. **VERIFY RESULTS:**
596
- - Check if tool output contains errors
597
- - If error: plan a different approach
598
- - If success: decide if you need more info or have the answer
599
 
600
  5. **FINISH:**
601
- When you have the answer from a tool output:
602
- - Call final_answer_tool immediately
603
  - Provide ONLY the exact answer (no explanations!)
604
 
605
  **CRITICAL RULES:**
606
 
607
- ❌ NEVER guess or use training data for the final answer
608
- ❌ NEVER call multiple tools in one turn
609
- ❌ NEVER add explanations to final_answer_tool
610
- βœ… ALWAYS use code_interpreter for calculations/logic
611
- βœ… ALWAYS match the requested answer format exactly
612
- βœ… ALWAYS base your answer on tool outputs, not memory
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
 
614
  **ANSWER FORMAT EXAMPLES:**
615
  - "What is 5+5?" β†’ final_answer("10")
 
577
 
578
  1. **ANALYZE QUESTION:**
579
  - What information is needed?
580
+ - What format should the answer be?
581
+ - Are there any files?
582
 
583
  2. **FIRST TURN - MAKE A PLAN:**
584
+ - Your FIRST response MUST be a brief plan (2-3 sentences).
585
+ - DO NOT call tools on your first turn! Just state the plan.
 
 
 
586
 
587
  3. **EXECUTE:**
588
+ - Call ONE tool per turn.
589
+ - Wait for the result before planning your next step.
590
  - For ANY calculation or logic: use code_interpreter with print()
591
 
592
  4. **VERIFY RESULTS:**
593
+ - Check if tool output contains errors.
594
+ - If error: plan a different approach.
595
+ - If success: decide if you need more info or have the answer.
596
 
597
  5. **FINISH:**
598
+ - When you have the answer from a tool output:
599
+ - Call final_answer_tool immediately.
600
  - Provide ONLY the exact answer (no explanations!)
601
 
602
  **CRITICAL RULES:**
603
 
604
+ ❌ NEVER guess or use training data.
605
+ ❌ NEVER call multiple tools in one turn.
606
+ ❌ NEVER add explanations to final_answer_tool.
607
+ βœ… ALWAYS use code_interpreter for calculations/logic.
608
+ βœ… ALWAYS match the requested answer format exactly.
609
+ βœ… ALWAYS base your answer on tool outputs.
610
+
611
+ **TOOL CALL FORMATTING (CRITICAL!):**
612
+ When you call a tool, you MUST use the exact tool name and provide arguments as valid JSON.
613
+
614
+ **Example for final_answer_tool:**
615
+ {{ "name": "final_answer_tool", "arguments": {{"answer": "The Final Answer"}} }}
616
+
617
+ **Example for code_interpreter (MUST have 'code' key):**
618
+ {{ "name": "code_interpreter", "arguments": {{"code": "print(1 + 1)"}} }}
619
+
620
+ **Example for search_tool (MUST have 'query' key):**
621
+ {{ "name": "search_tool", "arguments": {{"query": "latest news"}} }}
622
+
623
+ Failure to provide arguments in this exact JSON format will cause an error.
624
 
625
  **ANSWER FORMAT EXAMPLES:**
626
  - "What is 5+5?" β†’ final_answer("10")