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 Response Reasoning Item Param

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

Overview

Concrete TypedDict for constructing reasoning chain-of-thought items when sending input back to the Responses API, provided by the openai-python SDK.

Description

ResponseReasoningItemParam is a TypedDict used to serialize a reasoning item for inclusion in API request input. It mirrors ResponseReasoningItem but uses TypedDict/Required semantics. The required fields are id, summary (an iterable of Summary TypedDicts), and type (always "reasoning"). Optional fields include content (an iterable of Content TypedDicts), encrypted_content (a string), and status (one of "in_progress", "completed", or "incomplete").

Usage

Import this type when you need to pass reasoning items from a previous response back into the next API call for multi-turn conversations that preserve chain-of-thought context.

Code Reference

Source Location

Signature

class ResponseReasoningItemParam(TypedDict, total=False):
    """A description of the chain of thought used by a reasoning model."""

    id: Required[str]
    summary: Required[Iterable[Summary]]
    type: Required[Literal["reasoning"]]
    content: Iterable[Content]
    encrypted_content: Optional[str]
    status: Literal["in_progress", "completed", "incomplete"]

Import

from openai.types.responses import ResponseReasoningItemParam

I/O Contract

Fields

Name Type Required Description
id str Yes The unique identifier of the reasoning content.
summary Iterable[Summary] Yes Reasoning summary content. Each Summary requires text (str) and type (Literal["summary_text"]).
type Literal["reasoning"] Yes The type of the object. Always reasoning.
content Iterable[Content] No Reasoning text content. Each Content requires text (str) and type (Literal["reasoning_text"]).
encrypted_content Optional[str] No Encrypted content of the reasoning item, populated when requested via the include parameter.
status Literal["in_progress", "completed", "incomplete"] No The status of the item.

Usage Examples

from openai.types.responses import ResponseReasoningItemParam

reasoning_param: ResponseReasoningItemParam = {
    "id": "reasoning_abc123",
    "type": "reasoning",
    "summary": [
        {"text": "The sky appears blue due to Rayleigh scattering.", "type": "summary_text"}
    ],
    "status": "completed",
}

# Pass as part of input to preserve reasoning context
# client.responses.create(model="o3-mini", input=[reasoning_param, ...])

Related Pages

Page Connections

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