johann22 commited on
Commit
d616139
·
1 Parent(s): c95c77e

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +16 -16
agent.py CHANGED
@@ -28,7 +28,7 @@ Current Date/Time:
28
  Purpose:
29
  {purpose}
30
  """
31
- ACTION_PROMPT = """
32
  You have access to the following tools:
33
  - action: UPDATE-TASK action_input=NEW_TASK
34
  - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
@@ -46,8 +46,8 @@ Instructions
46
  Example Response 1:
47
  User Request: "Can you please explain the concept of blockchain technology?"
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.)
@@ -58,8 +58,8 @@ action: COMPLETE
58
  Example Response 2:
59
  User Request: "How does one solve quadratic equations algebraically?"
60
  task: launch an internet search to find up-to-date information about solving quadratic equations algebraically
61
- 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'"
62
- action: SEARCH action_input="https://www.wolframalpha.com/input?i='algebraic solution methods for quadratic equations'"
63
  observation: the result of the action
64
  thought: I need to search the contents https://www.example.com to find further information
65
  action: SEARCH action_input='https://www.example.com'
@@ -73,7 +73,7 @@ action: COMPLETE
73
  Example Response 3:
74
  User Request: "I am curious about German cuisine. Can you suggest some traditional dishes?"
75
  task: launch an internet search to find up-to-date information about German cuisine
76
- thought: To launch an internet search, I need to reply with: action: SEARCH action_input=https://duckduckgo.com/?q='German food traditions'"
77
  action: SEARCH action_input=https://duckduckgo.com/?q='German food traditions'"
78
  observation: the result of the action
79
  thought: I have found sufficient information so I will return it the user and complete my purpose
@@ -89,7 +89,7 @@ task: {task}
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
@@ -117,10 +117,10 @@ action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
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
@@ -129,12 +129,12 @@ action: COMPLETE
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.)
@@ -145,8 +145,8 @@ action: COMPLETE
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.
 
28
  Purpose:
29
  {purpose}
30
  """
31
+ ACTION_PROMPT_2 = """
32
  You have access to the following tools:
33
  - action: UPDATE-TASK action_input=NEW_TASK
34
  - action: SEARCH action_input=https://SEARCH_ENGINE_URL/search?q=QUERY
 
46
  Example Response 1:
47
  User Request: "Can you please explain the concept of blockchain technology?"
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.)
 
58
  Example Response 2:
59
  User Request: "How does one solve quadratic equations algebraically?"
60
  task: launch an internet search to find up-to-date information about solving quadratic equations algebraically
61
+ 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"
62
+ action: SEARCH action_input="https://www.wolframalpha.com/input?i=algebraic solution methods for quadratic equations"
63
  observation: the result of the action
64
  thought: I need to search the contents https://www.example.com to find further information
65
  action: SEARCH action_input='https://www.example.com'
 
73
  Example Response 3:
74
  User Request: "I am curious about German cuisine. Can you suggest some traditional dishes?"
75
  task: launch an internet search to find up-to-date information about German cuisine
76
+ thought: To launch an internet search, I need to reply with: action: SEARCH action_input="https://duckduckgo.com/?q='German food traditions"
77
  action: SEARCH action_input=https://duckduckgo.com/?q='German food traditions'"
78
  observation: the result of the action
79
  thought: I have found sufficient information so I will return it the user and complete my purpose
 
89
  {history}"""
90
 
91
 
92
+ ACTION_PROMPt = """
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
 
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 purpose 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
 
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 of the website 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.)
 
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.