Agent with Tools

Give a Fireworks agent web search with WebSearchTools.

Code

import asyncio

from agno.agent import Agent
from agno.models.fireworks import Fireworks
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=Fireworks(id="accounts/fireworks/models/gpt-oss-120b"),
    tools=[WebSearchTools()],
    markdown=True,
)

if __name__ == "__main__":
    # --- Sync + Streaming ---
    agent.print_response("What's happening in France?", stream=True)

    # --- Async + Streaming ---
    asyncio.run(agent.aprint_response("What's happening in France?", stream=True))

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Set your API key

export FIREWORKS_API_KEY=xxx

Install dependencies

uv pip install -U openai ddgs agno

Run Agent

Save the code above as tool_use.py, then run:

python tool_use.py