First_agent_template / smolagent_multiagent.py
franckberneron
Ajoute les exercices de fin du module Smolagents
a9987d3
Raw History Blame Contribute Delete
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
)