Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Openai Openai python Shared Params Reasoning

From Leeroopedia
Revision as of 13:41, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Openai_Openai_python_Shared_Params_Reasoning.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains API_Types, Python
Last Updated 2026-02-15 00:00 GMT

Overview

Concrete tool for configuring reasoning behavior on gpt-5 and o-series models in the openai-python SDK.

Description

Reasoning is a TypedDict that provides configuration options for reasoning models. It supports three optional fields: effort (controls reasoning depth with values none, minimal, low, medium, high, or xhigh), generate_summary (deprecated in favor of summary), and summary (controls reasoning summary output with values auto, concise, or detailed). Different models have different default effort levels and supported values. For example, gpt-5.1 defaults to "none" reasoning effort, while models before it default to "medium". The gpt-5-pro model defaults to and only supports "high".

Usage

Import this type when you need to configure reasoning parameters for chat completions or Responses API calls using reasoning-capable models (gpt-5 family, o-series).

Code Reference

Source Location

Signature

class Reasoning(TypedDict, total=False):
    """gpt-5 and o-series models only.
    Configuration options for reasoning models."""

    effort: Optional[ReasoningEffort]
    generate_summary: Optional[Literal["auto", "concise", "detailed"]]
    summary: Optional[Literal["auto", "concise", "detailed"]]

Import

from openai.types.shared_params import Reasoning

I/O Contract

Fields

Name Type Required Description
effort Optional[ReasoningEffort] No Constrains reasoning effort. Values: none, minimal, low, medium, high, xhigh. Defaults vary by model.
generate_summary Optional[Literal["auto", "concise", "detailed"]] No Deprecated: use summary instead. Controls reasoning summary output.
summary Optional[Literal["auto", "concise", "detailed"]] No Controls the reasoning summary. Useful for debugging and understanding the model's reasoning process.

Model-Specific Defaults

Model Default Effort Supported Values
gpt-5.1 none none, low, medium, high
Models before gpt-5.1 medium minimal, low, medium, high (no none)
gpt-5-pro high high only
gpt-5.1-codex-max and later medium supports xhigh

Usage Examples

from openai import OpenAI
from openai.types.shared_params import Reasoning

client = OpenAI()

reasoning: Reasoning = {
    "effort": "high",
    "summary": "concise",
}

response = client.chat.completions.create(
    model="o3",
    messages=[{"role": "user", "content": "Prove the Pythagorean theorem."}],
    reasoning=reasoning,
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment