Responses Reasoning O3 Mini
Stream retrieved stock quotes from o3-mini with YFinance tools via the Responses API.
OpenAI schedules o3-mini and o4-mini for shutdown on October 23, 2026. The provider lifecycle notice lists their replacements. Check the selected replacement's reasoning and service-tier support before changing the source model ID.
This toolkit enables stock-price retrieval only. The source prompt asks for an investment report that would need additional data. Use the quote-focused prompt below to match the configured tools.
"""
Openai Reasoning O3 Mini
========================
Cookbook example for `openai/responses/reasoning_o3_mini.py`.
"""
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.yfinance import YFinanceTools
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=OpenAIResponses(id="o3-mini"),
tools=[YFinanceTools()],
markdown=True,
)
# Print the response in the terminal
agent.print_response("Write a report on the NVDA, is it a good buy?", stream=True)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
passRun the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openai yfinanceExport your OpenAI API key
export OPENAI_API_KEY="your_openai_api_key_here"Run the example
Save the code above as reasoning_o3_mini.py. Replace its agent.print_response(...) call with:
agent.print_response(
"Fetch the NVDA and TSLA stock quotes and show them in a table. "
"Report data limitations; these quotes alone do not establish investment merit.",
stream=True,
)Then run:
python reasoning_o3_mini.pyFull source: cookbook/90_models/openai/responses/reasoning_o3_mini.py