Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
@@ -92,7 +92,6 @@ You are attempting to complete the task
|
|
92 |
task: {task}
|
93 |
{history}"""
|
94 |
|
95 |
-
|
96 |
ACTION_PROMPT = """
|
97 |
You have access to the following tools:
|
98 |
- action: UPDATE-TASK action_input=NEW_TASK
|
@@ -110,6 +109,68 @@ Instructions
|
|
110 |
|
111 |
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
Always use the following format, one at a time:
|
114 |
task: the input task you must complete
|
115 |
thought: you should always think about what to do next
|
|
|
92 |
task: {task}
|
93 |
{history}"""
|
94 |
|
|
|
95 |
ACTION_PROMPT = """
|
96 |
You have access to the following tools:
|
97 |
- action: UPDATE-TASK action_input=NEW_TASK
|
|
|
109 |
|
110 |
|
111 |
|
112 |
+
Always use the following format:
|
113 |
+
task: the input task you must complete
|
114 |
+
thought: you should always think about what to do next
|
115 |
+
action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX
|
116 |
+
observation: the result of the action
|
117 |
+
thought: you can find more information on the internet, try using a search engine
|
118 |
+
action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
119 |
+
... (action/observation/thought can repeat N times)
|
120 |
+
... (!! Reply with only one response at a time, and wait for the user to return input !!)
|
121 |
+
|
122 |
+
Example Response 1:
|
123 |
+
User Request: "Can you please explain the concept of blockchain technology?"
|
124 |
+
action: SEARCH action_input=https://www.google.com/search?q=blockchain technology explained
|
125 |
+
observation: the result of the action
|
126 |
+
|
127 |
+
Blockchain Technology Explained: Blockchain acts essentially as a decentralized digital ledger that records transactions across many computers globally without being subject to alteration or deletion. It provides transparency, security, and resistance against fraud due to its reliance upon consensus algorithms, cryptography, and wide distribution among network participants. A practical application involves Bitcoin, but its potential spans far beyond digital currencies into fields like supply chain management, healthcare, banking services, smart contracts, and more. (Sources visited but not explicitly mentioned may include Investopedia and Blockgeeks.)
|
128 |
+
|
129 |
+
action: COMPLETE
|
130 |
+
|
131 |
+
|
132 |
+
Example Response 2:
|
133 |
+
User Request: "How does one solve quadratic equations algebraically?"
|
134 |
+
action: SEARCH action_input=https://www.wolframalpha.com/input?i=algebraic solution methods for quadratic equations
|
135 |
+
observation: the result of the action
|
136 |
+
|
137 |
+
To Algebraically Solve Quadratic Equations: To address quadratic equations having real coefficients - ax^2 + bx + c = 0, apply either factoring method, completing square technique, or quadratic formula. Factoring works great if equation roots can easily factorize; completion of squares might require rearranging terms and adding constants; whereas the quadratic formula directly solves x = [-b ± sqrt((b^2) - 4ac)] / 2a regardless of form complexity. In summary, three primary techniques facilitate resolving quadratic equations, allowing students, researchers, professionals, etc., to manipulate second-degree polynomial expressions effectively and confidently. (Referenced sites could encompass Khan Academy and Math Is Fun.)
|
138 |
+
|
139 |
+
action: COMPLETE
|
140 |
+
|
141 |
+
|
142 |
+
Example Response 3:
|
143 |
+
User Request: "I am curious about German cuisine. Can you suggest some traditional dishes?"
|
144 |
+
action: SEARCH action_input=https://duckduckgo.com/?q=German food traditions
|
145 |
+
observation: the result of the action
|
146 |
+
|
147 |
+
Traditional Dishes within German Cuisine: Some iconic German culinary delights range from savory sausages, hearty stews, crispy breads, to delectable desserts. Amongst them, Bratwurst stands out as a classic pork-based sausage best enjoyed grilled and served in fresh rolls. Another signature dish is Sauerbraten – marinated pot roast typically prepared from beef, though horse meat versions exist too. Not forgetting pretzels (Brezeln), widely popular snacks craved nationwide. Lastly, Black Forest Cake (Schwarzwälder Kirschtorte), composed of layers of chocolate sponge cake interspersed with whipped cream and cherries, remains a legendary choice amongst decadent treats. Sample further authentic recipes courtesy of Delicious and Epicurious.
|
148 |
+
|
149 |
+
action: COMPLETE
|
150 |
+
|
151 |
+
|
152 |
+
You are attempting to complete the task
|
153 |
+
task: {task}
|
154 |
+
{history}"""
|
155 |
+
|
156 |
+
|
157 |
+
ACTION_PROMPT_3 = """
|
158 |
+
You have access to the following tools:
|
159 |
+
- action: UPDATE-TASK action_input=NEW_TASK
|
160 |
+
- action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
161 |
+
- action: SEARCH action_input=https://URL_FOR_WEBPAGE
|
162 |
+
- action: COMPLETE
|
163 |
+
|
164 |
+
Instructions
|
165 |
+
- Choose a search engine to use
|
166 |
+
- You can submit a search query by replying with your command action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
167 |
+
- Results from action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY will be the text contents of the search result
|
168 |
+
- You can read the content of a website by repyling with your command action: SEARCH action_input=https://URL
|
169 |
+
- Results from a action: SEARCH action_input=https://URL will be the text contents of the webpage
|
170 |
+
- Return a detailed response and end by replaying with your command action: COMPLETE
|
171 |
+
|
172 |
+
|
173 |
+
|
174 |
Always use the following format, one at a time:
|
175 |
task: the input task you must complete
|
176 |
thought: you should always think about what to do next
|