Copy
Ask AI
"""
Weather Agent
=============
Demonstrates weather agent.
"""
from textwrap import dedent
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.tools.openweather import OpenWeatherTools
# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------
weather_agent = Agent(
id="weather-reporter-agent",
name="Weather Reporter Agent",
description="An agent that provides up-to-date weather information for any city.",
model=OpenAIChat(id="gpt-5.2"),
tools=[
OpenWeatherTools(
units="standard" # Can be 'standard', 'metric', 'imperial'
)
],
instructions=dedent("""
You are a concise weather reporter.
Use the 'get_current_weather' tool to fetch current conditions.
Respond with the temperature and a brief summary.
"""),
markdown=True,
)
agent_os = AgentOS(
id="weather-agent-os",
description="An AgentOS serving specialized Agent for weather Reporting",
agents=[
weather_agent,
],
a2a_interface=True,
)
app = agent_os.get_app()
# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------
if __name__ == "__main__":
"""Run your AgentOS.
You can run the Agent via A2A protocol:
POST http://localhost:7770/agents/{id}/v1/message:send
For streaming responses:
POST http://localhost:7770/agents/{id}/v1/message:stream
Retrieve the agent card at:
GET http://localhost:7770/agents/{id}/.well-known/agent-card.json
"""
agent_os.serve(app="weather_agent:app", port=7770, reload=True)
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/05_agent_os/interfaces/a2a/multi_agent_a2a
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python weather_agent.py