Skip to main content
Example showing how to use a non-reasoning model as a reasoning model. For reasoning, we recommend using a Reasoning Agent (with reasoning=True), or to use an appropriate reasoning model with reasoning_model.
1

Add the following code to your Python file

non-reasoning-model-cot.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

reasoning_agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    reasoning_model=OpenAIResponses(
        id="gpt-5.2", # This model will be used for reasoning, although it is not a native reasoning model.
        max_tokens=1200,
    ),
    markdown=True,
)
reasoning_agent.print_response(
    "Give me steps to write a python script for fibonacci series",
    stream=True,
    show_full_reasoning=True,
)

# It uses the default model of the Agent
reasoning_agent = Agent(
    model=OpenAIResponses(id="gpt-5.2", max_tokens=1200),
    reasoning=True,
    markdown=True,
)
reasoning_agent.print_response(
    "Give me steps to write a python script for fibonacci series",
    stream=True,
    show_full_reasoning=True,
)
2

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate
3

Install dependencies

uv pip install -U openai agno
4

Export your OpenAI API key

  export OPENAI_API_KEY="your_openai_api_key_here"
5

Run Agent

python non-reasoning-model-cot.py