File size: 870 Bytes
a9987d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
)