Spaces:
Runtime error
Runtime error
Update agent.py
Browse files
agent.py
CHANGED
@@ -28,7 +28,6 @@ Current Date/Time:
|
|
28 |
Purpose:
|
29 |
{purpose}
|
30 |
"""
|
31 |
-
|
32 |
ACTION_PROMPT = """
|
33 |
You have access to the following tools:
|
34 |
- action: UPDATE-TASK action_input=NEW_TASK
|
@@ -49,9 +48,6 @@ User Request: "Can you please explain the concept of blockchain technology?"
|
|
49 |
task: launch an internet search to find up-to-date information that can explain blockchain technology
|
50 |
thought: To launch an internet search, I need to reply with: action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
51 |
action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
52 |
-
observation: that action may not have returned the most up-to-date information
|
53 |
-
thought: I need to be certain that I am using my search tool correctly, I will run another internet search and update my information
|
54 |
-
action: SEARCH action_input="https://search.yahoo.com/search?p='blockchain technology explained'"
|
55 |
... (thought/action/observation/thought can repeat N times)
|
56 |
|
57 |
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.)
|
@@ -93,6 +89,76 @@ task: {task}
|
|
93 |
{history}"""
|
94 |
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
|
98 |
|
|
|
28 |
Purpose:
|
29 |
{purpose}
|
30 |
"""
|
|
|
31 |
ACTION_PROMPT = """
|
32 |
You have access to the following tools:
|
33 |
- action: UPDATE-TASK action_input=NEW_TASK
|
|
|
48 |
task: launch an internet search to find up-to-date information that can explain blockchain technology
|
49 |
thought: To launch an internet search, I need to reply with: action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
50 |
action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
|
|
|
|
|
|
51 |
... (thought/action/observation/thought can repeat N times)
|
52 |
|
53 |
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.)
|
|
|
89 |
{history}"""
|
90 |
|
91 |
|
92 |
+
ACTION_PROMPT_2 = """
|
93 |
+
You have access to the following tools:
|
94 |
+
- action: UPDATE-TASK action_input=NEW_TASK
|
95 |
+
- action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
96 |
+
- action: SEARCH action_input=https://URL_FOR_WEBPAGE
|
97 |
+
- action: COMPLETE
|
98 |
+
|
99 |
+
Instructions
|
100 |
+
- Choose a search engine to use
|
101 |
+
- You can submit a search query by replying with your command action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
102 |
+
- Results from action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY will be the text contents of the search result
|
103 |
+
- You can read the content of a website by repyling with your command action: SEARCH action_input=https://URL
|
104 |
+
- Results from a action: SEARCH action_input=https://URL will be the text contents of the webpage
|
105 |
+
- Return a detailed response and end by replaying with your command action: COMPLETE \n
|
106 |
+
|
107 |
+
Always use the following format:
|
108 |
+
task: the input task you must complete
|
109 |
+
thought: you should always think about what to do next, but use your SEARCH tool first
|
110 |
+
action: the action to take (should be one of [UPDATE-TASK, SEARCH, COMPLETE]) action_input=XXX
|
111 |
+
observation: the result of the action
|
112 |
+
thought: you can find more information on the internet, try using a search engine
|
113 |
+
action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
|
114 |
+
... (thought/action/observation/thought can repeat N times)
|
115 |
+
|
116 |
+
|
117 |
+
Example Response 1:
|
118 |
+
User Request: "Can you please explain the concept of blockchain technology?"
|
119 |
+
task: launch an internet search to find up-to-date information that can explain blockchain technology
|
120 |
+
thought: To launch an internet search, I need to reply with: action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
121 |
+
action: SEARCH action_input="https://www.google.com/search?q='blockchain technology explained'"
|
122 |
+
|
123 |
+
...(When pusrpose is complete):
|
124 |
+
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.)
|
125 |
+
|
126 |
+
action: COMPLETE
|
127 |
+
|
128 |
+
|
129 |
+
Example Response 2:
|
130 |
+
User Request: "How does one solve quadratic equations algebraically?"
|
131 |
+
task: launch an internet search to find up-to-date information about solving quadratic equations algebraically
|
132 |
+
thought: To launch an internet search, I need to reply with: action: SEARCH action_input="https://www.wolframalpha.com/input?i='algebraic solution methods for quadratic equations'"
|
133 |
+
action: SEARCH action_input="https://www.wolframalpha.com/input?i='algebraic solution methods for quadratic equations'"
|
134 |
+
...(waiting for response)
|
135 |
+
observation: the result of the action
|
136 |
+
thought: I need to search the contents https://www.example.com to find further information
|
137 |
+
action: SEARCH action_input='https://www.example.com'
|
138 |
+
|
139 |
+
...(When puspose is complete):
|
140 |
+
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.)
|
141 |
+
|
142 |
+
action: COMPLETE
|
143 |
+
|
144 |
+
|
145 |
+
Example Response 3:
|
146 |
+
User Request: "I am curious about German cuisine. Can you suggest some traditional dishes?"
|
147 |
+
task: launch an internet search to find up-to-date information about German cuisine
|
148 |
+
thought: To launch an internet search, I need to reply with: action: SEARCH action_input=https://duckduckgo.com/?q='German food traditions'"
|
149 |
+
action: SEARCH action_input=https://duckduckgo.com/?q='German food traditions'"
|
150 |
+
|
151 |
+
...(When puspose is complete):
|
152 |
+
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.
|
153 |
+
|
154 |
+
action: COMPLETE
|
155 |
+
|
156 |
+
|
157 |
+
You are attempting to complete the task
|
158 |
+
task: {task}
|
159 |
+
{history}"""
|
160 |
+
|
161 |
+
|
162 |
|
163 |
|
164 |
|