Implementation:Openai Openai python Response Reasoning Text Delta
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for representing a streaming delta event emitted when text is incrementally added to reasoning content, provided by the openai-python SDK.
Description
ResponseReasoningTextDeltaEvent is a Pydantic model representing the response.reasoning_text.delta streaming event. It is emitted each time a new text fragment (delta) is appended to the reasoning content (as opposed to the summary). The event includes content_index identifying which content part is being extended, item_id, output_index, and sequence_number.
Usage
Import this type when you need to process the raw reasoning text as it streams in from reasoning models such as o1 or o3.
Code Reference
Source Location
Signature
class ResponseReasoningTextDeltaEvent(BaseModel):
"""Emitted when a delta is added to a reasoning text."""
content_index: int
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.reasoning_text.delta"]
Import
from openai.types.responses import ResponseReasoningTextDeltaEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| content_index | int | Yes | The index of the reasoning content part this delta is associated with. |
| delta | str | Yes | The text delta that was added to the reasoning content. |
| item_id | str | Yes | The ID of the item this reasoning text delta is associated with. |
| output_index | int | Yes | The index of the output item this reasoning text delta is associated with. |
| sequence_number | int | Yes | The sequence number of this event. |
| type | Literal["response.reasoning_text.delta"] | Yes | The type of the event. Always response.reasoning_text.delta.
|
Usage Examples
import openai
client = openai.OpenAI()
stream = client.responses.create(
model="o3-mini",
input="Solve: What is 127 * 389?",
stream=True,
)
reasoning_text = ""
for event in stream:
if event.type == "response.reasoning_text.delta":
reasoning_text += event.delta
print(event.delta, end="", flush=True)