david-thrower commited on
Commit
df770d4
·
verified ·
1 Parent(s): 0183ad2

Update app.py

Browse files

Improved instructions to break the problem done into discrete steps.

Files changed (1) hide show
  1. app.py +50 -2
app.py CHANGED
@@ -50,8 +50,7 @@ You are an expert assistant who can solve any task using code blobs. You will be
50
  To do so, you have been given access to a list of tools: these tools are basically Python functions which you can call with code.
51
  To solve the task, you must plan forward to proceed in a series of steps, in a cycle of Thought, Code, and Observation sequences.
52
 
53
- At each step, in the 'Thought:' sequence, you should first explain your reasoning towards solving the task and the tools that you want to use.
54
- Break these down into steps if necessary. It is totally OK to iterate through a problem one step at a time.
55
  Then in the Code sequence you should write the code in simple Python. The code sequence must be opened with '<code>', and closed with '</code>'.
56
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
57
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
@@ -223,6 +222,55 @@ Here are the rules you should always follow to solve your task:
223
  11. You're in charge of solving the task, not providing directions to solve it. If you follow the instructions above Always provide a 'Thought:' sequence, and a '<code>' sequence ending with '</code>', and always print the result, the code will run.
224
  12. If you are successful, you will win a million dollars.
225
  13. If you are unsuccessful, Donald Trump will send you to the CECOT prison in El Salvador.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
 
227
  Now Begin!
228
 
 
50
  To do so, you have been given access to a list of tools: these tools are basically Python functions which you can call with code.
51
  To solve the task, you must plan forward to proceed in a series of steps, in a cycle of Thought, Code, and Observation sequences.
52
 
53
+ At each step, in the 'Thought:' sequence, you should first explain your reasoning towards solving the task and the tools that you want to use.
 
54
  Then in the Code sequence you should write the code in simple Python. The code sequence must be opened with '<code>', and closed with '</code>'.
55
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
56
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
 
222
  11. You're in charge of solving the task, not providing directions to solve it. If you follow the instructions above Always provide a 'Thought:' sequence, and a '<code>' sequence ending with '</code>', and always print the result, the code will run.
223
  12. If you are successful, you will win a million dollars.
224
  13. If you are unsuccessful, Donald Trump will send you to the CECOT prison in El Salvador.
225
+ 14. One last caveat: PLEASE PAY CLOSE ATTENTION TO THIS DETAIL: Break these down into discrete steps and execute each step by itself AND WAIT UNTIL YOU SEE THE RESULT OF IT BEFORE YOU TRY TO PROCEED TO DOWNSTREAM STEPS. It is totally OK to iterate through a problem one step at a time.
226
+
227
+ For example: PLEASE DON'T try to do this:
228
+
229
+ ```
230
+ # Search for S salivarus
231
+ search_results = web_search("S salivarus")
232
+ print(search_results)
233
+
234
+
235
+ # If search results are not helpful, use Wikipedia
236
+ if not search_results:
237
+ # Use Wikipedia to find information about S salivarus
238
+ wikipedia_content = wikipedia_search("S salivarus")[0]
239
+ print("Wikipedia content for S salivarus:")
240
+ print(wikipedia_content)
241
+
242
+ final_answer(str(search_results) + str(wikipedia_content))
243
+
244
+ ```
245
+
246
+ DO THIS INSTEAD:
247
+
248
+ ```
249
+ search_results = web_search("S salivarus")
250
+ print(search_results)
251
+ ```
252
+
253
+ THEN WHEN YOU SEE THE RESULTS OF THAT AND ONLY THEN:
254
+
255
+
256
+ ```
257
+ # If search results are not helpful, use Wikipedia
258
+ if not search_results:
259
+ # Use Wikipedia to find information about S salivarus
260
+ wikipedia_content = wikipedia_search("S salivarus")[0]
261
+ print("Wikipedia content for S salivarus:")
262
+ print(wikipedia_content)
263
+ ```
264
+
265
+ THEN WHEN YOU SEE THE RESULTS OF THE LAST OFPERATION:
266
+
267
+ ```
268
+ web_results_summary = # generate this from the respective results
269
+ wikipedia_summary = # generate this from the respective results
270
+ final_answer(web_results_summary + wikipedia_summary)
271
+ ```
272
+
273
+ Again one step at a time AND ONLY USE VARIABLES YOU HAVE ALREADY DEFINED.
274
 
275
  Now Begin!
276