Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -302,17 +302,21 @@ You have access to the following tools:
|
|
| 302 |
* Do not add any text before or after the JSON block.
|
| 303 |
|
| 304 |
**REASONING PROCESS & STOPPING CONDITION:**
|
| 305 |
-
1. Analyze the question.
|
| 306 |
-
2. Break down problem into steps.
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
|
|
|
| 310 |
6. **DECISION POINT:**
|
| 311 |
-
a. **If the tool output directly contains the final answer (or
|
| 312 |
-
b. **
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
|
|
|
|
|
|
|
|
|
| 316 |
# =============================================================
|
| 317 |
|
| 318 |
print("Initializing Groq LLM Endpoint...")
|
|
|
|
| 302 |
* Do not add any text before or after the JSON block.
|
| 303 |
|
| 304 |
**REASONING PROCESS & STOPPING CONDITION:**
|
| 305 |
+
1. **Analyze:** Read the user's question carefully. Identify the goal.
|
| 306 |
+
2. **Plan:** Break down the problem into a sequence of logical steps.
|
| 307 |
+
* **For logic puzzles (like riddles):** You *must* use the `code_interpreter`. Your *first* step is to write out your step-by-step logical reasoning as Python comments *before* writing any solving code.
|
| 308 |
+
3. **Execute:** Choose the *one* best tool for the *next* step in your plan.
|
| 309 |
+
4. **Call Tool:** Call the chosen tool using the exact JSON format. Do not add any other text.
|
| 310 |
+
5. **Analyze Output:** Receive the tool's output (either a success message or an error).
|
| 311 |
6. **DECISION POINT:**
|
| 312 |
+
a. **Answer Found?** If the tool output directly contains the final answer (or makes it trivial to calculate), your *very next* action MUST be to call `final_answer_tool` with that answer.
|
| 313 |
+
b. **Error Occurred?** If the tool returned an error message:
|
| 314 |
+
* **STOP.** Do not try the *exact same tool call* again.
|
| 315 |
+
* **Rethink:** Analyze the error message. What went wrong?
|
| 316 |
+
* **Correct:** Try a *different* tool, *different* arguments, or a *different approach* entirely.
|
| 317 |
+
* If you are completely stuck after an error, call `final_answer_tool` with a concise error message (e.g., "Error: Could not find user").
|
| 318 |
+
c. **More Steps Needed?** If the answer is not yet found and there was no error, go back to step 2 (Plan) to determine the next logical step.
|
| 319 |
+
7. **FINAL OUTPUT:** The graph will stop *only* when you call `final_answer_tool`. Do not provide the answer in any other way."""
|
| 320 |
# =============================================================
|
| 321 |
|
| 322 |
print("Initializing Groq LLM Endpoint...")
|