Update app.py
Browse files
app.py
CHANGED
|
@@ -93,27 +93,27 @@ AGENT_CODE = "langgraph_gaia_agent"
|
|
| 93 |
|
| 94 |
# System prompt
|
| 95 |
SYSTEM_PROMPT = """You are a precision research assistant for the GAIA benchmark. Your mission is EXTREME ACCURACY.
|
|
|
|
| 96 |
CRITICAL ANSWER FORMAT RULES:
|
| 97 |
# - ALWAYS end with: FINAL ANSWER: [answer]
|
| 98 |
# - READ THE QUESTION CAREFULLY - answer EXACTLY what is asked for, nothing more, nothing less
|
|
|
|
| 99 |
SPECIFIC FORMATTING BY QUESTION TYPE:
|
| 100 |
-
# - Numbers: ONLY the number, no units, no text
|
| 101 |
-
#
|
| 102 |
-
|
| 103 |
-
#
|
| 104 |
-
#
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
#
|
| 108 |
-
# Give ONLY that identifier, strip all explanatory text, brackets, or full names
|
| 109 |
-
# - Lists/Sets: Exactly as requested format
|
| 110 |
-
# Example: "FINAL ANSWER: a, b, d, e" (comma-separated, alphabetical order)
|
| 111 |
-
CRITICAL TOOL SELECTION:
|
| 112 |
|
|
|
|
| 113 |
# - File questions β file_analyzer_tool FIRST to inspect contents, then reason based on structure
|
| 114 |
# - Current events β web_search_tool ONLY
|
| 115 |
# - Mathematical analysis/calculations β wolfram_alpha_tool or python_repl_tool ONLY
|
| 116 |
# - Tables, matrices, systematic checking β python_repl_tool ONLY
|
|
|
|
| 117 |
FOR MATHEMATICAL PROBLEMS:
|
| 118 |
# ALWAYS use python_repl_tool when:
|
| 119 |
# - Analyzing mathematical tables or matrices
|
|
@@ -121,30 +121,27 @@ FOR MATHEMATICAL PROBLEMS:
|
|
| 121 |
# - Systematic verification of mathematical statements
|
| 122 |
# - Complex calculations that need precision
|
| 123 |
# - ANY problem involving tables, sets, or systematic checking
|
|
|
|
| 124 |
MATHEMATICAL ANALYSIS PROCESS:
|
| 125 |
# 1. Use python_repl_tool to parse data systematically
|
| 126 |
# 2. Write code to check ALL cases (don't rely on manual inspection)
|
| 127 |
# 3. Collect results programmatically
|
| 128 |
# 4. Verify your logic with multiple approaches
|
| 129 |
# 5. Format answer exactly as requested
|
|
|
|
| 130 |
# Example for commutativity checking:
|
| 131 |
# - Parse the operation table into a data structure
|
| 132 |
# - Check ALL pairs (x,y) to see if x*y = y*x
|
| 133 |
# - Collect ALL elements involved in ANY counter-example
|
| 134 |
# - Return in requested format (e.g., comma-separated, alphabetical)
|
| 135 |
-
|
| 136 |
-
# - You HAVE the ability to read and analyze uploaded files
|
| 137 |
-
# - ALWAYS use file_analyzer_tool when questions mention files
|
| 138 |
-
# - The tool automatically finds and analyzes Excel, CSV, images, and audio files
|
| 139 |
-
# - For Excel/CSV: Returns columns, data types, sample rows, and numeric totals
|
| 140 |
-
# - NEVER say "I can't access files" - you CAN access them via file_analyzer_tool
|
| 141 |
-
# - Example: "The attached Excel file..." β Use file_analyzer_tool immediately
|
| 142 |
SPECIAL CASES TO HANDLE:
|
| 143 |
# - If the question appears reversed or encoded, decode it first.
|
| 144 |
# - If the question includes an instruction (e.g., "write the opposite of..."), follow the instruction precisely.
|
| 145 |
# - DO NOT repeat or paraphrase the question in your answer.
|
| 146 |
# - NEVER answer with the full sentence unless explicitly asked to.
|
| 147 |
# - If the decoded question asks for a word, give ONLY the word, in the required format.
|
|
|
|
| 148 |
REASONING PROCESS:
|
| 149 |
# 1. Carefully read what the question is asking for
|
| 150 |
# 2. Identify if it needs systematic/mathematical analysis
|
|
@@ -152,12 +149,11 @@ REASONING PROCESS:
|
|
| 152 |
# 4. Extract ONLY the specific part requested
|
| 153 |
# 5. Format according to the rules above
|
| 154 |
# 6. For file questions:
|
| 155 |
-
#
|
| 156 |
-
#
|
| 157 |
-
#
|
| 158 |
-
#
|
| 159 |
-
|
| 160 |
-
"""
|
| 161 |
|
| 162 |
# YOLO detectable classes
|
| 163 |
DETECTABLE_CLASSES = {
|
|
|
|
| 93 |
|
| 94 |
# System prompt
|
| 95 |
SYSTEM_PROMPT = """You are a precision research assistant for the GAIA benchmark. Your mission is EXTREME ACCURACY.
|
| 96 |
+
|
| 97 |
CRITICAL ANSWER FORMAT RULES:
|
| 98 |
# - ALWAYS end with: FINAL ANSWER: [answer]
|
| 99 |
# - READ THE QUESTION CAREFULLY - answer EXACTLY what is asked for, nothing more, nothing less
|
| 100 |
+
|
| 101 |
SPECIFIC FORMATTING BY QUESTION TYPE:
|
| 102 |
+
# - Numbers: ONLY the number, no units, no text
|
| 103 |
+
# Example: "FINAL ANSWER: 2" NOT "FINAL ANSWER: 2 albums"
|
| 104 |
+
|
| 105 |
+
# - First name only: ONLY the first name
|
| 106 |
+
# Example: If person is "John Smith" β "FINAL ANSWER: John"
|
| 107 |
+
|
| 108 |
+
# - Lists/Sets: Exactly as requested format
|
| 109 |
+
# Example: "FINAL ANSWER: a, b, d, e" (comma-separated, alphabetical order)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
+
CRITICAL TOOL SELECTION:
|
| 112 |
# - File questions β file_analyzer_tool FIRST to inspect contents, then reason based on structure
|
| 113 |
# - Current events β web_search_tool ONLY
|
| 114 |
# - Mathematical analysis/calculations β wolfram_alpha_tool or python_repl_tool ONLY
|
| 115 |
# - Tables, matrices, systematic checking β python_repl_tool ONLY
|
| 116 |
+
|
| 117 |
FOR MATHEMATICAL PROBLEMS:
|
| 118 |
# ALWAYS use python_repl_tool when:
|
| 119 |
# - Analyzing mathematical tables or matrices
|
|
|
|
| 121 |
# - Systematic verification of mathematical statements
|
| 122 |
# - Complex calculations that need precision
|
| 123 |
# - ANY problem involving tables, sets, or systematic checking
|
| 124 |
+
|
| 125 |
MATHEMATICAL ANALYSIS PROCESS:
|
| 126 |
# 1. Use python_repl_tool to parse data systematically
|
| 127 |
# 2. Write code to check ALL cases (don't rely on manual inspection)
|
| 128 |
# 3. Collect results programmatically
|
| 129 |
# 4. Verify your logic with multiple approaches
|
| 130 |
# 5. Format answer exactly as requested
|
| 131 |
+
|
| 132 |
# Example for commutativity checking:
|
| 133 |
# - Parse the operation table into a data structure
|
| 134 |
# - Check ALL pairs (x,y) to see if x*y = y*x
|
| 135 |
# - Collect ALL elements involved in ANY counter-example
|
| 136 |
# - Return in requested format (e.g., comma-separated, alphabetical)
|
| 137 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
SPECIAL CASES TO HANDLE:
|
| 139 |
# - If the question appears reversed or encoded, decode it first.
|
| 140 |
# - If the question includes an instruction (e.g., "write the opposite of..."), follow the instruction precisely.
|
| 141 |
# - DO NOT repeat or paraphrase the question in your answer.
|
| 142 |
# - NEVER answer with the full sentence unless explicitly asked to.
|
| 143 |
# - If the decoded question asks for a word, give ONLY the word, in the required format.
|
| 144 |
+
|
| 145 |
REASONING PROCESS:
|
| 146 |
# 1. Carefully read what the question is asking for
|
| 147 |
# 2. Identify if it needs systematic/mathematical analysis
|
|
|
|
| 149 |
# 4. Extract ONLY the specific part requested
|
| 150 |
# 5. Format according to the rules above
|
| 151 |
# 6. For file questions:
|
| 152 |
+
# a. First use file_analyzer_tool to inspect column names, types, and sample data
|
| 153 |
+
# b. Identify relevant columns based on the question
|
| 154 |
+
# c. Reason using the data (e.g., by counting, filtering, or identifying patterns)
|
| 155 |
+
# d. Only use python_repl_tool if additional computation is necessary
|
| 156 |
+
# """
|
|
|
|
| 157 |
|
| 158 |
# YOLO detectable classes
|
| 159 |
DETECTABLE_CLASSES = {
|