This example shows how to use ReasoningTools with an Azure OpenAI model.

Code

cookbook/reasoning/tools/azure_openai_reasoning_tools.py
from agno.agent import Agent
from agno.models.azure.openai_chat import AzureOpenAI
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.reasoning import ReasoningTools

reasoning_agent = Agent(
    model=AzureOpenAI(id="gpt-5-mini"),
    tools=[
        DuckDuckGoTools(),
        ReasoningTools(
            think=True,
            analyze=True,
            add_instructions=True,
            add_few_shot=True,
        ),
    ],
    instructions="Use tables where possible. Think about the problem step by step.",
    markdown=True,
)

reasoning_agent.print_response(
    "Write a report comparing NVDA to TSLA.",
    stream=True,
    show_full_reasoning=True,
    stream_intermediate_steps=True,
)

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2

Set your API key

export OPENAI_API_KEY=xxx
export ANTHROPIC_API_KEY=xxx
3

Install libraries

pip install -U openai anthropic agno ddgs
4

Run Example

python cookbook/reasoning/tools/azure_openai_reasoning_tools.py