Responses Verbosity Control

Set desired response detail through OpenAI Responses while comparing retrieved stock quotes.

The preserved source uses OpenAIChat. Apply the Responses adapter and prompt changes in the run step. verbosity requests a level of detail; it is not a hard response-length bound. YFinanceTools() enables stock-price retrieval, so the adapted prompt asks for quotes rather than an investment report.

verbosity_control.py
"""
Openai Verbosity Control
========================

Cookbook example for `openai/responses/verbosity_control.py`.
"""

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=OpenAIChat(id="gpt-5", verbosity="high"),
    tools=[YFinanceTools()],
    instructions="Use tables to display data.",
    markdown=True,
)
agent.print_response("Write a report comparing NVDA to TSLA", stream=True)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass

Run the Example

Set up your virtual environment

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

Install dependencies

uv pip install -U agno openai yfinance

Export your OpenAI API key

export OPENAI_API_KEY="your_openai_api_key_here"

Run the example

Save the code above as verbosity_control.py. Replace the model import and constructor:

from agno.models.openai import OpenAIResponses
model=OpenAIResponses(id="gpt-5.6-luna", verbosity="high"),

Replace the final call with:

agent.print_response(
    "Fetch the NVDA and TSLA stock quotes and compare them in a table. "
    "State the data limitations; quotes alone do not establish investment merit.",
    stream=True,
)

Then run:

python verbosity_control.py

Full source: cookbook/90_models/openai/responses/verbosity_control.py