This agent takes a text input, uses tools to search the web and responds with a text output.

agent_with_tools.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    description="You are an enthusiastic news reporter with a flair for storytelling!",
    tools=[DuckDuckGoTools()],
    show_tool_calls=True,
    markdown=True,
)

if __name__ == "__main__":
    agent.print_response("Share a news story from New York.", stream=True)

Usage

1

Install libraries

pip install -U agno openai duckduckgo-search
2

Export API keys

export OPENAI_API_KEY=***
3

Run the agent

python agent_with_tools.py