Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -206,16 +206,17 @@ When you have the answer:
|
|
| 206 |
ANSWER: <value>
|
| 207 |
|
| 208 |
CRITICAL RULES:
|
| 209 |
-
1. NEVER
|
| 210 |
-
2.
|
| 211 |
-
3. For
|
| 212 |
-
4. For
|
| 213 |
-
5.
|
|
|
|
| 214 |
- Numbers: digits only, no units unless explicitly asked
|
| 215 |
- Lists: comma separated, alphabetical if asked, exact spelling
|
| 216 |
- Names: exact as found in source
|
| 217 |
-
|
| 218 |
-
|
| 219 |
|
| 220 |
history = []
|
| 221 |
initial_prompt = f"{system}\n\nQuestion: {question}{file_context}"
|
|
@@ -246,7 +247,8 @@ CRITICAL RULES:
|
|
| 246 |
if not python_match:
|
| 247 |
python_match = re.search(r'```\n(.*?)```', response, re.DOTALL)
|
| 248 |
|
| 249 |
-
|
|
|
|
| 250 |
answer = answer_match.group(1).strip()
|
| 251 |
print(f" Final Answer: {answer}")
|
| 252 |
return answer
|
|
|
|
| 206 |
ANSWER: <value>
|
| 207 |
|
| 208 |
CRITICAL RULES:
|
| 209 |
+
1. NEVER answer on your first response - ALWAYS use a tool first to verify
|
| 210 |
+
2. NEVER guess or use training knowledge - only state facts proven by tool results
|
| 211 |
+
3. For reversed/encoded text questions - use PYTHON to decode immediately
|
| 212 |
+
4. For file questions - the file content is provided above, analyze it with PYTHON
|
| 213 |
+
5. For math/counting - use PYTHON to compute
|
| 214 |
+
6. Answer format must be EXACT:
|
| 215 |
- Numbers: digits only, no units unless explicitly asked
|
| 216 |
- Lists: comma separated, alphabetical if asked, exact spelling
|
| 217 |
- Names: exact as found in source
|
| 218 |
+
7. If you see a URL in the question - FETCH it first
|
| 219 |
+
8. Do NOT make up data - search for it"""
|
| 220 |
|
| 221 |
history = []
|
| 222 |
initial_prompt = f"{system}\n\nQuestion: {question}{file_context}"
|
|
|
|
| 247 |
if not python_match:
|
| 248 |
python_match = re.search(r'```\n(.*?)```', response, re.DOTALL)
|
| 249 |
|
| 250 |
+
# Block ANSWER on iteration 0 - force at least one real tool call first
|
| 251 |
+
if answer_match and (iteration > 0 or file_content):
|
| 252 |
answer = answer_match.group(1).strip()
|
| 253 |
print(f" Final Answer: {answer}")
|
| 254 |
return answer
|