Spaces:
Runtime error
Runtime error
Download smolagent_multiagent.py from franckberneron/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 870 Bytes
-
https://huggingface.co/spaces/franckberneron/First_agent_template/resolve/main/smolagent_multiagent.py
- Command line
-
hf download hf://spaces/franckberneron/First_agent_template/smolagent_multiagent.py
-
curl -L -o smolagent_multiagent.py https://huggingface.co/spaces/franckberneron/First_agent_template/resolve/main/smolagent_multiagent.py
870 Bytes
| from smolagents import CodeAgent, GoogleSearchTool, VisitWebPageTool, HfApiModel, ToolCallingAgent | |
| # Create web agent and manager agent structure | |
| model = HfApiModel( | |
| "Qwen/Qwen2.5-Coder-32B-Instruct", provider="together", max_tokens=8096 | |
| ) | |
| web_agent = ToolCallingAgent( | |
| tools=[GoogleSearchTool(), VisitWebPageTool()], # Add required tools | |
| model=model, # Add model | |
| max_steps=5, # Adjust steps | |
| name="web_agent", # Add name | |
| description="Runs web searches and visits web pages for you." # Add description | |
| ) | |
| manager_agent = CodeAgent( | |
| model=model, | |
| manager_agent=[web_agent], | |
| additional_authorized_imports=[ | |
| "geopandas", | |
| "plotly", | |
| "shapely", | |
| "json", | |
| "pandas", | |
| "numpy", | |
| ], | |
| planning_intervals = 5, | |
| verbosity_level = 2, | |
| max_steps= 10 | |
| ) | |