> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Treaty Of Versailles Analysis

> Compare gpt-4o with reasoning=True against a DeepSeek reasoner reasoning_model on a nuanced Treaty of Versailles analysis, streaming full reasoning.

Demonstrates built-in and DeepSeek-backed reasoning for historical analysis.

<Warning>
  DeepSeek will retire the source's `deepseek-reasoner` alias after July 24, 2026 at 15:59 UTC. Replace it with `deepseek-v4-flash` before running. See the [DeepSeek V4 migration notice](https://api-docs.deepseek.com/news/news260424/).
</Warning>

```python analyse_treaty_of_versailles.py theme={null}
"""
Treaty Of Versailles Analysis
============================

Demonstrates built-in and DeepSeek-backed reasoning for historical analysis.
"""

from agno.agent import Agent
from agno.models.deepseek import DeepSeek
from agno.models.openai import OpenAIChat

# ---------------------------------------------------------------------------
# Create Agents
# ---------------------------------------------------------------------------
task = (
    "Analyze the key factors that led to the signing of the Treaty of Versailles in 1919. "
    "Discuss the political, economic, and social impacts of the treaty on Germany and how it "
    "contributed to the onset of World War II. Provide a nuanced assessment that includes "
    "multiple historical perspectives."
)

cot_agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    reasoning=True,
    markdown=True,
)

deepseek_agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    reasoning_model=DeepSeek(id="deepseek-reasoner"),
    markdown=True,
)

# ---------------------------------------------------------------------------
# Run Agents
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    print("=== Built-in Chain Of Thought ===")
    cot_agent.print_response(task, stream=True, show_full_reasoning=True)

    print("\n=== DeepSeek Reasoning Model ===")
    deepseek_agent.print_response(task, stream=True, show_full_reasoning=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 API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export DEEPSEEK_API_KEY="your_deepseek_api_key_here"
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

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

  <Step title="Update the DeepSeek model">
    Replace `DeepSeek(id="deepseek-reasoner")` with `DeepSeek(id="deepseek-v4-flash")` in the saved file.
  </Step>

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

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

Full source: [cookbook/10\_reasoning/agents/analyse\_treaty\_of\_versailles.py](https://github.com/agno-agi/agno/blob/v2.7.4/cookbook/10_reasoning/agents/analyse_treaty_of_versailles.py)
