Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
pip install traceAI-smolagents smolagents
import os
os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
os.environ["FI_API_KEY"] = "your-futureagi-api-key"
os.environ["FI_SECRET_KEY"] = "your-futureagi-secret-key"
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
trace_provider = register(
project_type=ProjectType.OBSERVE,
project_name="smolagents",
)
from traceai_smolagents import SmolagentsInstrumentor
SmolagentsInstrumentor().instrument(tracer_provider=trace_provider)
from smolagents import (
CodeAgent,
DuckDuckGoSearchTool,
OpenAIServerModel,
ToolCallingAgent,
)
model = OpenAIServerModel(model_id="gpt-4o")
agent = ToolCallingAgent(
tools=[DuckDuckGoSearchTool()],
model=model,
max_steps=3,
name="search",
description=(
"This is an agent that can do web search. "
"When solving a task, ask him directly first, he gives good answers. "
"Then you can double check."
),
)
manager_agent = CodeAgent(
tools=[DuckDuckGoSearchTool()],
model=model,
managed_agents=[agent],
)
manager_agent.run(
"How many seconds would it take for a leopard at full speed to run through Pont des Arts? "
"ASK YOUR MANAGED AGENT FOR LEOPARD SPEED FIRST"
)
Was this page helpful?