Implementation:Openai Openai python Response Reasoning Text Done
| Knowledge Sources | |
|---|---|
| Domains | API_Types, Responses_API |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
Concrete type for representing an event emitted when a reasoning text content part is fully completed during streaming, provided by the openai-python SDK.
Description
ResponseReasoningTextDoneEvent is a Pydantic model representing the response.reasoning_text.done streaming event. It is emitted when the model has finished generating a reasoning content part. The event includes the complete text of the reasoning content, content_index identifying the part, item_id, output_index, and sequence_number.
Usage
Import this type when you need to capture the finalized reasoning text after all deltas have been streamed for a particular content part.
Code Reference
Source Location
Signature
class ResponseReasoningTextDoneEvent(BaseModel):
"""Emitted when a reasoning text is completed."""
content_index: int
item_id: str
output_index: int
sequence_number: int
text: str
type: Literal["response.reasoning_text.done"]
Import
from openai.types.responses import ResponseReasoningTextDoneEvent
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| content_index | int | Yes | The index of the reasoning content part. |
| item_id | str | Yes | The ID of the item this reasoning text is associated with. |
| output_index | int | Yes | The index of the output item this reasoning text is associated with. |
| sequence_number | int | Yes | The sequence number of this event. |
| text | str | Yes | The full text of the completed reasoning content. |
| type | Literal["response.reasoning_text.done"] | Yes | The type of the event. Always response.reasoning_text.done.
|
Usage Examples
import openai
client = openai.OpenAI()
stream = client.responses.create(
model="o3-mini",
input="Prove that there are infinitely many prime numbers.",
stream=True,
)
for event in stream:
if event.type == "response.reasoning_text.done":
print(f"Reasoning part [{event.content_index}] complete: {event.text[:100]}...")