feat(responses)!: add reasoning and annotation added events (#3793)

Implements missing streaming events from OpenAI Responses API spec: 
 - reasoning text/summary events for o1/o3 models, 
 - refusal events for safety moderation
 - annotation events for citations, 
 - and file search streaming events. 
 
Added optional reasoning_content field to chat completion chunks to
support non-standard provider extensions.

**NOTE:** OpenAI does _not_ fill reasoning_content when users use the
chat_completion APIs. This means there is no way for us to implement
Responses (with reasoning) by using OpenAI chat completions! We'd need
to transparently punt to OpenAI's responses endpoints if we wish to do
that. For others though (vLLM, etc.) we can use it.

## Test Plan

File search streaming test passes:
```
./scripts/integration-tests.sh --stack-config server:ci-tests \
   --suite responses --setup gpt --inference-mode replay --pattern test_response_file_search_streaming_events
```

Need more complex setup and validation for reasoning tests (need a vLLM
powered OSS model maybe gpt-oss which can return reasoning_content). I
will do that in a followup PR.
This commit is contained in:
Ashwin Bharambe 2025-10-11 16:47:14 -07:00 committed by GitHub
parent f365961731
commit 7c63aebd64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 23530 additions and 2 deletions

View file

@ -7881,6 +7881,10 @@
"$ref": "#/components/schemas/OpenAIChatCompletionToolCall" "$ref": "#/components/schemas/OpenAIChatCompletionToolCall"
}, },
"description": "(Optional) The tool calls of the delta" "description": "(Optional) The tool calls of the delta"
},
"reasoning_content": {
"type": "string",
"description": "(Optional) The reasoning content from the model (non-standard, for o1/o3 models)"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
@ -10262,6 +10266,28 @@
"title": "OpenAIResponseContentPartOutputText", "title": "OpenAIResponseContentPartOutputText",
"description": "Text content within a streamed response part." "description": "Text content within a streamed response part."
}, },
"OpenAIResponseContentPartReasoningSummary": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "summary_text",
"default": "summary_text",
"description": "Content part type identifier, always \"summary_text\""
},
"text": {
"type": "string",
"description": "Summary text"
}
},
"additionalProperties": false,
"required": [
"type",
"text"
],
"title": "OpenAIResponseContentPartReasoningSummary",
"description": "Reasoning summary part in a streamed response."
},
"OpenAIResponseContentPartReasoningText": { "OpenAIResponseContentPartReasoningText": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -10371,6 +10397,42 @@
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone"
}, },
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted"
},
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete"
}, },
@ -10405,6 +10467,18 @@
"response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted", "response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted",
"response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded", "response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded",
"response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone", "response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone",
"response.reasoning_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta",
"response.reasoning_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone",
"response.reasoning_summary_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"response.reasoning_summary_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"response.reasoning_summary_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"response.reasoning_summary_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"response.refusal.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta",
"response.refusal.done": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone",
"response.output_text.annotation.added": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"response.file_search_call.in_progress": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"response.file_search_call.searching": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"response.file_search_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete", "response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete",
"response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed", "response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed",
"response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted" "response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted"
@ -10612,6 +10686,102 @@
"title": "OpenAIResponseObjectStreamResponseFailed", "title": "OpenAIResponseObjectStreamResponseFailed",
"description": "Streaming event emitted when a response fails." "description": "Streaming event emitted when a response fails."
}, },
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the completed file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.completed",
"default": "response.file_search_call.completed",
"description": "Event type identifier, always \"response.file_search_call.completed\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"description": "Streaming event for completed file search calls."
},
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.in_progress",
"default": "response.file_search_call.in_progress",
"description": "Event type identifier, always \"response.file_search_call.in_progress\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"description": "Streaming event for file search calls in progress."
},
"OpenAIResponseObjectStreamResponseFileSearchCallSearching": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.searching",
"default": "response.file_search_call.searching",
"description": "Event type identifier, always \"response.file_search_call.searching\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"description": "Streaming event for file search currently searching."
},
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -11077,6 +11247,75 @@
"title": "OpenAIResponseObjectStreamResponseOutputItemDone", "title": "OpenAIResponseObjectStreamResponseOutputItemDone",
"description": "Streaming event for when an output item is completed." "description": "Streaming event for when an output item is completed."
}, },
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the item to which the annotation is being added"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item in the response's output array"
},
"content_index": {
"type": "integer",
"description": "Index position of the content part within the output item"
},
"annotation_index": {
"type": "integer",
"description": "Index of the annotation within the content part"
},
"annotation": {
"oneOf": [
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation",
"url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation",
"container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation",
"file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
},
"description": "The annotation object being added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.output_text.annotation.added",
"default": "response.output_text.annotation.added",
"description": "Event type identifier, always \"response.output_text.annotation.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"content_index",
"annotation_index",
"annotation",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"description": "Streaming event for when an annotation is added to output text."
},
"OpenAIResponseObjectStreamResponseOutputTextDelta": { "OpenAIResponseObjectStreamResponseOutputTextDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -11161,6 +11400,342 @@
"title": "OpenAIResponseObjectStreamResponseOutputTextDone", "title": "OpenAIResponseObjectStreamResponseOutputTextDone",
"description": "Streaming event for when text output is completed." "description": "Streaming event for when text output is completed."
}, },
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The summary part that was added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.added",
"default": "response.reasoning_summary_part.added",
"description": "Event type identifier, always \"response.reasoning_summary_part.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"description": "Streaming event for when a new reasoning summary part is added."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The completed summary part"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.done",
"default": "response.reasoning_summary_part.done",
"description": "Event type identifier, always \"response.reasoning_summary_part.done\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"description": "Streaming event for when a reasoning summary part is completed."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": {
"type": "object",
"properties": {
"delta": {
"type": "string",
"description": "Incremental summary text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.delta",
"default": "response.reasoning_summary_text.delta",
"description": "Event type identifier, always \"response.reasoning_summary_text.delta\""
}
},
"additionalProperties": false,
"required": [
"delta",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"description": "Streaming event for incremental reasoning summary text updates."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Final complete summary text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.done",
"default": "response.reasoning_summary_text.done",
"description": "Event type identifier, always \"response.reasoning_summary_text.done\""
}
},
"additionalProperties": false,
"required": [
"text",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"description": "Streaming event for when reasoning summary text is completed."
},
"OpenAIResponseObjectStreamResponseReasoningTextDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"delta": {
"type": "string",
"description": "Incremental reasoning text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item being updated"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.delta",
"default": "response.reasoning_text.delta",
"description": "Event type identifier, always \"response.reasoning_text.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDelta",
"description": "Streaming event for incremental reasoning text updates."
},
"OpenAIResponseObjectStreamResponseReasoningTextDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"text": {
"type": "string",
"description": "Final complete reasoning text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the completed output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.done",
"default": "response.reasoning_text.done",
"description": "Event type identifier, always \"response.reasoning_text.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"text",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDone",
"description": "Streaming event for when reasoning text is completed."
},
"OpenAIResponseObjectStreamResponseRefusalDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"delta": {
"type": "string",
"description": "Incremental refusal text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.delta",
"default": "response.refusal.delta",
"description": "Event type identifier, always \"response.refusal.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDelta",
"description": "Streaming event for incremental refusal text updates."
},
"OpenAIResponseObjectStreamResponseRefusalDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"refusal": {
"type": "string",
"description": "Final complete refusal text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.done",
"default": "response.refusal.done",
"description": "Event type identifier, always \"response.refusal.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"refusal",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDone",
"description": "Streaming event for when refusal text is completed."
},
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -5815,6 +5815,11 @@ components:
items: items:
$ref: '#/components/schemas/OpenAIChatCompletionToolCall' $ref: '#/components/schemas/OpenAIChatCompletionToolCall'
description: (Optional) The tool calls of the delta description: (Optional) The tool calls of the delta
reasoning_content:
type: string
description: >-
(Optional) The reasoning content from the model (non-standard, for o1/o3
models)
additionalProperties: false additionalProperties: false
title: OpenAIChoiceDelta title: OpenAIChoiceDelta
description: >- description: >-
@ -7642,6 +7647,26 @@ components:
title: OpenAIResponseContentPartOutputText title: OpenAIResponseContentPartOutputText
description: >- description: >-
Text content within a streamed response part. Text content within a streamed response part.
"OpenAIResponseContentPartReasoningSummary":
type: object
properties:
type:
type: string
const: summary_text
default: summary_text
description: >-
Content part type identifier, always "summary_text"
text:
type: string
description: Summary text
additionalProperties: false
required:
- type
- text
title: >-
OpenAIResponseContentPartReasoningSummary
description: >-
Reasoning summary part in a streamed response.
OpenAIResponseContentPartReasoningText: OpenAIResponseContentPartReasoningText:
type: object type: object
properties: properties:
@ -7703,6 +7728,18 @@ components:
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -7730,6 +7767,18 @@ components:
response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -7905,6 +7954,99 @@ components:
title: OpenAIResponseObjectStreamResponseFailed title: OpenAIResponseObjectStreamResponseFailed
description: >- description: >-
Streaming event emitted when a response fails. Streaming event emitted when a response fails.
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the completed file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.completed
default: response.file_search_call.completed
description: >-
Event type identifier, always "response.file_search_call.completed"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallCompleted
description: >-
Streaming event for completed file search calls.
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.in_progress
default: response.file_search_call.in_progress
description: >-
Event type identifier, always "response.file_search_call.in_progress"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallInProgress
description: >-
Streaming event for file search calls in progress.
"OpenAIResponseObjectStreamResponseFileSearchCallSearching":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.searching
default: response.file_search_call.searching
description: >-
Event type identifier, always "response.file_search_call.searching"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallSearching
description: >-
Streaming event for file search currently searching.
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta":
type: object type: object
properties: properties:
@ -8297,6 +8439,62 @@ components:
OpenAIResponseObjectStreamResponseOutputItemDone OpenAIResponseObjectStreamResponseOutputItemDone
description: >- description: >-
Streaming event for when an output item is completed. Streaming event for when an output item is completed.
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the item to which the annotation is being added
output_index:
type: integer
description: >-
Index position of the output item in the response's output array
content_index:
type: integer
description: >-
Index position of the content part within the output item
annotation_index:
type: integer
description: >-
Index of the annotation within the content part
annotation:
oneOf:
- $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath'
discriminator:
propertyName: type
mapping:
file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation'
container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath'
description: The annotation object being added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.output_text.annotation.added
default: response.output_text.annotation.added
description: >-
Event type identifier, always "response.output_text.annotation.added"
additionalProperties: false
required:
- item_id
- output_index
- content_index
- annotation_index
- annotation
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded
description: >-
Streaming event for when an annotation is added to output text.
"OpenAIResponseObjectStreamResponseOutputTextDelta": "OpenAIResponseObjectStreamResponseOutputTextDelta":
type: object type: object
properties: properties:
@ -8376,6 +8574,314 @@ components:
OpenAIResponseObjectStreamResponseOutputTextDone OpenAIResponseObjectStreamResponseOutputTextDone
description: >- description: >-
Streaming event for when text output is completed. Streaming event for when text output is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The summary part that was added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.added
default: response.reasoning_summary_part.added
description: >-
Event type identifier, always "response.reasoning_summary_part.added"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded
description: >-
Streaming event for when a new reasoning summary part is added.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The completed summary part
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.done
default: response.reasoning_summary_part.done
description: >-
Event type identifier, always "response.reasoning_summary_part.done"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartDone
description: >-
Streaming event for when a reasoning summary part is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta":
type: object
properties:
delta:
type: string
description: Incremental summary text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.delta
default: response.reasoning_summary_text.delta
description: >-
Event type identifier, always "response.reasoning_summary_text.delta"
additionalProperties: false
required:
- delta
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta
description: >-
Streaming event for incremental reasoning summary text updates.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone":
type: object
properties:
text:
type: string
description: Final complete summary text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.done
default: response.reasoning_summary_text.done
description: >-
Event type identifier, always "response.reasoning_summary_text.done"
additionalProperties: false
required:
- text
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDone
description: >-
Streaming event for when reasoning summary text is completed.
"OpenAIResponseObjectStreamResponseReasoningTextDelta":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
delta:
type: string
description: Incremental reasoning text being added
item_id:
type: string
description: >-
Unique identifier of the output item being updated
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.delta
default: response.reasoning_text.delta
description: >-
Event type identifier, always "response.reasoning_text.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDelta
description: >-
Streaming event for incremental reasoning text updates.
"OpenAIResponseObjectStreamResponseReasoningTextDone":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
text:
type: string
description: Final complete reasoning text
item_id:
type: string
description: >-
Unique identifier of the completed output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.done
default: response.reasoning_text.done
description: >-
Event type identifier, always "response.reasoning_text.done"
additionalProperties: false
required:
- content_index
- text
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDone
description: >-
Streaming event for when reasoning text is completed.
"OpenAIResponseObjectStreamResponseRefusalDelta":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
delta:
type: string
description: Incremental refusal text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.delta
default: response.refusal.delta
description: >-
Event type identifier, always "response.refusal.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDelta
description: >-
Streaming event for incremental refusal text updates.
"OpenAIResponseObjectStreamResponseRefusalDone":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
refusal:
type: string
description: Final complete refusal text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.done
default: response.refusal.done
description: >-
Event type identifier, always "response.refusal.done"
additionalProperties: false
required:
- content_index
- refusal
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDone
description: >-
Streaming event for when refusal text is completed.
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted":
type: object type: object
properties: properties:

View file

@ -5218,6 +5218,10 @@
"$ref": "#/components/schemas/OpenAIChatCompletionToolCall" "$ref": "#/components/schemas/OpenAIChatCompletionToolCall"
}, },
"description": "(Optional) The tool calls of the delta" "description": "(Optional) The tool calls of the delta"
},
"reasoning_content": {
"type": "string",
"description": "(Optional) The reasoning content from the model (non-standard, for o1/o3 models)"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
@ -8198,6 +8202,28 @@
"title": "OpenAIResponseContentPartOutputText", "title": "OpenAIResponseContentPartOutputText",
"description": "Text content within a streamed response part." "description": "Text content within a streamed response part."
}, },
"OpenAIResponseContentPartReasoningSummary": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "summary_text",
"default": "summary_text",
"description": "Content part type identifier, always \"summary_text\""
},
"text": {
"type": "string",
"description": "Summary text"
}
},
"additionalProperties": false,
"required": [
"type",
"text"
],
"title": "OpenAIResponseContentPartReasoningSummary",
"description": "Reasoning summary part in a streamed response."
},
"OpenAIResponseContentPartReasoningText": { "OpenAIResponseContentPartReasoningText": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -8307,6 +8333,42 @@
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone"
}, },
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted"
},
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete"
}, },
@ -8341,6 +8403,18 @@
"response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted", "response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted",
"response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded", "response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded",
"response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone", "response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone",
"response.reasoning_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta",
"response.reasoning_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone",
"response.reasoning_summary_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"response.reasoning_summary_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"response.reasoning_summary_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"response.reasoning_summary_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"response.refusal.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta",
"response.refusal.done": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone",
"response.output_text.annotation.added": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"response.file_search_call.in_progress": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"response.file_search_call.searching": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"response.file_search_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete", "response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete",
"response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed", "response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed",
"response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted" "response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted"
@ -8548,6 +8622,102 @@
"title": "OpenAIResponseObjectStreamResponseFailed", "title": "OpenAIResponseObjectStreamResponseFailed",
"description": "Streaming event emitted when a response fails." "description": "Streaming event emitted when a response fails."
}, },
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the completed file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.completed",
"default": "response.file_search_call.completed",
"description": "Event type identifier, always \"response.file_search_call.completed\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"description": "Streaming event for completed file search calls."
},
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.in_progress",
"default": "response.file_search_call.in_progress",
"description": "Event type identifier, always \"response.file_search_call.in_progress\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"description": "Streaming event for file search calls in progress."
},
"OpenAIResponseObjectStreamResponseFileSearchCallSearching": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.searching",
"default": "response.file_search_call.searching",
"description": "Event type identifier, always \"response.file_search_call.searching\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"description": "Streaming event for file search currently searching."
},
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -9013,6 +9183,75 @@
"title": "OpenAIResponseObjectStreamResponseOutputItemDone", "title": "OpenAIResponseObjectStreamResponseOutputItemDone",
"description": "Streaming event for when an output item is completed." "description": "Streaming event for when an output item is completed."
}, },
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the item to which the annotation is being added"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item in the response's output array"
},
"content_index": {
"type": "integer",
"description": "Index position of the content part within the output item"
},
"annotation_index": {
"type": "integer",
"description": "Index of the annotation within the content part"
},
"annotation": {
"oneOf": [
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation",
"url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation",
"container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation",
"file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
},
"description": "The annotation object being added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.output_text.annotation.added",
"default": "response.output_text.annotation.added",
"description": "Event type identifier, always \"response.output_text.annotation.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"content_index",
"annotation_index",
"annotation",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"description": "Streaming event for when an annotation is added to output text."
},
"OpenAIResponseObjectStreamResponseOutputTextDelta": { "OpenAIResponseObjectStreamResponseOutputTextDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -9097,6 +9336,342 @@
"title": "OpenAIResponseObjectStreamResponseOutputTextDone", "title": "OpenAIResponseObjectStreamResponseOutputTextDone",
"description": "Streaming event for when text output is completed." "description": "Streaming event for when text output is completed."
}, },
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The summary part that was added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.added",
"default": "response.reasoning_summary_part.added",
"description": "Event type identifier, always \"response.reasoning_summary_part.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"description": "Streaming event for when a new reasoning summary part is added."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The completed summary part"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.done",
"default": "response.reasoning_summary_part.done",
"description": "Event type identifier, always \"response.reasoning_summary_part.done\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"description": "Streaming event for when a reasoning summary part is completed."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": {
"type": "object",
"properties": {
"delta": {
"type": "string",
"description": "Incremental summary text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.delta",
"default": "response.reasoning_summary_text.delta",
"description": "Event type identifier, always \"response.reasoning_summary_text.delta\""
}
},
"additionalProperties": false,
"required": [
"delta",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"description": "Streaming event for incremental reasoning summary text updates."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Final complete summary text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.done",
"default": "response.reasoning_summary_text.done",
"description": "Event type identifier, always \"response.reasoning_summary_text.done\""
}
},
"additionalProperties": false,
"required": [
"text",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"description": "Streaming event for when reasoning summary text is completed."
},
"OpenAIResponseObjectStreamResponseReasoningTextDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"delta": {
"type": "string",
"description": "Incremental reasoning text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item being updated"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.delta",
"default": "response.reasoning_text.delta",
"description": "Event type identifier, always \"response.reasoning_text.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDelta",
"description": "Streaming event for incremental reasoning text updates."
},
"OpenAIResponseObjectStreamResponseReasoningTextDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"text": {
"type": "string",
"description": "Final complete reasoning text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the completed output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.done",
"default": "response.reasoning_text.done",
"description": "Event type identifier, always \"response.reasoning_text.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"text",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDone",
"description": "Streaming event for when reasoning text is completed."
},
"OpenAIResponseObjectStreamResponseRefusalDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"delta": {
"type": "string",
"description": "Incremental refusal text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.delta",
"default": "response.refusal.delta",
"description": "Event type identifier, always \"response.refusal.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDelta",
"description": "Streaming event for incremental refusal text updates."
},
"OpenAIResponseObjectStreamResponseRefusalDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"refusal": {
"type": "string",
"description": "Final complete refusal text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.done",
"default": "response.refusal.done",
"description": "Event type identifier, always \"response.refusal.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"refusal",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDone",
"description": "Streaming event for when refusal text is completed."
},
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -3950,6 +3950,11 @@ components:
items: items:
$ref: '#/components/schemas/OpenAIChatCompletionToolCall' $ref: '#/components/schemas/OpenAIChatCompletionToolCall'
description: (Optional) The tool calls of the delta description: (Optional) The tool calls of the delta
reasoning_content:
type: string
description: >-
(Optional) The reasoning content from the model (non-standard, for o1/o3
models)
additionalProperties: false additionalProperties: false
title: OpenAIChoiceDelta title: OpenAIChoiceDelta
description: >- description: >-
@ -6224,6 +6229,26 @@ components:
title: OpenAIResponseContentPartOutputText title: OpenAIResponseContentPartOutputText
description: >- description: >-
Text content within a streamed response part. Text content within a streamed response part.
"OpenAIResponseContentPartReasoningSummary":
type: object
properties:
type:
type: string
const: summary_text
default: summary_text
description: >-
Content part type identifier, always "summary_text"
text:
type: string
description: Summary text
additionalProperties: false
required:
- type
- text
title: >-
OpenAIResponseContentPartReasoningSummary
description: >-
Reasoning summary part in a streamed response.
OpenAIResponseContentPartReasoningText: OpenAIResponseContentPartReasoningText:
type: object type: object
properties: properties:
@ -6285,6 +6310,18 @@ components:
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -6312,6 +6349,18 @@ components:
response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -6487,6 +6536,99 @@ components:
title: OpenAIResponseObjectStreamResponseFailed title: OpenAIResponseObjectStreamResponseFailed
description: >- description: >-
Streaming event emitted when a response fails. Streaming event emitted when a response fails.
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the completed file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.completed
default: response.file_search_call.completed
description: >-
Event type identifier, always "response.file_search_call.completed"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallCompleted
description: >-
Streaming event for completed file search calls.
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.in_progress
default: response.file_search_call.in_progress
description: >-
Event type identifier, always "response.file_search_call.in_progress"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallInProgress
description: >-
Streaming event for file search calls in progress.
"OpenAIResponseObjectStreamResponseFileSearchCallSearching":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.searching
default: response.file_search_call.searching
description: >-
Event type identifier, always "response.file_search_call.searching"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallSearching
description: >-
Streaming event for file search currently searching.
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta":
type: object type: object
properties: properties:
@ -6879,6 +7021,62 @@ components:
OpenAIResponseObjectStreamResponseOutputItemDone OpenAIResponseObjectStreamResponseOutputItemDone
description: >- description: >-
Streaming event for when an output item is completed. Streaming event for when an output item is completed.
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the item to which the annotation is being added
output_index:
type: integer
description: >-
Index position of the output item in the response's output array
content_index:
type: integer
description: >-
Index position of the content part within the output item
annotation_index:
type: integer
description: >-
Index of the annotation within the content part
annotation:
oneOf:
- $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath'
discriminator:
propertyName: type
mapping:
file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation'
container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath'
description: The annotation object being added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.output_text.annotation.added
default: response.output_text.annotation.added
description: >-
Event type identifier, always "response.output_text.annotation.added"
additionalProperties: false
required:
- item_id
- output_index
- content_index
- annotation_index
- annotation
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded
description: >-
Streaming event for when an annotation is added to output text.
"OpenAIResponseObjectStreamResponseOutputTextDelta": "OpenAIResponseObjectStreamResponseOutputTextDelta":
type: object type: object
properties: properties:
@ -6958,6 +7156,314 @@ components:
OpenAIResponseObjectStreamResponseOutputTextDone OpenAIResponseObjectStreamResponseOutputTextDone
description: >- description: >-
Streaming event for when text output is completed. Streaming event for when text output is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The summary part that was added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.added
default: response.reasoning_summary_part.added
description: >-
Event type identifier, always "response.reasoning_summary_part.added"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded
description: >-
Streaming event for when a new reasoning summary part is added.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The completed summary part
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.done
default: response.reasoning_summary_part.done
description: >-
Event type identifier, always "response.reasoning_summary_part.done"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartDone
description: >-
Streaming event for when a reasoning summary part is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta":
type: object
properties:
delta:
type: string
description: Incremental summary text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.delta
default: response.reasoning_summary_text.delta
description: >-
Event type identifier, always "response.reasoning_summary_text.delta"
additionalProperties: false
required:
- delta
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta
description: >-
Streaming event for incremental reasoning summary text updates.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone":
type: object
properties:
text:
type: string
description: Final complete summary text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.done
default: response.reasoning_summary_text.done
description: >-
Event type identifier, always "response.reasoning_summary_text.done"
additionalProperties: false
required:
- text
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDone
description: >-
Streaming event for when reasoning summary text is completed.
"OpenAIResponseObjectStreamResponseReasoningTextDelta":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
delta:
type: string
description: Incremental reasoning text being added
item_id:
type: string
description: >-
Unique identifier of the output item being updated
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.delta
default: response.reasoning_text.delta
description: >-
Event type identifier, always "response.reasoning_text.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDelta
description: >-
Streaming event for incremental reasoning text updates.
"OpenAIResponseObjectStreamResponseReasoningTextDone":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
text:
type: string
description: Final complete reasoning text
item_id:
type: string
description: >-
Unique identifier of the completed output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.done
default: response.reasoning_text.done
description: >-
Event type identifier, always "response.reasoning_text.done"
additionalProperties: false
required:
- content_index
- text
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDone
description: >-
Streaming event for when reasoning text is completed.
"OpenAIResponseObjectStreamResponseRefusalDelta":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
delta:
type: string
description: Incremental refusal text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.delta
default: response.refusal.delta
description: >-
Event type identifier, always "response.refusal.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDelta
description: >-
Streaming event for incremental refusal text updates.
"OpenAIResponseObjectStreamResponseRefusalDone":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
refusal:
type: string
description: Final complete refusal text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.done
default: response.refusal.done
description: >-
Event type identifier, always "response.refusal.done"
additionalProperties: false
required:
- content_index
- refusal
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDone
description: >-
Streaming event for when refusal text is completed.
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted":
type: object type: object
properties: properties:

View file

@ -7227,6 +7227,10 @@
"$ref": "#/components/schemas/OpenAIChatCompletionToolCall" "$ref": "#/components/schemas/OpenAIChatCompletionToolCall"
}, },
"description": "(Optional) The tool calls of the delta" "description": "(Optional) The tool calls of the delta"
},
"reasoning_content": {
"type": "string",
"description": "(Optional) The reasoning content from the model (non-standard, for o1/o3 models)"
} }
}, },
"additionalProperties": false, "additionalProperties": false,
@ -10207,6 +10211,28 @@
"title": "OpenAIResponseContentPartOutputText", "title": "OpenAIResponseContentPartOutputText",
"description": "Text content within a streamed response part." "description": "Text content within a streamed response part."
}, },
"OpenAIResponseContentPartReasoningSummary": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "summary_text",
"default": "summary_text",
"description": "Content part type identifier, always \"summary_text\""
},
"text": {
"type": "string",
"description": "Summary text"
}
},
"additionalProperties": false,
"required": [
"type",
"text"
],
"title": "OpenAIResponseContentPartReasoningSummary",
"description": "Reasoning summary part in a streamed response."
},
"OpenAIResponseContentPartReasoningText": { "OpenAIResponseContentPartReasoningText": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -10316,6 +10342,42 @@
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone"
}, },
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching"
},
{
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted"
},
{ {
"$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete" "$ref": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete"
}, },
@ -10350,6 +10412,18 @@
"response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted", "response.mcp_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted",
"response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded", "response.content_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded",
"response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone", "response.content_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone",
"response.reasoning_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta",
"response.reasoning_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone",
"response.reasoning_summary_part.added": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"response.reasoning_summary_part.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"response.reasoning_summary_text.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"response.reasoning_summary_text.done": "#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"response.refusal.delta": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta",
"response.refusal.done": "#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone",
"response.output_text.annotation.added": "#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"response.file_search_call.in_progress": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"response.file_search_call.searching": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"response.file_search_call.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete", "response.incomplete": "#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete",
"response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed", "response.failed": "#/components/schemas/OpenAIResponseObjectStreamResponseFailed",
"response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted" "response.completed": "#/components/schemas/OpenAIResponseObjectStreamResponseCompleted"
@ -10557,6 +10631,102 @@
"title": "OpenAIResponseObjectStreamResponseFailed", "title": "OpenAIResponseObjectStreamResponseFailed",
"description": "Streaming event emitted when a response fails." "description": "Streaming event emitted when a response fails."
}, },
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the completed file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.completed",
"default": "response.file_search_call.completed",
"description": "Event type identifier, always \"response.file_search_call.completed\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted",
"description": "Streaming event for completed file search calls."
},
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.in_progress",
"default": "response.file_search_call.in_progress",
"description": "Event type identifier, always \"response.file_search_call.in_progress\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress",
"description": "Streaming event for file search calls in progress."
},
"OpenAIResponseObjectStreamResponseFileSearchCallSearching": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the file search call"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.file_search_call.searching",
"default": "response.file_search_call.searching",
"description": "Event type identifier, always \"response.file_search_call.searching\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching",
"description": "Streaming event for file search currently searching."
},
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -11022,6 +11192,75 @@
"title": "OpenAIResponseObjectStreamResponseOutputItemDone", "title": "OpenAIResponseObjectStreamResponseOutputItemDone",
"description": "Streaming event for when an output item is completed." "description": "Streaming event for when an output item is completed."
}, },
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the item to which the annotation is being added"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item in the response's output array"
},
"content_index": {
"type": "integer",
"description": "Index position of the content part within the output item"
},
"annotation_index": {
"type": "integer",
"description": "Index of the annotation within the content part"
},
"annotation": {
"oneOf": [
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation"
},
{
"$ref": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
],
"discriminator": {
"propertyName": "type",
"mapping": {
"file_citation": "#/components/schemas/OpenAIResponseAnnotationFileCitation",
"url_citation": "#/components/schemas/OpenAIResponseAnnotationCitation",
"container_file_citation": "#/components/schemas/OpenAIResponseAnnotationContainerFileCitation",
"file_path": "#/components/schemas/OpenAIResponseAnnotationFilePath"
}
},
"description": "The annotation object being added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.output_text.annotation.added",
"default": "response.output_text.annotation.added",
"description": "Event type identifier, always \"response.output_text.annotation.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"content_index",
"annotation_index",
"annotation",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded",
"description": "Streaming event for when an annotation is added to output text."
},
"OpenAIResponseObjectStreamResponseOutputTextDelta": { "OpenAIResponseObjectStreamResponseOutputTextDelta": {
"type": "object", "type": "object",
"properties": { "properties": {
@ -11106,6 +11345,342 @@
"title": "OpenAIResponseObjectStreamResponseOutputTextDone", "title": "OpenAIResponseObjectStreamResponseOutputTextDone",
"description": "Streaming event for when text output is completed." "description": "Streaming event for when text output is completed."
}, },
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The summary part that was added"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.added",
"default": "response.reasoning_summary_part.added",
"description": "Event type identifier, always \"response.reasoning_summary_part.added\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded",
"description": "Streaming event for when a new reasoning summary part is added."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": {
"type": "object",
"properties": {
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"part": {
"$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary",
"description": "The completed summary part"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_part.done",
"default": "response.reasoning_summary_part.done",
"description": "Event type identifier, always \"response.reasoning_summary_part.done\""
}
},
"additionalProperties": false,
"required": [
"item_id",
"output_index",
"part",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone",
"description": "Streaming event for when a reasoning summary part is completed."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": {
"type": "object",
"properties": {
"delta": {
"type": "string",
"description": "Incremental summary text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.delta",
"default": "response.reasoning_summary_text.delta",
"description": "Event type identifier, always \"response.reasoning_summary_text.delta\""
}
},
"additionalProperties": false,
"required": [
"delta",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta",
"description": "Streaming event for incremental reasoning summary text updates."
},
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Final complete summary text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the output item"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"summary_index": {
"type": "integer",
"description": "Index of the summary part within the reasoning summary"
},
"type": {
"type": "string",
"const": "response.reasoning_summary_text.done",
"default": "response.reasoning_summary_text.done",
"description": "Event type identifier, always \"response.reasoning_summary_text.done\""
}
},
"additionalProperties": false,
"required": [
"text",
"item_id",
"output_index",
"sequence_number",
"summary_index",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone",
"description": "Streaming event for when reasoning summary text is completed."
},
"OpenAIResponseObjectStreamResponseReasoningTextDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"delta": {
"type": "string",
"description": "Incremental reasoning text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item being updated"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.delta",
"default": "response.reasoning_text.delta",
"description": "Event type identifier, always \"response.reasoning_text.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDelta",
"description": "Streaming event for incremental reasoning text updates."
},
"OpenAIResponseObjectStreamResponseReasoningTextDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the reasoning content part"
},
"text": {
"type": "string",
"description": "Final complete reasoning text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the completed output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.reasoning_text.done",
"default": "response.reasoning_text.done",
"description": "Event type identifier, always \"response.reasoning_text.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"text",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseReasoningTextDone",
"description": "Streaming event for when reasoning text is completed."
},
"OpenAIResponseObjectStreamResponseRefusalDelta": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"delta": {
"type": "string",
"description": "Incremental refusal text being added"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.delta",
"default": "response.refusal.delta",
"description": "Event type identifier, always \"response.refusal.delta\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"delta",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDelta",
"description": "Streaming event for incremental refusal text updates."
},
"OpenAIResponseObjectStreamResponseRefusalDone": {
"type": "object",
"properties": {
"content_index": {
"type": "integer",
"description": "Index position of the content part"
},
"refusal": {
"type": "string",
"description": "Final complete refusal text"
},
"item_id": {
"type": "string",
"description": "Unique identifier of the output item"
},
"output_index": {
"type": "integer",
"description": "Index position of the item in the output list"
},
"sequence_number": {
"type": "integer",
"description": "Sequential number for ordering streaming events"
},
"type": {
"type": "string",
"const": "response.refusal.done",
"default": "response.refusal.done",
"description": "Event type identifier, always \"response.refusal.done\""
}
},
"additionalProperties": false,
"required": [
"content_index",
"refusal",
"item_id",
"output_index",
"sequence_number",
"type"
],
"title": "OpenAIResponseObjectStreamResponseRefusalDone",
"description": "Streaming event for when refusal text is completed."
},
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": {
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -5395,6 +5395,11 @@ components:
items: items:
$ref: '#/components/schemas/OpenAIChatCompletionToolCall' $ref: '#/components/schemas/OpenAIChatCompletionToolCall'
description: (Optional) The tool calls of the delta description: (Optional) The tool calls of the delta
reasoning_content:
type: string
description: >-
(Optional) The reasoning content from the model (non-standard, for o1/o3
models)
additionalProperties: false additionalProperties: false
title: OpenAIChoiceDelta title: OpenAIChoiceDelta
description: >- description: >-
@ -7669,6 +7674,26 @@ components:
title: OpenAIResponseContentPartOutputText title: OpenAIResponseContentPartOutputText
description: >- description: >-
Text content within a streamed response part. Text content within a streamed response part.
"OpenAIResponseContentPartReasoningSummary":
type: object
properties:
type:
type: string
const: summary_text
default: summary_text
description: >-
Content part type identifier, always "summary_text"
text:
type: string
description: Summary text
additionalProperties: false
required:
- type
- text
title: >-
OpenAIResponseContentPartReasoningSummary
description: >-
Reasoning summary part in a streamed response.
OpenAIResponseContentPartReasoningText: OpenAIResponseContentPartReasoningText:
type: object type: object
properties: properties:
@ -7730,6 +7755,18 @@ components:
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
- $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -7757,6 +7794,18 @@ components:
response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted' response.mcp_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseMcpCallCompleted'
response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded' response.content_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartAdded'
response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone' response.content_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseContentPartDone'
response.reasoning_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDelta'
response.reasoning_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningTextDone'
response.reasoning_summary_part.added: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded'
response.reasoning_summary_part.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryPartDone'
response.reasoning_summary_text.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta'
response.reasoning_summary_text.done: '#/components/schemas/OpenAIResponseObjectStreamResponseReasoningSummaryTextDone'
response.refusal.delta: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDelta'
response.refusal.done: '#/components/schemas/OpenAIResponseObjectStreamResponseRefusalDone'
response.output_text.annotation.added: '#/components/schemas/OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded'
response.file_search_call.in_progress: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallInProgress'
response.file_search_call.searching: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallSearching'
response.file_search_call.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseFileSearchCallCompleted'
response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete' response.incomplete: '#/components/schemas/OpenAIResponseObjectStreamResponseIncomplete'
response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed' response.failed: '#/components/schemas/OpenAIResponseObjectStreamResponseFailed'
response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted' response.completed: '#/components/schemas/OpenAIResponseObjectStreamResponseCompleted'
@ -7932,6 +7981,99 @@ components:
title: OpenAIResponseObjectStreamResponseFailed title: OpenAIResponseObjectStreamResponseFailed
description: >- description: >-
Streaming event emitted when a response fails. Streaming event emitted when a response fails.
"OpenAIResponseObjectStreamResponseFileSearchCallCompleted":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the completed file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.completed
default: response.file_search_call.completed
description: >-
Event type identifier, always "response.file_search_call.completed"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallCompleted
description: >-
Streaming event for completed file search calls.
"OpenAIResponseObjectStreamResponseFileSearchCallInProgress":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.in_progress
default: response.file_search_call.in_progress
description: >-
Event type identifier, always "response.file_search_call.in_progress"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallInProgress
description: >-
Streaming event for file search calls in progress.
"OpenAIResponseObjectStreamResponseFileSearchCallSearching":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the file search call
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.file_search_call.searching
default: response.file_search_call.searching
description: >-
Event type identifier, always "response.file_search_call.searching"
additionalProperties: false
required:
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseFileSearchCallSearching
description: >-
Streaming event for file search currently searching.
"OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta":
type: object type: object
properties: properties:
@ -8324,6 +8466,62 @@ components:
OpenAIResponseObjectStreamResponseOutputItemDone OpenAIResponseObjectStreamResponseOutputItemDone
description: >- description: >-
Streaming event for when an output item is completed. Streaming event for when an output item is completed.
"OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded":
type: object
properties:
item_id:
type: string
description: >-
Unique identifier of the item to which the annotation is being added
output_index:
type: integer
description: >-
Index position of the output item in the response's output array
content_index:
type: integer
description: >-
Index position of the content part within the output item
annotation_index:
type: integer
description: >-
Index of the annotation within the content part
annotation:
oneOf:
- $ref: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
- $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath'
discriminator:
propertyName: type
mapping:
file_citation: '#/components/schemas/OpenAIResponseAnnotationFileCitation'
url_citation: '#/components/schemas/OpenAIResponseAnnotationCitation'
container_file_citation: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation'
file_path: '#/components/schemas/OpenAIResponseAnnotationFilePath'
description: The annotation object being added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.output_text.annotation.added
default: response.output_text.annotation.added
description: >-
Event type identifier, always "response.output_text.annotation.added"
additionalProperties: false
required:
- item_id
- output_index
- content_index
- annotation_index
- annotation
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded
description: >-
Streaming event for when an annotation is added to output text.
"OpenAIResponseObjectStreamResponseOutputTextDelta": "OpenAIResponseObjectStreamResponseOutputTextDelta":
type: object type: object
properties: properties:
@ -8403,6 +8601,314 @@ components:
OpenAIResponseObjectStreamResponseOutputTextDone OpenAIResponseObjectStreamResponseOutputTextDone
description: >- description: >-
Streaming event for when text output is completed. Streaming event for when text output is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The summary part that was added
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.added
default: response.reasoning_summary_part.added
description: >-
Event type identifier, always "response.reasoning_summary_part.added"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded
description: >-
Streaming event for when a new reasoning summary part is added.
"OpenAIResponseObjectStreamResponseReasoningSummaryPartDone":
type: object
properties:
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
part:
$ref: '#/components/schemas/OpenAIResponseContentPartReasoningSummary'
description: The completed summary part
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_part.done
default: response.reasoning_summary_part.done
description: >-
Event type identifier, always "response.reasoning_summary_part.done"
additionalProperties: false
required:
- item_id
- output_index
- part
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryPartDone
description: >-
Streaming event for when a reasoning summary part is completed.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta":
type: object
properties:
delta:
type: string
description: Incremental summary text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.delta
default: response.reasoning_summary_text.delta
description: >-
Event type identifier, always "response.reasoning_summary_text.delta"
additionalProperties: false
required:
- delta
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta
description: >-
Streaming event for incremental reasoning summary text updates.
"OpenAIResponseObjectStreamResponseReasoningSummaryTextDone":
type: object
properties:
text:
type: string
description: Final complete summary text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: Index position of the output item
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
summary_index:
type: integer
description: >-
Index of the summary part within the reasoning summary
type:
type: string
const: response.reasoning_summary_text.done
default: response.reasoning_summary_text.done
description: >-
Event type identifier, always "response.reasoning_summary_text.done"
additionalProperties: false
required:
- text
- item_id
- output_index
- sequence_number
- summary_index
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningSummaryTextDone
description: >-
Streaming event for when reasoning summary text is completed.
"OpenAIResponseObjectStreamResponseReasoningTextDelta":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
delta:
type: string
description: Incremental reasoning text being added
item_id:
type: string
description: >-
Unique identifier of the output item being updated
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.delta
default: response.reasoning_text.delta
description: >-
Event type identifier, always "response.reasoning_text.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDelta
description: >-
Streaming event for incremental reasoning text updates.
"OpenAIResponseObjectStreamResponseReasoningTextDone":
type: object
properties:
content_index:
type: integer
description: >-
Index position of the reasoning content part
text:
type: string
description: Final complete reasoning text
item_id:
type: string
description: >-
Unique identifier of the completed output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.reasoning_text.done
default: response.reasoning_text.done
description: >-
Event type identifier, always "response.reasoning_text.done"
additionalProperties: false
required:
- content_index
- text
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseReasoningTextDone
description: >-
Streaming event for when reasoning text is completed.
"OpenAIResponseObjectStreamResponseRefusalDelta":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
delta:
type: string
description: Incremental refusal text being added
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.delta
default: response.refusal.delta
description: >-
Event type identifier, always "response.refusal.delta"
additionalProperties: false
required:
- content_index
- delta
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDelta
description: >-
Streaming event for incremental refusal text updates.
"OpenAIResponseObjectStreamResponseRefusalDone":
type: object
properties:
content_index:
type: integer
description: Index position of the content part
refusal:
type: string
description: Final complete refusal text
item_id:
type: string
description: Unique identifier of the output item
output_index:
type: integer
description: >-
Index position of the item in the output list
sequence_number:
type: integer
description: >-
Sequential number for ordering streaming events
type:
type: string
const: response.refusal.done
default: response.refusal.done
description: >-
Event type identifier, always "response.refusal.done"
additionalProperties: false
required:
- content_index
- refusal
- item_id
- output_index
- sequence_number
- type
title: >-
OpenAIResponseObjectStreamResponseRefusalDone
description: >-
Streaming event for when refusal text is completed.
"OpenAIResponseObjectStreamResponseWebSearchCallCompleted": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted":
type: object type: object
properties: properties:

View file

@ -953,6 +953,248 @@ class OpenAIResponseObjectStreamResponseContentPartDone(BaseModel):
type: Literal["response.content_part.done"] = "response.content_part.done" type: Literal["response.content_part.done"] = "response.content_part.done"
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningTextDelta(BaseModel):
"""Streaming event for incremental reasoning text updates.
:param content_index: Index position of the reasoning content part
:param delta: Incremental reasoning text being added
:param item_id: Unique identifier of the output item being updated
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.reasoning_text.delta"
"""
content_index: int
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.reasoning_text.delta"] = "response.reasoning_text.delta"
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningTextDone(BaseModel):
"""Streaming event for when reasoning text is completed.
:param content_index: Index position of the reasoning content part
:param text: Final complete reasoning text
:param item_id: Unique identifier of the completed output item
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.reasoning_text.done"
"""
content_index: int
text: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.reasoning_text.done"] = "response.reasoning_text.done"
@json_schema_type
class OpenAIResponseContentPartReasoningSummary(BaseModel):
"""Reasoning summary part in a streamed response.
:param type: Content part type identifier, always "summary_text"
:param text: Summary text
"""
type: Literal["summary_text"] = "summary_text"
text: str
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded(BaseModel):
"""Streaming event for when a new reasoning summary part is added.
:param item_id: Unique identifier of the output item
:param output_index: Index position of the output item
:param part: The summary part that was added
:param sequence_number: Sequential number for ordering streaming events
:param summary_index: Index of the summary part within the reasoning summary
:param type: Event type identifier, always "response.reasoning_summary_part.added"
"""
item_id: str
output_index: int
part: OpenAIResponseContentPartReasoningSummary
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_part.added"] = "response.reasoning_summary_part.added"
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningSummaryPartDone(BaseModel):
"""Streaming event for when a reasoning summary part is completed.
:param item_id: Unique identifier of the output item
:param output_index: Index position of the output item
:param part: The completed summary part
:param sequence_number: Sequential number for ordering streaming events
:param summary_index: Index of the summary part within the reasoning summary
:param type: Event type identifier, always "response.reasoning_summary_part.done"
"""
item_id: str
output_index: int
part: OpenAIResponseContentPartReasoningSummary
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_part.done"] = "response.reasoning_summary_part.done"
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta(BaseModel):
"""Streaming event for incremental reasoning summary text updates.
:param delta: Incremental summary text being added
:param item_id: Unique identifier of the output item
:param output_index: Index position of the output item
:param sequence_number: Sequential number for ordering streaming events
:param summary_index: Index of the summary part within the reasoning summary
:param type: Event type identifier, always "response.reasoning_summary_text.delta"
"""
delta: str
item_id: str
output_index: int
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_text.delta"] = "response.reasoning_summary_text.delta"
@json_schema_type
class OpenAIResponseObjectStreamResponseReasoningSummaryTextDone(BaseModel):
"""Streaming event for when reasoning summary text is completed.
:param text: Final complete summary text
:param item_id: Unique identifier of the output item
:param output_index: Index position of the output item
:param sequence_number: Sequential number for ordering streaming events
:param summary_index: Index of the summary part within the reasoning summary
:param type: Event type identifier, always "response.reasoning_summary_text.done"
"""
text: str
item_id: str
output_index: int
sequence_number: int
summary_index: int
type: Literal["response.reasoning_summary_text.done"] = "response.reasoning_summary_text.done"
@json_schema_type
class OpenAIResponseObjectStreamResponseRefusalDelta(BaseModel):
"""Streaming event for incremental refusal text updates.
:param content_index: Index position of the content part
:param delta: Incremental refusal text being added
:param item_id: Unique identifier of the output item
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.refusal.delta"
"""
content_index: int
delta: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.refusal.delta"] = "response.refusal.delta"
@json_schema_type
class OpenAIResponseObjectStreamResponseRefusalDone(BaseModel):
"""Streaming event for when refusal text is completed.
:param content_index: Index position of the content part
:param refusal: Final complete refusal text
:param item_id: Unique identifier of the output item
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.refusal.done"
"""
content_index: int
refusal: str
item_id: str
output_index: int
sequence_number: int
type: Literal["response.refusal.done"] = "response.refusal.done"
@json_schema_type
class OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded(BaseModel):
"""Streaming event for when an annotation is added to output text.
:param item_id: Unique identifier of the item to which the annotation is being added
:param output_index: Index position of the output item in the response's output array
:param content_index: Index position of the content part within the output item
:param annotation_index: Index of the annotation within the content part
:param annotation: The annotation object being added
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.output_text.annotation.added"
"""
item_id: str
output_index: int
content_index: int
annotation_index: int
annotation: OpenAIResponseAnnotations
sequence_number: int
type: Literal["response.output_text.annotation.added"] = "response.output_text.annotation.added"
@json_schema_type
class OpenAIResponseObjectStreamResponseFileSearchCallInProgress(BaseModel):
"""Streaming event for file search calls in progress.
:param item_id: Unique identifier of the file search call
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.file_search_call.in_progress"
"""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.in_progress"] = "response.file_search_call.in_progress"
@json_schema_type
class OpenAIResponseObjectStreamResponseFileSearchCallSearching(BaseModel):
"""Streaming event for file search currently searching.
:param item_id: Unique identifier of the file search call
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.file_search_call.searching"
"""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.searching"] = "response.file_search_call.searching"
@json_schema_type
class OpenAIResponseObjectStreamResponseFileSearchCallCompleted(BaseModel):
"""Streaming event for completed file search calls.
:param item_id: Unique identifier of the completed file search call
:param output_index: Index position of the item in the output list
:param sequence_number: Sequential number for ordering streaming events
:param type: Event type identifier, always "response.file_search_call.completed"
"""
item_id: str
output_index: int
sequence_number: int
type: Literal["response.file_search_call.completed"] = "response.file_search_call.completed"
OpenAIResponseObjectStream = Annotated[ OpenAIResponseObjectStream = Annotated[
OpenAIResponseObjectStreamResponseCreated OpenAIResponseObjectStreamResponseCreated
| OpenAIResponseObjectStreamResponseInProgress | OpenAIResponseObjectStreamResponseInProgress
@ -975,6 +1217,18 @@ OpenAIResponseObjectStream = Annotated[
| OpenAIResponseObjectStreamResponseMcpCallCompleted | OpenAIResponseObjectStreamResponseMcpCallCompleted
| OpenAIResponseObjectStreamResponseContentPartAdded | OpenAIResponseObjectStreamResponseContentPartAdded
| OpenAIResponseObjectStreamResponseContentPartDone | OpenAIResponseObjectStreamResponseContentPartDone
| OpenAIResponseObjectStreamResponseReasoningTextDelta
| OpenAIResponseObjectStreamResponseReasoningTextDone
| OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded
| OpenAIResponseObjectStreamResponseReasoningSummaryPartDone
| OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta
| OpenAIResponseObjectStreamResponseReasoningSummaryTextDone
| OpenAIResponseObjectStreamResponseRefusalDelta
| OpenAIResponseObjectStreamResponseRefusalDone
| OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded
| OpenAIResponseObjectStreamResponseFileSearchCallInProgress
| OpenAIResponseObjectStreamResponseFileSearchCallSearching
| OpenAIResponseObjectStreamResponseFileSearchCallCompleted
| OpenAIResponseObjectStreamResponseIncomplete | OpenAIResponseObjectStreamResponseIncomplete
| OpenAIResponseObjectStreamResponseFailed | OpenAIResponseObjectStreamResponseFailed
| OpenAIResponseObjectStreamResponseCompleted, | OpenAIResponseObjectStreamResponseCompleted,

View file

@ -777,12 +777,14 @@ class OpenAIChoiceDelta(BaseModel):
:param refusal: (Optional) The refusal of the delta :param refusal: (Optional) The refusal of the delta
:param role: (Optional) The role of the delta :param role: (Optional) The role of the delta
:param tool_calls: (Optional) The tool calls of the delta :param tool_calls: (Optional) The tool calls of the delta
:param reasoning_content: (Optional) The reasoning content from the model (non-standard, for o1/o3 models)
""" """
content: str | None = None content: str | None = None
refusal: str | None = None refusal: str | None = None
role: str | None = None role: str | None = None
tool_calls: list[OpenAIChatCompletionToolCall] | None = None tool_calls: list[OpenAIChatCompletionToolCall] | None = None
reasoning_content: str | None = None
@json_schema_type @json_schema_type

View file

@ -13,6 +13,8 @@ from llama_stack.apis.agents.openai_responses import (
ApprovalFilter, ApprovalFilter,
MCPListToolsTool, MCPListToolsTool,
OpenAIResponseContentPartOutputText, OpenAIResponseContentPartOutputText,
OpenAIResponseContentPartReasoningText,
OpenAIResponseContentPartRefusal,
OpenAIResponseError, OpenAIResponseError,
OpenAIResponseInputTool, OpenAIResponseInputTool,
OpenAIResponseInputToolMCP, OpenAIResponseInputToolMCP,
@ -35,6 +37,10 @@ from llama_stack.apis.agents.openai_responses import (
OpenAIResponseObjectStreamResponseOutputItemAdded, OpenAIResponseObjectStreamResponseOutputItemAdded,
OpenAIResponseObjectStreamResponseOutputItemDone, OpenAIResponseObjectStreamResponseOutputItemDone,
OpenAIResponseObjectStreamResponseOutputTextDelta, OpenAIResponseObjectStreamResponseOutputTextDelta,
OpenAIResponseObjectStreamResponseReasoningTextDelta,
OpenAIResponseObjectStreamResponseReasoningTextDone,
OpenAIResponseObjectStreamResponseRefusalDelta,
OpenAIResponseObjectStreamResponseRefusalDone,
OpenAIResponseOutput, OpenAIResponseOutput,
OpenAIResponseOutputMessageFunctionToolCall, OpenAIResponseOutputMessageFunctionToolCall,
OpenAIResponseOutputMessageMCPListTools, OpenAIResponseOutputMessageMCPListTools,
@ -355,6 +361,128 @@ class StreamingResponseOrchestrator:
), ),
) )
async def _handle_reasoning_content_chunk(
self,
reasoning_content: str,
reasoning_part_emitted: bool,
reasoning_content_index: int,
message_item_id: str,
message_output_index: int,
) -> AsyncIterator[OpenAIResponseObjectStream]:
# Emit content_part.added event for first reasoning chunk
if not reasoning_part_emitted:
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseContentPartAdded(
content_index=reasoning_content_index,
response_id=self.response_id,
item_id=message_item_id,
output_index=message_output_index,
part=OpenAIResponseContentPartReasoningText(
text="", # Will be filled incrementally via reasoning deltas
),
sequence_number=self.sequence_number,
)
# Emit reasoning_text.delta event
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseReasoningTextDelta(
content_index=reasoning_content_index,
delta=reasoning_content,
item_id=message_item_id,
output_index=message_output_index,
sequence_number=self.sequence_number,
)
async def _handle_refusal_content_chunk(
self,
refusal_content: str,
refusal_part_emitted: bool,
refusal_content_index: int,
message_item_id: str,
message_output_index: int,
) -> AsyncIterator[OpenAIResponseObjectStream]:
# Emit content_part.added event for first refusal chunk
if not refusal_part_emitted:
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseContentPartAdded(
content_index=refusal_content_index,
response_id=self.response_id,
item_id=message_item_id,
output_index=message_output_index,
part=OpenAIResponseContentPartRefusal(
refusal="", # Will be filled incrementally via refusal deltas
),
sequence_number=self.sequence_number,
)
# Emit refusal.delta event
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseRefusalDelta(
content_index=refusal_content_index,
delta=refusal_content,
item_id=message_item_id,
output_index=message_output_index,
sequence_number=self.sequence_number,
)
async def _emit_reasoning_done_events(
self,
reasoning_text_accumulated: list[str],
reasoning_content_index: int,
message_item_id: str,
message_output_index: int,
) -> AsyncIterator[OpenAIResponseObjectStream]:
final_reasoning_text = "".join(reasoning_text_accumulated)
# Emit reasoning_text.done event
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseReasoningTextDone(
content_index=reasoning_content_index,
text=final_reasoning_text,
item_id=message_item_id,
output_index=message_output_index,
sequence_number=self.sequence_number,
)
# Emit content_part.done for reasoning
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseContentPartDone(
content_index=reasoning_content_index,
response_id=self.response_id,
item_id=message_item_id,
output_index=message_output_index,
part=OpenAIResponseContentPartReasoningText(
text=final_reasoning_text,
),
sequence_number=self.sequence_number,
)
async def _emit_refusal_done_events(
self,
refusal_text_accumulated: list[str],
refusal_content_index: int,
message_item_id: str,
message_output_index: int,
) -> AsyncIterator[OpenAIResponseObjectStream]:
final_refusal_text = "".join(refusal_text_accumulated)
# Emit refusal.done event
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseRefusalDone(
content_index=refusal_content_index,
refusal=final_refusal_text,
item_id=message_item_id,
output_index=message_output_index,
sequence_number=self.sequence_number,
)
# Emit content_part.done for refusal
self.sequence_number += 1
yield OpenAIResponseObjectStreamResponseContentPartDone(
content_index=refusal_content_index,
response_id=self.response_id,
item_id=message_item_id,
output_index=message_output_index,
part=OpenAIResponseContentPartRefusal(
refusal=final_refusal_text,
),
sequence_number=self.sequence_number,
)
async def _process_streaming_chunks( async def _process_streaming_chunks(
self, completion_result, output_messages: list[OpenAIResponseOutput] self, completion_result, output_messages: list[OpenAIResponseOutput]
) -> AsyncIterator[OpenAIResponseObjectStream | ChatCompletionResult]: ) -> AsyncIterator[OpenAIResponseObjectStream | ChatCompletionResult]:
@ -373,8 +501,14 @@ class StreamingResponseOrchestrator:
tool_call_item_ids: dict[int, str] = {} tool_call_item_ids: dict[int, str] = {}
# Track content parts for streaming events # Track content parts for streaming events
content_part_emitted = False content_part_emitted = False
reasoning_part_emitted = False
refusal_part_emitted = False
content_index = 0 content_index = 0
reasoning_content_index = 1 # reasoning is a separate content part
refusal_content_index = 2 # refusal is a separate content part
message_output_index = len(output_messages) message_output_index = len(output_messages)
reasoning_text_accumulated = []
refusal_text_accumulated = []
async for chunk in completion_result: async for chunk in completion_result:
chat_response_id = chunk.id chat_response_id = chunk.id
@ -415,6 +549,32 @@ class StreamingResponseOrchestrator:
if chunk_choice.finish_reason: if chunk_choice.finish_reason:
chunk_finish_reason = chunk_choice.finish_reason chunk_finish_reason = chunk_choice.finish_reason
# Handle reasoning content if present (non-standard field for o1/o3 models)
if hasattr(chunk_choice.delta, "reasoning_content") and chunk_choice.delta.reasoning_content:
async for event in self._handle_reasoning_content_chunk(
reasoning_content=chunk_choice.delta.reasoning_content,
reasoning_part_emitted=reasoning_part_emitted,
reasoning_content_index=reasoning_content_index,
message_item_id=message_item_id,
message_output_index=message_output_index,
):
yield event
reasoning_part_emitted = True
reasoning_text_accumulated.append(chunk_choice.delta.reasoning_content)
# Handle refusal content if present
if chunk_choice.delta.refusal:
async for event in self._handle_refusal_content_chunk(
refusal_content=chunk_choice.delta.refusal,
refusal_part_emitted=refusal_part_emitted,
refusal_content_index=refusal_content_index,
message_item_id=message_item_id,
message_output_index=message_output_index,
):
yield event
refusal_part_emitted = True
refusal_text_accumulated.append(chunk_choice.delta.refusal)
# Aggregate tool call arguments across chunks # Aggregate tool call arguments across chunks
if chunk_choice.delta.tool_calls: if chunk_choice.delta.tool_calls:
for tool_call in chunk_choice.delta.tool_calls: for tool_call in chunk_choice.delta.tool_calls:
@ -516,6 +676,26 @@ class StreamingResponseOrchestrator:
sequence_number=self.sequence_number, sequence_number=self.sequence_number,
) )
# Emit reasoning done events if reasoning content was streamed
if reasoning_part_emitted:
async for event in self._emit_reasoning_done_events(
reasoning_text_accumulated=reasoning_text_accumulated,
reasoning_content_index=reasoning_content_index,
message_item_id=message_item_id,
message_output_index=message_output_index,
):
yield event
# Emit refusal done events if refusal content was streamed
if refusal_part_emitted:
async for event in self._emit_refusal_done_events(
refusal_text_accumulated=refusal_text_accumulated,
refusal_content_index=refusal_content_index,
message_item_id=message_item_id,
message_output_index=message_output_index,
):
yield event
# Clear content when there are tool calls (OpenAI spec behavior) # Clear content when there are tool calls (OpenAI spec behavior)
if chat_response_tool_calls: if chat_response_tool_calls:
chat_response_content = [] chat_response_content = []

View file

@ -11,6 +11,9 @@ from collections.abc import AsyncIterator
from llama_stack.apis.agents.openai_responses import ( from llama_stack.apis.agents.openai_responses import (
OpenAIResponseInputToolFileSearch, OpenAIResponseInputToolFileSearch,
OpenAIResponseInputToolMCP, OpenAIResponseInputToolMCP,
OpenAIResponseObjectStreamResponseFileSearchCallCompleted,
OpenAIResponseObjectStreamResponseFileSearchCallInProgress,
OpenAIResponseObjectStreamResponseFileSearchCallSearching,
OpenAIResponseObjectStreamResponseMcpCallCompleted, OpenAIResponseObjectStreamResponseMcpCallCompleted,
OpenAIResponseObjectStreamResponseMcpCallFailed, OpenAIResponseObjectStreamResponseMcpCallFailed,
OpenAIResponseObjectStreamResponseMcpCallInProgress, OpenAIResponseObjectStreamResponseMcpCallInProgress,
@ -221,7 +224,13 @@ class ToolExecutor:
output_index=output_index, output_index=output_index,
sequence_number=sequence_number, sequence_number=sequence_number,
) )
# Note: knowledge_search and other custom tools don't have specific streaming events in OpenAI spec elif function_name == "knowledge_search":
sequence_number += 1
progress_event = OpenAIResponseObjectStreamResponseFileSearchCallInProgress(
item_id=item_id,
output_index=output_index,
sequence_number=sequence_number,
)
if progress_event: if progress_event:
yield ToolExecutionResult(stream_event=progress_event, sequence_number=sequence_number) yield ToolExecutionResult(stream_event=progress_event, sequence_number=sequence_number)
@ -236,6 +245,16 @@ class ToolExecutor:
) )
yield ToolExecutionResult(stream_event=searching_event, sequence_number=sequence_number) yield ToolExecutionResult(stream_event=searching_event, sequence_number=sequence_number)
# For file search, emit searching event
if function_name == "knowledge_search":
sequence_number += 1
searching_event = OpenAIResponseObjectStreamResponseFileSearchCallSearching(
item_id=item_id,
output_index=output_index,
sequence_number=sequence_number,
)
yield ToolExecutionResult(stream_event=searching_event, sequence_number=sequence_number)
async def _execute_tool( async def _execute_tool(
self, self,
function_name: str, function_name: str,
@ -322,7 +341,13 @@ class ToolExecutor:
output_index=output_index, output_index=output_index,
sequence_number=sequence_number, sequence_number=sequence_number,
) )
# Note: knowledge_search and other custom tools don't have specific completion events in OpenAI spec elif function_name == "knowledge_search":
sequence_number += 1
completion_event = OpenAIResponseObjectStreamResponseFileSearchCallCompleted(
item_id=item_id,
output_index=output_index,
sequence_number=sequence_number,
)
if completion_event: if completion_event:
yield ToolExecutionResult(stream_event=completion_event, sequence_number=sequence_number) yield ToolExecutionResult(stream_event=completion_event, sequence_number=sequence_number)

View file

@ -0,0 +1,364 @@
{
"test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_streaming_events[client_with_models-txt=openai/gpt-4o]",
"request": {
"method": "POST",
"url": "https://api.openai.com/v1/v1/chat/completions",
"headers": {},
"body": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "What are the marketing updates?"
}
],
"stream": true,
"stream_options": {
"include_usage": true
},
"tools": [
{
"type": "function",
"function": {
"name": "knowledge_search",
"description": "Search for information in a database.",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The query to search for. Can be a natural language sentence or keywords."
}
},
"required": [
"query"
]
}
}
}
]
},
"endpoint": "/v1/chat/completions",
"model": "gpt-4o"
},
"response": {
"body": [
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": "assistant",
"tool_calls": [
{
"index": 0,
"id": "call_yrecP7RchFwSrzeZd9oqtJEN",
"function": {
"arguments": "",
"name": "knowledge_search"
},
"type": "function"
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "FO68"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "{\"",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "TJ3"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "query",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "4"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "\":\"",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "r"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "marketing",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "uV08LeJq8kRvD"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": " updates",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "7ouSqhLcxzdGuA"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "\"}",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "uug"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": null
},
"finish_reason": "tool_calls",
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "jBmu"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-3ae0877c874c",
"choices": [],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": {
"completion_tokens": 16,
"prompt_tokens": 66,
"total_tokens": 82,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"obfuscation": "9QmaFTrTZ7uhZnV"
}
}
],
"is_streaming": true
},
"id_normalization_mapping": {}
}

View file

@ -0,0 +1,512 @@
{
"test_id": "tests/integration/responses/test_file_search.py::test_response_file_search_streaming_events[openai_client-txt=openai/gpt-4o]",
"request": {
"method": "POST",
"url": "https://api.openai.com/v1/v1/chat/completions",
"headers": {},
"body": {
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "What are the marketing updates?"
}
],
"stream": true,
"stream_options": {
"include_usage": true
},
"tools": [
{
"type": "function",
"function": {
"name": "knowledge_search",
"description": "Search for information in a database.",
"parameters": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The query to search for. Can be a natural language sentence or keywords."
}
},
"required": [
"query"
]
}
}
}
]
},
"endpoint": "/v1/chat/completions",
"model": "gpt-4o"
},
"response": {
"body": [
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": "assistant",
"tool_calls": [
{
"index": 0,
"id": "call_Vdxnbo2D8ds3BuKCon8XUt9P",
"function": {
"arguments": "",
"name": "knowledge_search"
},
"type": "function"
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "ypKL"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "{\"",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "sKu"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "query",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "B"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "\":\"",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "R"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "marketing",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "d8dj126pSbu16"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": " updates",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "dKd51Xg2hSEbZR"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": " October",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "nQtsJsUFk8Ku6B"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": " ",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "fEjZX"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "202",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "Oht"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "3",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "eEjRs"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": [
{
"index": 0,
"id": null,
"function": {
"arguments": "\"}",
"name": null
},
"type": null
}
]
},
"finish_reason": null,
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "DFm"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [
{
"delta": {
"content": null,
"function_call": null,
"refusal": null,
"role": null,
"tool_calls": null
},
"finish_reason": "tool_calls",
"index": 0,
"logprobs": null
}
],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": null,
"obfuscation": "ZDAJ"
}
},
{
"__type__": "openai.types.chat.chat_completion_chunk.ChatCompletionChunk",
"__data__": {
"id": "rec-99de86ac838b",
"choices": [],
"created": 0,
"model": "gpt-4o-2024-08-06",
"object": "chat.completion.chunk",
"service_tier": "default",
"system_fingerprint": "fp_f64f290af2",
"usage": {
"completion_tokens": 20,
"prompt_tokens": 66,
"total_tokens": 86,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
},
"obfuscation": "TAto5fU1PVZJ7fG"
}
}
],
"is_streaming": true
},
"id_normalization_mapping": {}
}

View file

@ -318,3 +318,48 @@ def test_response_file_search_filter_compound_or(compat_client, text_model_id, v
# Verify we got at least one of the expected categories # Verify we got at least one of the expected categories
assert len(categories_found) > 0, "Should have found at least one marketing or sales file" assert len(categories_found) > 0, "Should have found at least one marketing or sales file"
assert categories_found.issubset({"marketing", "sales"}), f"Found unexpected categories: {categories_found}" assert categories_found.issubset({"marketing", "sales"}), f"Found unexpected categories: {categories_found}"
def test_response_file_search_streaming_events(compat_client, text_model_id, vector_store_with_filtered_files):
"""Test that file search emits proper streaming events (in_progress, searching, completed)."""
tools = [
{
"type": "file_search",
"vector_store_ids": [vector_store_with_filtered_files.id],
}
]
stream = compat_client.responses.create(
model=text_model_id,
input="What are the marketing updates?",
tools=tools,
stream=True,
)
chunks = []
for chunk in stream:
chunks.append(chunk)
event_types = [chunk.type for chunk in chunks]
# Verify file search streaming events are present
file_search_in_progress = [chunk for chunk in chunks if chunk.type == "response.file_search_call.in_progress"]
file_search_searching = [chunk for chunk in chunks if chunk.type == "response.file_search_call.searching"]
file_search_completed = [chunk for chunk in chunks if chunk.type == "response.file_search_call.completed"]
assert len(file_search_in_progress) > 0, (
f"Expected response.file_search_call.in_progress events, got chunk types: {event_types}"
)
assert len(file_search_searching) > 0, (
f"Expected response.file_search_call.searching events, got chunk types: {event_types}"
)
assert len(file_search_completed) > 0, (
f"Expected response.file_search_call.completed events, got chunk types: {event_types}"
)
# Verify final response has file search call
final_chunk = chunks[-1]
if hasattr(final_chunk, "response"):
file_search_calls = [output for output in final_chunk.response.output if output.type == "file_search_call"]
assert len(file_search_calls) > 0, "Expected at least one file_search_call in final response"
assert file_search_calls[0].status == "completed"