Spaces:
Configuration error
Configuration error
oremaz commited on
Commit ·
6e0b138
1
Parent(s): f93b1b7
Update agent2.py
Browse files13 unmodified lines1415161718192021205 unmodified lines2272282292302312322332342351 unmodified line23723823924024124224324424513 unmodified linesfrom PIL import Imagefrom io import BytesIOfrom time import sleepfrom smolagents import DuckDuckGoSearchToolclass BM25RetrieverTool(Tool):"""205 unmodified lines]self.agent = CodeAgent(tools=base_tools,model=self.model,add_base_tools=True, # Adds web search, python execution, etc.planning_interval=2, # Plan every 2 stepsadditional_authorized_imports=["helium", "requests", "BeautifulSoup", "json"],step_callbacks=[save_screenshot_callback] if self.driver else [],1 unmodified linedescription=self.system_prompt,verbosity_level=2,)self.agent.tools = [tool for tool in self.agent.toolsif not isinstance(tool, DuckDuckGoSearchTool)]print(self.agent.tools)def initialize_browser(self):"""Initialize browser for web automation tasks"""13 unmodified lines14151617181920205 unmodified lines2262272282292302312322332341 unmodified line23623723823924024113 unmodified linesfrom PIL import Imagefrom io import BytesIOfrom time import sleepfrom smolagents import PythonInterpreterTool, SpeechToTextToolclass BM25RetrieverTool(Tool):"""205 unmodified lines]self.agent = CodeAgent(tools=base_tools + [PythonInterpreterTool(), SpeechToTextTool()],model=self.model,add_base_tools=False, # Adds web search, python execution, etc.planning_interval=2, # Plan every 2 stepsadditional_authorized_imports=["helium", "requests", "BeautifulSoup", "json"],step_callbacks=[save_screenshot_callback] if self.driver else [],1 unmodified linedescription=self.system_prompt,verbosity_level=2,)def initialize_browser(self):"""Initialize browser for web automation tasks"""
agent2.py+3-7