First_agent_template / smolagent_test.py
franckberneron
Ajoute les exercices de fin du module Smolagents
a9987d3
Raw History Blame Contribute Delete
481 Bytes
# Create a CodeAgent with DuckDuckGo search capability
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
web_search = DuckDuckGoSearchTool()
model = HfApiModel(
max_tokens=2096,
temperature=0.5,
model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
custom_role_conversions=None,
)
agent = CodeAgent(
tools=[web_search], # Add search tool here
model=model # Add model here
)