Google Colab
colab.research.google.com
Install
Setup
Add yourHF_TOKEN as an environment variable:
register function:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How to use the SmolagentsInstrumentor to trace smolagents by Hugging Face
pip install openinference-instrumentation-smolagents smolagents
HF_TOKEN as an environment variable:
os.environ["HF_TOKEN"] = "<your_hf_token_value>"
register function:
from smolagents import (
CodeAgent,
InferenceClientModel,
ToolCallingAgent,
VisitWebpageTool,
WebSearchTool,
)
model = InferenceClientModel()
managed_agent = ToolCallingAgent(
tools=[WebSearchTool(), VisitWebpageTool()],
model=model,
name="managed_agent",
description="This is an agent that can do web search.",
)
managed_agent.run("Based on the latest news, what is happening in extraterrestrial life?")
Was this page helpful?
