gabejavitt commited on
Commit
2ecc0ef
·
verified ·
1 Parent(s): 6b4981b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -10
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
- 3. Determine if tools are needed.
308
- 4. If needed, call tool using JSON format. Wait for output.
309
- 5. Analyze tool output.
 
310
  6. **DECISION POINT:**
311
- a. **If the tool output directly contains the final answer (or allows trivial calculation):** Your *next* response MUST be a call to `final_answer_tool` with only that answer. **DO NOT** call any more tools.
312
- b. **If more steps or tools are needed:** Continue reasoning, go back to step 4.
313
- c. **If a tool call results in an error:** **Do not** try the exact same tool call again. Re-evaluate, try different arguments, or a different tool. If stuck, call `final_answer_tool` with an error message.
314
- 7. **FINAL OUTPUT:** The graph will stop *only* when you call `final_answer_tool`.
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...")