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

# Expected Output

> Demonstrates setting a team-level `expected_output` to describe the desired run result shape.

```python expected_output.py theme={null}
"""
Expected Output
===============

Demonstrates setting a team-level `expected_output` to describe the desired
run result shape.
"""

from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.team import Team

# ---------------------------------------------------------------------------
# Create Members
# ---------------------------------------------------------------------------
incident_analyst = Agent(
    name="Incident Analyst",
    model=OpenAIResponses(id="gpt-5-mini"),
    instructions=[
        "Extract outcomes and risks clearly.",
        "Avoid unnecessary speculation.",
    ],
)


# ---------------------------------------------------------------------------
# Create Team
# ---------------------------------------------------------------------------
incident_team = Team(
    name="Incident Reporting Team",
    model=OpenAIResponses(id="gpt-5-mini"),
    members=[incident_analyst],
    expected_output=(
        "Three sections: Summary, Impact, and Next Step. "
        "Keep each section to one sentence."
    ),
    instructions=[
        "Summarize incidents in a clear operational style.",
        "Prefer plain language over technical jargon.",
    ],
)


# ---------------------------------------------------------------------------
# Run Team
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    incident_team.print_response(
        (
            "A deployment changed the auth callback behavior, login requests increased by 12%, "
            "and a rollback script is already prepared."
        ),
        stream=True,
    )
```

## Run the Example

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

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

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

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

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

Full source: [cookbook/03\_teams/04\_structured\_input\_output/expected\_output.py](https://github.com/agno-agi/agno/blob/main/cookbook/03_teams/04_structured_input_output/expected_output.py)
