Documentation Index
Fetch the complete documentation index at: https://spacesail.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
This example demonstrates 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=.
Code
cookbook/reasoning/agents/default_chain_of_thought.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
reasoning_agent = Agent(
model=OpenAIChat(id="gpt-5-mini"),
reasoning_model=OpenAIChat(
id="gpt-5-mini", # 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=OpenAIChat(id="gpt-5-mini", 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,
)
Usage
Create a virtual environment
Open the Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
Set your API key
export OPENAI_API_KEY=xxx
Install libraries
pip install -U openai agno
Run Example
python cookbook/reasoning/agents/default_chain_of_thought.py