Agent with Tools
Give a Together agent web search tools with WebSearchTools.
Code
import os
from agno.agent import Agent
from agno.models.together import Together
from agno.tools.websearch import WebSearchTools
agent = Agent(
model=Together(id=os.environ["TOGETHER_MODEL_ID"]),
tools=[WebSearchTools()],
markdown=True,
)
agent.print_response("Whats happening in France?")Set TOGETHER_MODEL_ID to a current model with function-calling support.
Usage
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateSet your API key
export TOGETHER_API_KEY=xxx
export TOGETHER_MODEL_ID=your-model-idInstall dependencies
uv pip install -U openai ddgs agnoRun Agent
Save the code above as tool_use.py, then run:
python tool_use.py