> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Weather Agent

> Serve a weather reporter agent with OpenWeatherTools over the A2A protocol.

```python weather_agent.py theme={null}
"""
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

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[a2a,os]" openai requests
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      export OPENWEATHER_API_KEY="your_openweather_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      $Env:OPENWEATHER_API_KEY="your_openweather_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `weather_agent.py`, then run:

    ```bash theme={null}
    python weather_agent.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/15\_a2a/multi\_agent/weather\_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/15_a2a/multi_agent/weather_agent.py)
