Agent with Tools

Give a Nebius agent web search with WebSearchTools.

Code

import os

from agno.agent import Agent
from agno.models.nebius import Nebius
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=Nebius(id=os.environ["NEBIUS_MODEL_ID"]),
    tools=[WebSearchTools()],
    markdown=True,
)

agent.print_response("What's happening in France?", stream=True)

Select a text-generation model with function-calling support for this example.

Usage

Set up your virtual environment

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

Export environment variables

Select an available text-generation model ID from the Nebius model-list API.

export NEBIUS_API_KEY="your_nebius_api_key"
export NEBIUS_MODEL_ID="your_current_text_model_id"

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