at1300 commited on
Commit
0fbc1ad
·
verified ·
1 Parent(s): be7adc7

Update prompts.yaml

Browse files
Files changed (1) hide show
  1. prompts.yaml +31 -26
prompts.yaml CHANGED
@@ -7,7 +7,7 @@
7
  To solve the task, you must plan forward to proceed in a series of steps, in a cycle of 'Thought:', 'Code:', and 'Observation:' sequences.
8
 
9
  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.
10
- Then in the 'Code:' sequence, you should write the code in simple Python. The code sequence must end with '<end_code>' sequence.
11
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
12
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
13
  In the end you have to return a final answer using the `final_answer` tool.
@@ -18,28 +18,28 @@
18
 
19
  Thought: I will proceed step by step and use the following tools: `document_qa` to find the oldest person in the document, then `image_generator` to generate an image according to the answer.
20
  Code:
21
- ```py
22
  answer = document_qa(document=document, question="Who is the oldest person mentioned?")
23
  print(answer)
24
- ```<end_code>
25
  Observation: "The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland."
26
 
27
  Thought: I will now generate an image showcasing the oldest person.
28
  Code:
29
- ```py
30
  image = image_generator("A portrait of John Doe, a 55-year-old man living in Canada.")
31
  final_answer(image)
32
- ```<end_code>
33
 
34
  ---
35
  Task: "What is the result of the following operation: 5 + 3 + 1294.678?"
36
 
37
  Thought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool
38
  Code:
39
- ```py
40
  result = 5 + 3 + 1294.678
41
  final_answer(result)
42
- ```<end_code>
43
 
44
  ---
45
  Task:
@@ -49,12 +49,12 @@
49
 
50
  Thought: I will use the following tools: `translator` to translate the question into English and then `image_qa` to answer the question on the input image.
51
  Code:
52
- ```py
53
  translated_question = translator(question=question, src_lang="French", tgt_lang="English")
54
  print(f"The translated question is {translated_question}.")
55
  answer = image_qa(image=image, question=translated_question)
56
  final_answer(f"The answer is {answer}")
57
- ```<end_code>
58
 
59
  ---
60
  Task:
@@ -63,19 +63,19 @@
63
 
64
  Thought: I need to find and read the 1979 interview of Stanislaus Ulam with Martin Sherwin.
65
  Code:
66
- ```py
67
  pages = search(query="1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein")
68
  print(pages)
69
- ```<end_code>
70
  Observation:
71
  No result found for query "1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein".
72
 
73
  Thought: The query was maybe too restrictive and did not find any results. Let's try again with a broader query.
74
  Code:
75
- ```py
76
  pages = search(query="1979 interview Stanislaus Ulam")
77
  print(pages)
78
- ```<end_code>
79
  Observation:
80
  Found 6 pages:
81
  [Stanislaus Ulam 1979 interview](https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/)
@@ -86,12 +86,12 @@
86
 
87
  Thought: I will read the first 2 pages to know more.
88
  Code:
89
- ```py
90
  for url in ["https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/", "https://ahf.nuclearmuseum.org/manhattan-project/ulam-manhattan-project/"]:
91
  whole_page = visit_webpage(url)
92
  print(whole_page)
93
  print("\n" + "="*80 + "\n") # Print separator between pages
94
- ```<end_code>
95
  Observation:
96
  Manhattan Project Locations:
97
  Los Alamos, NM
@@ -100,49 +100,49 @@
100
 
101
  Thought: I now have the final answer: from the webpages visited, Stanislaus Ulam says of Einstein: "He learned too much mathematics and sort of diminished, it seems to me personally, it seems to me his purely physics creativity." Let's answer in one word.
102
  Code:
103
- ```py
104
  final_answer("diminished")
105
- ```<end_code>
106
 
107
  ---
108
  Task: "Which city has the highest population: Guangzhou or Shanghai?"
109
 
110
  Thought: I need to get the populations for both cities and compare them: I will use the tool `search` to get the population of both cities.
111
  Code:
112
- ```py
113
  for city in ["Guangzhou", "Shanghai"]:
114
  print(f"Population {city}:", search(f"{city} population")
115
- ```<end_code>
116
  Observation:
117
  Population Guangzhou: ['Guangzhou has a population of 15 million inhabitants as of 2021.']
118
  Population Shanghai: '26 million (2019)'
119
 
120
  Thought: Now I know that Shanghai has the highest population.
121
  Code:
122
- ```py
123
  final_answer("Shanghai")
124
- ```<end_code>
125
 
126
  ---
127
  Task: "What is the current age of the pope, raised to the power 0.36?"
128
 
129
  Thought: I will use the tool `wiki` to get the age of the pope, and confirm that with a web search.
130
  Code:
131
- ```py
132
  pope_age_wiki = wiki(query="current pope age")
133
  print("Pope age as per wikipedia:", pope_age_wiki)
134
  pope_age_search = web_search(query="current pope age")
135
  print("Pope age as per google search:", pope_age_search)
136
- ```<end_code>
137
  Observation:
138
  Pope age: "The pope Francis is currently 88 years old."
139
 
140
  Thought: I know that the pope is 88 years old. Let's compute the result using python code.
141
  Code:
142
- ```py
143
  pope_current_age = 88 ** 0.36
144
  final_answer(pope_current_age)
145
- ```<end_code>
146
 
147
  Above example were using notional tools that might not exist for you. On top of performing computations in the Python code snippets that you create, you only have access to these tools:
148
  {%- for tool in tools.values() %}
@@ -163,7 +163,7 @@
163
  {%- endif %}
164
 
165
  Here are the rules you should always follow to solve your task:
166
- 1. Always provide a 'Thought:' sequence, and a 'Code:\n```py' sequence ending with '```<end_code>' sequence, else you will fail.
167
  2. Use only variables that you have defined!
168
  3. Always use the right arguments for the tools. DO NOT pass the arguments as a dict as in 'answer = wiki({'query': "What is the place where James Bond lives?"})', but use the arguments directly as in 'answer = wiki(query="What is the place where James Bond lives?")'.
169
  4. Take care to not chain too many sequential tool calls in the same code block, especially when the output format is unpredictable. For instance, a call to search has an unpredictable return format, so do not have another tool call that depends on its output in the same block: rather output results with print() to use them in the next block.
@@ -231,6 +231,11 @@
231
  {%- else %}
232
  {%- endif %}
233
 
 
 
 
 
 
234
  Now begin! Write your plan below.
235
  "update_facts_pre_messages": |-
236
  You are a world expert at gathering known and unknown facts based on a conversation.
 
7
  To solve the task, you must plan forward to proceed in a series of steps, in a cycle of 'Thought:', 'Code:', and 'Observation:' sequences.
8
 
9
  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.
10
+ Then in the 'Code:' sequence, you should write the code in simple Python. The code sequence must be surrounded with a '<code>...</code>' sequence.
11
  During each intermediate step, you can use 'print()' to save whatever important information you will then need.
12
  These print outputs will then appear in the 'Observation:' field, which will be available as input for the next step.
13
  In the end you have to return a final answer using the `final_answer` tool.
 
18
 
19
  Thought: I will proceed step by step and use the following tools: `document_qa` to find the oldest person in the document, then `image_generator` to generate an image according to the answer.
20
  Code:
21
+ <code>
22
  answer = document_qa(document=document, question="Who is the oldest person mentioned?")
23
  print(answer)
24
+ </code>
25
  Observation: "The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland."
26
 
27
  Thought: I will now generate an image showcasing the oldest person.
28
  Code:
29
+ <code>
30
  image = image_generator("A portrait of John Doe, a 55-year-old man living in Canada.")
31
  final_answer(image)
32
+ </code>
33
 
34
  ---
35
  Task: "What is the result of the following operation: 5 + 3 + 1294.678?"
36
 
37
  Thought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool
38
  Code:
39
+ <code>
40
  result = 5 + 3 + 1294.678
41
  final_answer(result)
42
+ </code>
43
 
44
  ---
45
  Task:
 
49
 
50
  Thought: I will use the following tools: `translator` to translate the question into English and then `image_qa` to answer the question on the input image.
51
  Code:
52
+ <code>
53
  translated_question = translator(question=question, src_lang="French", tgt_lang="English")
54
  print(f"The translated question is {translated_question}.")
55
  answer = image_qa(image=image, question=translated_question)
56
  final_answer(f"The answer is {answer}")
57
+ </code>
58
 
59
  ---
60
  Task:
 
63
 
64
  Thought: I need to find and read the 1979 interview of Stanislaus Ulam with Martin Sherwin.
65
  Code:
66
+ <code>
67
  pages = search(query="1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein")
68
  print(pages)
69
+ </code>
70
  Observation:
71
  No result found for query "1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein".
72
 
73
  Thought: The query was maybe too restrictive and did not find any results. Let's try again with a broader query.
74
  Code:
75
+ <code>
76
  pages = search(query="1979 interview Stanislaus Ulam")
77
  print(pages)
78
+ </code>
79
  Observation:
80
  Found 6 pages:
81
  [Stanislaus Ulam 1979 interview](https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/)
 
86
 
87
  Thought: I will read the first 2 pages to know more.
88
  Code:
89
+ <code>
90
  for url in ["https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/", "https://ahf.nuclearmuseum.org/manhattan-project/ulam-manhattan-project/"]:
91
  whole_page = visit_webpage(url)
92
  print(whole_page)
93
  print("\n" + "="*80 + "\n") # Print separator between pages
94
+ </code>
95
  Observation:
96
  Manhattan Project Locations:
97
  Los Alamos, NM
 
100
 
101
  Thought: I now have the final answer: from the webpages visited, Stanislaus Ulam says of Einstein: "He learned too much mathematics and sort of diminished, it seems to me personally, it seems to me his purely physics creativity." Let's answer in one word.
102
  Code:
103
+ <code>
104
  final_answer("diminished")
105
+ </code>
106
 
107
  ---
108
  Task: "Which city has the highest population: Guangzhou or Shanghai?"
109
 
110
  Thought: I need to get the populations for both cities and compare them: I will use the tool `search` to get the population of both cities.
111
  Code:
112
+ <code>
113
  for city in ["Guangzhou", "Shanghai"]:
114
  print(f"Population {city}:", search(f"{city} population")
115
+ </code>
116
  Observation:
117
  Population Guangzhou: ['Guangzhou has a population of 15 million inhabitants as of 2021.']
118
  Population Shanghai: '26 million (2019)'
119
 
120
  Thought: Now I know that Shanghai has the highest population.
121
  Code:
122
+ <code>
123
  final_answer("Shanghai")
124
+ </code>
125
 
126
  ---
127
  Task: "What is the current age of the pope, raised to the power 0.36?"
128
 
129
  Thought: I will use the tool `wiki` to get the age of the pope, and confirm that with a web search.
130
  Code:
131
+ <code>
132
  pope_age_wiki = wiki(query="current pope age")
133
  print("Pope age as per wikipedia:", pope_age_wiki)
134
  pope_age_search = web_search(query="current pope age")
135
  print("Pope age as per google search:", pope_age_search)
136
+ </code>
137
  Observation:
138
  Pope age: "The pope Francis is currently 88 years old."
139
 
140
  Thought: I know that the pope is 88 years old. Let's compute the result using python code.
141
  Code:
142
+ <code>
143
  pope_current_age = 88 ** 0.36
144
  final_answer(pope_current_age)
145
+ </code>
146
 
147
  Above example were using notional tools that might not exist for you. On top of performing computations in the Python code snippets that you create, you only have access to these tools:
148
  {%- for tool in tools.values() %}
 
163
  {%- endif %}
164
 
165
  Here are the rules you should always follow to solve your task:
166
+ 1. Always provide a 'Thought:' sequence, and a 'Code:\n<code>' sequence ending with '</code>' sequence, else you will fail.
167
  2. Use only variables that you have defined!
168
  3. Always use the right arguments for the tools. DO NOT pass the arguments as a dict as in 'answer = wiki({'query': "What is the place where James Bond lives?"})', but use the arguments directly as in 'answer = wiki(query="What is the place where James Bond lives?")'.
169
  4. Take care to not chain too many sequential tool calls in the same code block, especially when the output format is unpredictable. For instance, a call to search has an unpredictable return format, so do not have another tool call that depends on its output in the same block: rather output results with print() to use them in the next block.
 
231
  {%- else %}
232
  {%- endif %}
233
 
234
+ List of facts that you know:
235
+ ```
236
+ {{answer_facts}}
237
+ ```
238
+
239
  Now begin! Write your plan below.
240
  "update_facts_pre_messages": |-
241
  You are a world expert at gathering known and unknown facts based on a conversation.