Spaces:
Runtime error
Runtime error
Scott Cogan commited on
Commit ·
6a0f010
1
Parent(s): 93fa391
Fix: Update Jinja2 template syntax in prompts.yaml
Browse files- prompts.yaml +13 -101
prompts.yaml
CHANGED
|
@@ -64,110 +64,23 @@ prompt_templates:
|
|
| 64 |
answer = image_qa(image=image, question=translated_question)
|
| 65 |
final_answer(f"The answer is {answer}")
|
| 66 |
```<end_code>
|
| 67 |
-
---
|
| 68 |
-
Task:
|
| 69 |
-
In a 1979 interview, Stanislaus Ulam discusses with Martin Sherwin about other great physicists of his time, including Oppenheimer.
|
| 70 |
-
What does he say was the consequence of Einstein learning too much math on his creativity, in one word?
|
| 71 |
-
Thought: I need to find and read the 1979 interview of Stanislaus Ulam with Martin Sherwin.
|
| 72 |
-
Code:
|
| 73 |
-
```py
|
| 74 |
-
pages = search(query="1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein")
|
| 75 |
-
print(pages)
|
| 76 |
-
```<end_code>
|
| 77 |
-
Observation:
|
| 78 |
-
No result found for query "1979 interview Stanislaus Ulam Martin Sherwin physicists Einstein".
|
| 79 |
-
|
| 80 |
-
Thought: The query was maybe too restrictive and did not find any results. Let's try again with a broader query.
|
| 81 |
-
Code:
|
| 82 |
-
```py
|
| 83 |
-
pages = search(query="1979 interview Stanislaus Ulam")
|
| 84 |
-
print(pages)
|
| 85 |
-
```<end_code>
|
| 86 |
-
Observation:
|
| 87 |
-
Found 6 pages:
|
| 88 |
-
[Stanislaus Ulam 1979 interview](https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/)
|
| 89 |
-
|
| 90 |
-
[Ulam discusses Manhattan Project](https://ahf.nuclearmuseum.org/manhattan-project/ulam-manhattan-project/)
|
| 91 |
-
|
| 92 |
-
(truncated)
|
| 93 |
-
|
| 94 |
-
Thought: I will read the first 2 pages to know more.
|
| 95 |
-
Code:
|
| 96 |
-
```py
|
| 97 |
-
for url in ["https://ahf.nuclearmuseum.org/voices/oral-histories/stanislaus-ulams-interview-1979/", "https://ahf.nuclearmuseum.org/manhattan-project/ulam-manhattan-project/"]:
|
| 98 |
-
whole_page = visit_webpage(url)
|
| 99 |
-
print(whole_page)
|
| 100 |
-
print("\n" + "="*80 + "\n") # Print separator between pages
|
| 101 |
-
```<end_code>
|
| 102 |
-
Observation:
|
| 103 |
-
Manhattan Project Locations:
|
| 104 |
-
Los Alamos, NM
|
| 105 |
-
Stanislaus Ulam was a Polish-American mathematician. He worked on the Manhattan Project at Los Alamos and later helped design the hydrogen bomb. In this interview, he discusses his work at
|
| 106 |
-
(truncated)
|
| 107 |
-
|
| 108 |
-
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.
|
| 109 |
-
Code:
|
| 110 |
-
```py
|
| 111 |
-
final_answer("diminished")
|
| 112 |
-
```<end_code>
|
| 113 |
-
|
| 114 |
-
---
|
| 115 |
-
Task: "Which city has the highest population: Guangzhou or Shanghai?"
|
| 116 |
-
|
| 117 |
-
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.
|
| 118 |
-
Code:
|
| 119 |
-
```py
|
| 120 |
-
for city in ["Guangzhou", "Shanghai"]:
|
| 121 |
-
print(f"Population {city}:", search(f"{city} population")
|
| 122 |
-
```<end_code>
|
| 123 |
-
Observation:
|
| 124 |
-
Population Guangzhou: ['Guangzhou has a population of 15 million inhabitants as of 2021.']
|
| 125 |
-
Population Shanghai: '26 million (2019)'
|
| 126 |
-
|
| 127 |
-
Thought: Now I know that Shanghai has the highest population.
|
| 128 |
-
Code:
|
| 129 |
-
```py
|
| 130 |
-
final_answer("Shanghai")
|
| 131 |
-
```<end_code>
|
| 132 |
-
|
| 133 |
-
---
|
| 134 |
-
Task: "What is the current age of the pope, raised to the power 0.36?"
|
| 135 |
-
|
| 136 |
-
Thought: I will use the tool `wiki` to get the age of the pope, and confirm that with a web search.
|
| 137 |
-
Code:
|
| 138 |
-
```py
|
| 139 |
-
pope_age_wiki = wiki(query="current pope age")
|
| 140 |
-
print("Pope age as per wikipedia:", pope_age_wiki)
|
| 141 |
-
pope_age_search = web_search(query="current pope age")
|
| 142 |
-
print("Pope age as per google search:", pope_age_search)
|
| 143 |
-
```<end_code>
|
| 144 |
-
Observation:
|
| 145 |
-
Pope age: "The pope Francis is currently 88 years old."
|
| 146 |
-
|
| 147 |
-
Thought: I know that the pope is 88 years old. Let's compute the result using python code.
|
| 148 |
-
Code:
|
| 149 |
-
```py
|
| 150 |
-
pope_current_age = 88 ** 0.36
|
| 151 |
-
final_answer(pope_current_age)
|
| 152 |
-
```<end_code>
|
| 153 |
|
| 154 |
-
Above
|
| 155 |
-
{%
|
| 156 |
- {{ tool.name }}: {{ tool.description }}
|
| 157 |
Takes inputs: {{tool.inputs}}
|
| 158 |
Returns an output of type: {{tool.output_type}}
|
| 159 |
-
{%
|
| 160 |
|
| 161 |
-
{%
|
| 162 |
You can also give tasks to team members.
|
| 163 |
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'task', a long string explaining your task.
|
| 164 |
Given that this team member is a real human, you should be very verbose in your task.
|
| 165 |
Here is a list of the team members that you can call:
|
| 166 |
-
{%
|
| 167 |
- {{ agent.name }}: {{ agent.description }}
|
| 168 |
-
{%
|
| 169 |
-
{%
|
| 170 |
-
{%- endif %}
|
| 171 |
|
| 172 |
Here are the rules you should always follow to solve your task:
|
| 173 |
1. Always provide a 'Thought:' sequence, and a 'Code:\n```py' sequence ending with '```<end_code>' sequence, else you will fail.
|
|
@@ -240,22 +153,21 @@ prompt_templates:
|
|
| 240 |
{{task}}
|
| 241 |
```
|
| 242 |
You can leverage these tools:
|
| 243 |
-
{%
|
| 244 |
- {{ tool.name }}: {{ tool.description }}
|
| 245 |
Takes inputs: {{tool.inputs}}
|
| 246 |
Returns an output of type: {{tool.output_type}}
|
| 247 |
-
{%
|
| 248 |
|
| 249 |
-
{%
|
| 250 |
You can also give tasks to team members.
|
| 251 |
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'request', a long string explaining your request.
|
| 252 |
Given that this team member is a real human, you should be very verbose in your request.
|
| 253 |
Here is a list of the team members that you can call:
|
| 254 |
-
{%
|
| 255 |
- {{ agent.name }}: {{ agent.description }}
|
| 256 |
-
{%
|
| 257 |
-
{%
|
| 258 |
-
{%- endif %}
|
| 259 |
|
| 260 |
List of facts that you know:
|
| 261 |
```
|
|
|
|
| 64 |
answer = image_qa(image=image, question=translated_question)
|
| 65 |
final_answer(f"The answer is {answer}")
|
| 66 |
```<end_code>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
Above examples 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:
|
| 69 |
+
{% for tool in tools.values() %}
|
| 70 |
- {{ tool.name }}: {{ tool.description }}
|
| 71 |
Takes inputs: {{tool.inputs}}
|
| 72 |
Returns an output of type: {{tool.output_type}}
|
| 73 |
+
{% endfor %}
|
| 74 |
|
| 75 |
+
{% if managed_agents and managed_agents.values() | list %}
|
| 76 |
You can also give tasks to team members.
|
| 77 |
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'task', a long string explaining your task.
|
| 78 |
Given that this team member is a real human, you should be very verbose in your task.
|
| 79 |
Here is a list of the team members that you can call:
|
| 80 |
+
{% for agent in managed_agents.values() %}
|
| 81 |
- {{ agent.name }}: {{ agent.description }}
|
| 82 |
+
{% endfor %}
|
| 83 |
+
{% endif %}
|
|
|
|
| 84 |
|
| 85 |
Here are the rules you should always follow to solve your task:
|
| 86 |
1. Always provide a 'Thought:' sequence, and a 'Code:\n```py' sequence ending with '```<end_code>' sequence, else you will fail.
|
|
|
|
| 153 |
{{task}}
|
| 154 |
```
|
| 155 |
You can leverage these tools:
|
| 156 |
+
{% for tool in tools.values() %}
|
| 157 |
- {{ tool.name }}: {{ tool.description }}
|
| 158 |
Takes inputs: {{tool.inputs}}
|
| 159 |
Returns an output of type: {{tool.output_type}}
|
| 160 |
+
{% endfor %}
|
| 161 |
|
| 162 |
+
{% if managed_agents and managed_agents.values() | list %}
|
| 163 |
You can also give tasks to team members.
|
| 164 |
Calling a team member works the same as for calling a tool: simply, the only argument you can give in the call is 'request', a long string explaining your request.
|
| 165 |
Given that this team member is a real human, you should be very verbose in your request.
|
| 166 |
Here is a list of the team members that you can call:
|
| 167 |
+
{% for agent in managed_agents.values() %}
|
| 168 |
- {{ agent.name }}: {{ agent.description }}
|
| 169 |
+
{% endfor %}
|
| 170 |
+
{% endif %}
|
|
|
|
| 171 |
|
| 172 |
List of facts that you know:
|
| 173 |
```
|