Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -281,6 +281,9 @@ class BasicAgent:
|
|
| 281 |
If you are asked for a string, don't use articles, neither abbreviations (eg. for cities), and write the digits in plain text unless specified otherwise.
|
| 282 |
If you are asked for a comma separated list, apply the above rules depending of whether the element to put in the list is a number or a string.
|
| 283 |
|
|
|
|
|
|
|
|
|
|
| 284 |
If Task ID is included in the question, remember to call the relevant read tools [ie. read_file, excel_read, csv_read, mp3_listen, image_caption]
|
| 285 |
Note: python_tool is called when the question mentions the term "Python" or any math calculation.
|
| 286 |
|
|
@@ -289,6 +292,9 @@ class BasicAgent:
|
|
| 289 |
ACTION: [Specify the action/tool to use and any relevant input]
|
| 290 |
OBSERVATIOn: [Result of the action/tool, provided by the system]
|
| 291 |
FINAL ANSWER: [Provide your final response to the user]
|
|
|
|
|
|
|
|
|
|
| 292 |
"""
|
| 293 |
self.tools = [duckduck_websearch, serper_websearch, visit_webpage, wiki_search, text_splitter, youtube_transcript, read_file, excel_read, csv_read, mp3_listen, image_caption, run_python]
|
| 294 |
# self.model_with_tools = self.model.bind_tools(self.tools)
|
|
@@ -299,7 +305,7 @@ class BasicAgent:
|
|
| 299 |
# ("human", "{input}")
|
| 300 |
# ])
|
| 301 |
self.prompt = PromptTemplate(
|
| 302 |
-
input_variables=["input", "tool_names"],
|
| 303 |
template=self.sys_prompt
|
| 304 |
)
|
| 305 |
# self.agent = initialize_agent(
|
|
|
|
| 281 |
If you are asked for a string, don't use articles, neither abbreviations (eg. for cities), and write the digits in plain text unless specified otherwise.
|
| 282 |
If you are asked for a comma separated list, apply the above rules depending of whether the element to put in the list is a number or a string.
|
| 283 |
|
| 284 |
+
You have access to the following tools:
|
| 285 |
+
{tools}
|
| 286 |
+
Here are the tools you can use: {tool_names}
|
| 287 |
If Task ID is included in the question, remember to call the relevant read tools [ie. read_file, excel_read, csv_read, mp3_listen, image_caption]
|
| 288 |
Note: python_tool is called when the question mentions the term "Python" or any math calculation.
|
| 289 |
|
|
|
|
| 292 |
ACTION: [Specify the action/tool to use and any relevant input]
|
| 293 |
OBSERVATIOn: [Result of the action/tool, provided by the system]
|
| 294 |
FINAL ANSWER: [Provide your final response to the user]
|
| 295 |
+
|
| 296 |
+
User Input: {input}
|
| 297 |
+
{agent_scratchpad}
|
| 298 |
"""
|
| 299 |
self.tools = [duckduck_websearch, serper_websearch, visit_webpage, wiki_search, text_splitter, youtube_transcript, read_file, excel_read, csv_read, mp3_listen, image_caption, run_python]
|
| 300 |
# self.model_with_tools = self.model.bind_tools(self.tools)
|
|
|
|
| 305 |
# ("human", "{input}")
|
| 306 |
# ])
|
| 307 |
self.prompt = PromptTemplate(
|
| 308 |
+
input_variables=["input", "tools", "tool_names", "agent_scratchpad"],
|
| 309 |
template=self.sys_prompt
|
| 310 |
)
|
| 311 |
# self.agent = initialize_agent(
|