Spaces:
Configuration error
Configuration error
Update agent2.py
Browse files
agent2.py
CHANGED
@@ -14,8 +14,7 @@ import helium
|
|
14 |
from PIL import Image
|
15 |
from io import BytesIO
|
16 |
from time import sleep
|
17 |
-
from smolagents import
|
18 |
-
|
19 |
|
20 |
class BM25RetrieverTool(Tool):
|
21 |
"""
|
@@ -227,9 +226,9 @@ Your final answer should be as few words as possible, a number, or a comma-separ
|
|
227 |
]
|
228 |
|
229 |
self.agent = CodeAgent(
|
230 |
-
tools=base_tools,
|
231 |
model=self.model,
|
232 |
-
add_base_tools=
|
233 |
planning_interval=2, # Plan every 2 steps
|
234 |
additional_authorized_imports=["helium", "requests", "BeautifulSoup", "json"],
|
235 |
step_callbacks=[save_screenshot_callback] if self.driver else [],
|
@@ -237,9 +236,6 @@ Your final answer should be as few words as possible, a number, or a comma-separ
|
|
237 |
description=self.system_prompt,
|
238 |
verbosity_level=2,
|
239 |
)
|
240 |
-
self.agent.tools = [tool for tool in self.agent.tools
|
241 |
-
if not isinstance(tool, DuckDuckGoSearchTool)]
|
242 |
-
print(self.agent.tools)
|
243 |
|
244 |
def initialize_browser(self):
|
245 |
"""Initialize browser for web automation tasks"""
|
|
|
14 |
from PIL import Image
|
15 |
from io import BytesIO
|
16 |
from time import sleep
|
17 |
+
from smolagents import PythonInterpreterTool, SpeechToTextTool
|
|
|
18 |
|
19 |
class BM25RetrieverTool(Tool):
|
20 |
"""
|
|
|
226 |
]
|
227 |
|
228 |
self.agent = CodeAgent(
|
229 |
+
tools=base_tools + [PythonInterpreterTool(), SpeechToTextTool()],
|
230 |
model=self.model,
|
231 |
+
add_base_tools=False, # Adds web search, python execution, etc.
|
232 |
planning_interval=2, # Plan every 2 steps
|
233 |
additional_authorized_imports=["helium", "requests", "BeautifulSoup", "json"],
|
234 |
step_callbacks=[save_screenshot_callback] if self.driver else [],
|
|
|
236 |
description=self.system_prompt,
|
237 |
verbosity_level=2,
|
238 |
)
|
|
|
|
|
|
|
239 |
|
240 |
def initialize_browser(self):
|
241 |
"""Initialize browser for web automation tasks"""
|