From 915fea50dd1ffcd425609b2c75c819f7d8cb6c4f Mon Sep 17 00:00:00 2001 From: Kyle Finn Date: Fri, 18 Jul 2025 12:59:26 -0400 Subject: [PATCH 1/2] realtime.SessionUpdateEvent allow open ended model field this is consistent with voice field now and it allows more flexibilty between client and server versions --- src/openai/types/beta/realtime/session_update_event.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openai/types/beta/realtime/session_update_event.py b/src/openai/types/beta/realtime/session_update_event.py index 789b9cd1e5..6240763492 100644 --- a/src/openai/types/beta/realtime/session_update_event.py +++ b/src/openai/types/beta/realtime/session_update_event.py @@ -223,7 +223,8 @@ class Session(BaseModel): To disable audio, set this to ["text"]. """ - model: Optional[ + model: Union[ + str, Literal[ "gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-10-01", @@ -231,7 +232,8 @@ class Session(BaseModel): "gpt-4o-realtime-preview-2025-06-03", "gpt-4o-mini-realtime-preview", "gpt-4o-mini-realtime-preview-2024-12-17", - ] + ], + None ] = None """The Realtime model used for this session.""" From 9283eadb692f64b71fe5fadb47412d516299617f Mon Sep 17 00:00:00 2001 From: Kyle Finn Date: Fri, 18 Jul 2025 13:09:11 -0400 Subject: [PATCH 2/2] tyeps.realtime populate defaults for type field Makes it cleaner to programmatically construct events if needed The type fields were previously required to construct, but only accepted one possible value, so it was unneeded verbosity Done with automated find/replace in realtime folder: type: Literal\["([\w\.]+)"\] type: Literal["$1"] = "$1" --- .../types/beta/realtime/conversation_created_event.py | 2 +- .../types/beta/realtime/conversation_item_create_event.py | 2 +- .../beta/realtime/conversation_item_created_event.py | 2 +- .../types/beta/realtime/conversation_item_delete_event.py | 2 +- .../beta/realtime/conversation_item_deleted_event.py | 2 +- ...tion_item_input_audio_transcription_completed_event.py | 6 +++--- ...ersation_item_input_audio_transcription_delta_event.py | 2 +- ...rsation_item_input_audio_transcription_failed_event.py | 2 +- .../beta/realtime/conversation_item_retrieve_event.py | 2 +- .../beta/realtime/conversation_item_truncate_event.py | 2 +- .../beta/realtime/conversation_item_truncated_event.py | 2 +- src/openai/types/beta/realtime/error_event.py | 2 +- .../beta/realtime/input_audio_buffer_append_event.py | 2 +- .../types/beta/realtime/input_audio_buffer_clear_event.py | 2 +- .../beta/realtime/input_audio_buffer_cleared_event.py | 2 +- .../beta/realtime/input_audio_buffer_commit_event.py | 2 +- .../beta/realtime/input_audio_buffer_committed_event.py | 2 +- .../realtime/input_audio_buffer_speech_started_event.py | 2 +- .../realtime/input_audio_buffer_speech_stopped_event.py | 2 +- .../types/beta/realtime/rate_limits_updated_event.py | 2 +- src/openai/types/beta/realtime/realtime_client_event.py | 2 +- src/openai/types/beta/realtime/realtime_server_event.py | 8 ++++---- .../types/beta/realtime/response_audio_delta_event.py | 2 +- .../types/beta/realtime/response_audio_done_event.py | 2 +- .../realtime/response_audio_transcript_delta_event.py | 2 +- .../beta/realtime/response_audio_transcript_done_event.py | 2 +- src/openai/types/beta/realtime/response_cancel_event.py | 2 +- .../beta/realtime/response_content_part_added_event.py | 2 +- .../beta/realtime/response_content_part_done_event.py | 2 +- src/openai/types/beta/realtime/response_create_event.py | 2 +- .../types/beta/realtime/response_create_event_param.py | 2 +- src/openai/types/beta/realtime/response_created_event.py | 2 +- src/openai/types/beta/realtime/response_done_event.py | 2 +- .../response_function_call_arguments_delta_event.py | 2 +- .../response_function_call_arguments_done_event.py | 2 +- .../beta/realtime/response_output_item_added_event.py | 2 +- .../beta/realtime/response_output_item_done_event.py | 2 +- .../types/beta/realtime/response_text_delta_event.py | 2 +- .../types/beta/realtime/response_text_done_event.py | 2 +- src/openai/types/beta/realtime/session_create_params.py | 2 +- src/openai/types/beta/realtime/session_created_event.py | 2 +- src/openai/types/beta/realtime/session_update_event.py | 2 +- .../types/beta/realtime/session_update_event_param.py | 2 +- src/openai/types/beta/realtime/session_updated_event.py | 2 +- .../types/beta/realtime/transcription_session_update.py | 2 +- .../beta/realtime/transcription_session_updated_event.py | 2 +- 46 files changed, 51 insertions(+), 51 deletions(-) diff --git a/src/openai/types/beta/realtime/conversation_created_event.py b/src/openai/types/beta/realtime/conversation_created_event.py index 4ba0540867..267cc98168 100644 --- a/src/openai/types/beta/realtime/conversation_created_event.py +++ b/src/openai/types/beta/realtime/conversation_created_event.py @@ -23,5 +23,5 @@ class ConversationCreatedEvent(BaseModel): event_id: str """The unique ID of the server event.""" - type: Literal["conversation.created"] + type: Literal["conversation.created"] = "conversation.created" """The event type, must be `conversation.created`.""" diff --git a/src/openai/types/beta/realtime/conversation_item_create_event.py b/src/openai/types/beta/realtime/conversation_item_create_event.py index f19d552a92..c24fb366db 100644 --- a/src/openai/types/beta/realtime/conversation_item_create_event.py +++ b/src/openai/types/beta/realtime/conversation_item_create_event.py @@ -13,7 +13,7 @@ class ConversationItemCreateEvent(BaseModel): item: ConversationItem """The item to add to the conversation.""" - type: Literal["conversation.item.create"] + type: Literal["conversation.item.create"] = "conversation.item.create" """The event type, must be `conversation.item.create`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/conversation_item_created_event.py b/src/openai/types/beta/realtime/conversation_item_created_event.py index aea7ad5b4b..fcf6f4919a 100644 --- a/src/openai/types/beta/realtime/conversation_item_created_event.py +++ b/src/openai/types/beta/realtime/conversation_item_created_event.py @@ -16,7 +16,7 @@ class ConversationItemCreatedEvent(BaseModel): item: ConversationItem """The item to add to the conversation.""" - type: Literal["conversation.item.created"] + type: Literal["conversation.item.created"] = "conversation.item.created" """The event type, must be `conversation.item.created`.""" previous_item_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/conversation_item_delete_event.py b/src/openai/types/beta/realtime/conversation_item_delete_event.py index 02ca8250ce..26323c3c35 100644 --- a/src/openai/types/beta/realtime/conversation_item_delete_event.py +++ b/src/openai/types/beta/realtime/conversation_item_delete_event.py @@ -12,7 +12,7 @@ class ConversationItemDeleteEvent(BaseModel): item_id: str """The ID of the item to delete.""" - type: Literal["conversation.item.delete"] + type: Literal["conversation.item.delete"] = "conversation.item.delete" """The event type, must be `conversation.item.delete`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/conversation_item_deleted_event.py b/src/openai/types/beta/realtime/conversation_item_deleted_event.py index a35a97817a..36e4bf6f5f 100644 --- a/src/openai/types/beta/realtime/conversation_item_deleted_event.py +++ b/src/openai/types/beta/realtime/conversation_item_deleted_event.py @@ -14,5 +14,5 @@ class ConversationItemDeletedEvent(BaseModel): item_id: str """The ID of the item that was deleted.""" - type: Literal["conversation.item.deleted"] + type: Literal["conversation.item.deleted"] = "conversation.item.deleted" """The event type, must be `conversation.item.deleted`.""" diff --git a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py index e7c457d4b2..9898b45bed 100644 --- a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py +++ b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_completed_event.py @@ -33,7 +33,7 @@ class UsageTranscriptTextUsageTokens(BaseModel): total_tokens: int """Total number of tokens used (input + output).""" - type: Literal["tokens"] + type: Literal["tokens"] = "tokens" """The type of the usage object. Always `tokens` for this variant.""" input_token_details: Optional[UsageTranscriptTextUsageTokensInputTokenDetails] = None @@ -44,7 +44,7 @@ class UsageTranscriptTextUsageDuration(BaseModel): seconds: float """Duration of the input audio in seconds.""" - type: Literal["duration"] + type: Literal["duration"] = "duration" """The type of the usage object. Always `duration` for this variant.""" @@ -75,7 +75,7 @@ class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel): transcript: str """The transcribed text.""" - type: Literal["conversation.item.input_audio_transcription.completed"] + type: Literal["conversation.item.input_audio_transcription.completed"] = "conversation.item.input_audio_transcription.completed" """ The event type, must be `conversation.item.input_audio_transcription.completed`. """ diff --git a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py index 924d06d98a..0e936f64d6 100644 --- a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py +++ b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_delta_event.py @@ -26,7 +26,7 @@ class ConversationItemInputAudioTranscriptionDeltaEvent(BaseModel): item_id: str """The ID of the item.""" - type: Literal["conversation.item.input_audio_transcription.delta"] + type: Literal["conversation.item.input_audio_transcription.delta"] = "conversation.item.input_audio_transcription.delta" """The event type, must be `conversation.item.input_audio_transcription.delta`.""" content_index: Optional[int] = None diff --git a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py index cecac93e64..675590d394 100644 --- a/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py +++ b/src/openai/types/beta/realtime/conversation_item_input_audio_transcription_failed_event.py @@ -35,5 +35,5 @@ class ConversationItemInputAudioTranscriptionFailedEvent(BaseModel): item_id: str """The ID of the user message item.""" - type: Literal["conversation.item.input_audio_transcription.failed"] + type: Literal["conversation.item.input_audio_transcription.failed"] = "conversation.item.input_audio_transcription.failed" """The event type, must be `conversation.item.input_audio_transcription.failed`.""" diff --git a/src/openai/types/beta/realtime/conversation_item_retrieve_event.py b/src/openai/types/beta/realtime/conversation_item_retrieve_event.py index 822386055c..3544b07a15 100644 --- a/src/openai/types/beta/realtime/conversation_item_retrieve_event.py +++ b/src/openai/types/beta/realtime/conversation_item_retrieve_event.py @@ -12,7 +12,7 @@ class ConversationItemRetrieveEvent(BaseModel): item_id: str """The ID of the item to retrieve.""" - type: Literal["conversation.item.retrieve"] + type: Literal["conversation.item.retrieve"] = "conversation.item.retrieve" """The event type, must be `conversation.item.retrieve`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/conversation_item_truncate_event.py b/src/openai/types/beta/realtime/conversation_item_truncate_event.py index cb336bba2c..979586c25c 100644 --- a/src/openai/types/beta/realtime/conversation_item_truncate_event.py +++ b/src/openai/types/beta/realtime/conversation_item_truncate_event.py @@ -25,7 +25,7 @@ class ConversationItemTruncateEvent(BaseModel): Only assistant message items can be truncated. """ - type: Literal["conversation.item.truncate"] + type: Literal["conversation.item.truncate"] = "conversation.item.truncate" """The event type, must be `conversation.item.truncate`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/conversation_item_truncated_event.py b/src/openai/types/beta/realtime/conversation_item_truncated_event.py index 36368fa28f..cb6e7a3d29 100644 --- a/src/openai/types/beta/realtime/conversation_item_truncated_event.py +++ b/src/openai/types/beta/realtime/conversation_item_truncated_event.py @@ -20,5 +20,5 @@ class ConversationItemTruncatedEvent(BaseModel): item_id: str """The ID of the assistant message item that was truncated.""" - type: Literal["conversation.item.truncated"] + type: Literal["conversation.item.truncated"] = "conversation.item.truncated" """The event type, must be `conversation.item.truncated`.""" diff --git a/src/openai/types/beta/realtime/error_event.py b/src/openai/types/beta/realtime/error_event.py index e020fc3848..5f9a667cf6 100644 --- a/src/openai/types/beta/realtime/error_event.py +++ b/src/openai/types/beta/realtime/error_event.py @@ -32,5 +32,5 @@ class ErrorEvent(BaseModel): event_id: str """The unique ID of the server event.""" - type: Literal["error"] + type: Literal["error"] = "error" """The event type, must be `error`.""" diff --git a/src/openai/types/beta/realtime/input_audio_buffer_append_event.py b/src/openai/types/beta/realtime/input_audio_buffer_append_event.py index a253a6488c..b2ca31e0a6 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_append_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_append_event.py @@ -16,7 +16,7 @@ class InputAudioBufferAppendEvent(BaseModel): session configuration. """ - type: Literal["input_audio_buffer.append"] + type: Literal["input_audio_buffer.append"] = "input_audio_buffer.append" """The event type, must be `input_audio_buffer.append`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/input_audio_buffer_clear_event.py b/src/openai/types/beta/realtime/input_audio_buffer_clear_event.py index b0624d34df..000a852930 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_clear_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_clear_event.py @@ -9,7 +9,7 @@ class InputAudioBufferClearEvent(BaseModel): - type: Literal["input_audio_buffer.clear"] + type: Literal["input_audio_buffer.clear"] = "input_audio_buffer.clear" """The event type, must be `input_audio_buffer.clear`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/input_audio_buffer_cleared_event.py b/src/openai/types/beta/realtime/input_audio_buffer_cleared_event.py index 632e1b94bc..c56683df8a 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_cleared_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_cleared_event.py @@ -11,5 +11,5 @@ class InputAudioBufferClearedEvent(BaseModel): event_id: str """The unique ID of the server event.""" - type: Literal["input_audio_buffer.cleared"] + type: Literal["input_audio_buffer.cleared"] = "input_audio_buffer.cleared" """The event type, must be `input_audio_buffer.cleared`.""" diff --git a/src/openai/types/beta/realtime/input_audio_buffer_commit_event.py b/src/openai/types/beta/realtime/input_audio_buffer_commit_event.py index 7b6f5e46b7..486f2a095f 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_commit_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_commit_event.py @@ -9,7 +9,7 @@ class InputAudioBufferCommitEvent(BaseModel): - type: Literal["input_audio_buffer.commit"] + type: Literal["input_audio_buffer.commit"] = "input_audio_buffer.commit" """The event type, must be `input_audio_buffer.commit`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/input_audio_buffer_committed_event.py b/src/openai/types/beta/realtime/input_audio_buffer_committed_event.py index 22eb53b117..29dbfd3749 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_committed_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_committed_event.py @@ -15,7 +15,7 @@ class InputAudioBufferCommittedEvent(BaseModel): item_id: str """The ID of the user message item that will be created.""" - type: Literal["input_audio_buffer.committed"] + type: Literal["input_audio_buffer.committed"] = "input_audio_buffer.committed" """The event type, must be `input_audio_buffer.committed`.""" previous_item_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py b/src/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py index 4f3ab082c4..6ee41e6be4 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_speech_started_event.py @@ -22,5 +22,5 @@ class InputAudioBufferSpeechStartedEvent(BaseModel): item_id: str """The ID of the user message item that will be created when speech stops.""" - type: Literal["input_audio_buffer.speech_started"] + type: Literal["input_audio_buffer.speech_started"] = "input_audio_buffer.speech_started" """The event type, must be `input_audio_buffer.speech_started`.""" diff --git a/src/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py b/src/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py index 40568170f2..944eafacc2 100644 --- a/src/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py +++ b/src/openai/types/beta/realtime/input_audio_buffer_speech_stopped_event.py @@ -21,5 +21,5 @@ class InputAudioBufferSpeechStoppedEvent(BaseModel): item_id: str """The ID of the user message item that will be created.""" - type: Literal["input_audio_buffer.speech_stopped"] + type: Literal["input_audio_buffer.speech_stopped"] = "input_audio_buffer.speech_stopped" """The event type, must be `input_audio_buffer.speech_stopped`.""" diff --git a/src/openai/types/beta/realtime/rate_limits_updated_event.py b/src/openai/types/beta/realtime/rate_limits_updated_event.py index 7e12283c46..dd11437fc2 100644 --- a/src/openai/types/beta/realtime/rate_limits_updated_event.py +++ b/src/openai/types/beta/realtime/rate_limits_updated_event.py @@ -29,5 +29,5 @@ class RateLimitsUpdatedEvent(BaseModel): rate_limits: List[RateLimit] """List of rate limit information.""" - type: Literal["rate_limits.updated"] + type: Literal["rate_limits.updated"] = "rate_limits.updated" """The event type, must be `rate_limits.updated`.""" diff --git a/src/openai/types/beta/realtime/realtime_client_event.py b/src/openai/types/beta/realtime/realtime_client_event.py index 5f4858d688..9d2cc7f6a2 100644 --- a/src/openai/types/beta/realtime/realtime_client_event.py +++ b/src/openai/types/beta/realtime/realtime_client_event.py @@ -21,7 +21,7 @@ class OutputAudioBufferClear(BaseModel): - type: Literal["output_audio_buffer.clear"] + type: Literal["output_audio_buffer.clear"] = "output_audio_buffer.clear" """The event type, must be `output_audio_buffer.clear`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/realtime_server_event.py b/src/openai/types/beta/realtime/realtime_server_event.py index c12f5df977..973bcd4311 100644 --- a/src/openai/types/beta/realtime/realtime_server_event.py +++ b/src/openai/types/beta/realtime/realtime_server_event.py @@ -55,7 +55,7 @@ class ConversationItemRetrieved(BaseModel): item: ConversationItem """The item to add to the conversation.""" - type: Literal["conversation.item.retrieved"] + type: Literal["conversation.item.retrieved"] = "conversation.item.retrieved" """The event type, must be `conversation.item.retrieved`.""" @@ -66,7 +66,7 @@ class OutputAudioBufferStarted(BaseModel): response_id: str """The unique ID of the response that produced the audio.""" - type: Literal["output_audio_buffer.started"] + type: Literal["output_audio_buffer.started"] = "output_audio_buffer.started" """The event type, must be `output_audio_buffer.started`.""" @@ -77,7 +77,7 @@ class OutputAudioBufferStopped(BaseModel): response_id: str """The unique ID of the response that produced the audio.""" - type: Literal["output_audio_buffer.stopped"] + type: Literal["output_audio_buffer.stopped"] = "output_audio_buffer.stopped" """The event type, must be `output_audio_buffer.stopped`.""" @@ -88,7 +88,7 @@ class OutputAudioBufferCleared(BaseModel): response_id: str """The unique ID of the response that produced the audio.""" - type: Literal["output_audio_buffer.cleared"] + type: Literal["output_audio_buffer.cleared"] = "output_audio_buffer.cleared" """The event type, must be `output_audio_buffer.cleared`.""" diff --git a/src/openai/types/beta/realtime/response_audio_delta_event.py b/src/openai/types/beta/realtime/response_audio_delta_event.py index 8e0128d942..c0b210dfad 100644 --- a/src/openai/types/beta/realtime/response_audio_delta_event.py +++ b/src/openai/types/beta/realtime/response_audio_delta_event.py @@ -26,5 +26,5 @@ class ResponseAudioDeltaEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.audio.delta"] + type: Literal["response.audio.delta"] = "response.audio.delta" """The event type, must be `response.audio.delta`.""" diff --git a/src/openai/types/beta/realtime/response_audio_done_event.py b/src/openai/types/beta/realtime/response_audio_done_event.py index 68e78bc778..2010458ba2 100644 --- a/src/openai/types/beta/realtime/response_audio_done_event.py +++ b/src/openai/types/beta/realtime/response_audio_done_event.py @@ -23,5 +23,5 @@ class ResponseAudioDoneEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.audio.done"] + type: Literal["response.audio.done"] = "response.audio.done" """The event type, must be `response.audio.done`.""" diff --git a/src/openai/types/beta/realtime/response_audio_transcript_delta_event.py b/src/openai/types/beta/realtime/response_audio_transcript_delta_event.py index 3609948d10..659899cf03 100644 --- a/src/openai/types/beta/realtime/response_audio_transcript_delta_event.py +++ b/src/openai/types/beta/realtime/response_audio_transcript_delta_event.py @@ -26,5 +26,5 @@ class ResponseAudioTranscriptDeltaEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.audio_transcript.delta"] + type: Literal["response.audio_transcript.delta"] = "response.audio_transcript.delta" """The event type, must be `response.audio_transcript.delta`.""" diff --git a/src/openai/types/beta/realtime/response_audio_transcript_done_event.py b/src/openai/types/beta/realtime/response_audio_transcript_done_event.py index 4e4436a95f..b34a68a7b6 100644 --- a/src/openai/types/beta/realtime/response_audio_transcript_done_event.py +++ b/src/openai/types/beta/realtime/response_audio_transcript_done_event.py @@ -26,5 +26,5 @@ class ResponseAudioTranscriptDoneEvent(BaseModel): transcript: str """The final transcript of the audio.""" - type: Literal["response.audio_transcript.done"] + type: Literal["response.audio_transcript.done"] = "response.audio_transcript.done" """The event type, must be `response.audio_transcript.done`.""" diff --git a/src/openai/types/beta/realtime/response_cancel_event.py b/src/openai/types/beta/realtime/response_cancel_event.py index c5ff991e9a..697f812555 100644 --- a/src/openai/types/beta/realtime/response_cancel_event.py +++ b/src/openai/types/beta/realtime/response_cancel_event.py @@ -9,7 +9,7 @@ class ResponseCancelEvent(BaseModel): - type: Literal["response.cancel"] + type: Literal["response.cancel"] = "response.cancel" """The event type, must be `response.cancel`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/response_content_part_added_event.py b/src/openai/types/beta/realtime/response_content_part_added_event.py index 45c8f20f97..290f8b5ab6 100644 --- a/src/openai/types/beta/realtime/response_content_part_added_event.py +++ b/src/openai/types/beta/realtime/response_content_part_added_event.py @@ -41,5 +41,5 @@ class ResponseContentPartAddedEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.content_part.added"] + type: Literal["response.content_part.added"] = "response.content_part.added" """The event type, must be `response.content_part.added`.""" diff --git a/src/openai/types/beta/realtime/response_content_part_done_event.py b/src/openai/types/beta/realtime/response_content_part_done_event.py index 3d16116106..a04c134f0e 100644 --- a/src/openai/types/beta/realtime/response_content_part_done_event.py +++ b/src/openai/types/beta/realtime/response_content_part_done_event.py @@ -41,5 +41,5 @@ class ResponseContentPartDoneEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.content_part.done"] + type: Literal["response.content_part.done"] = "response.content_part.done" """The event type, must be `response.content_part.done`.""" diff --git a/src/openai/types/beta/realtime/response_create_event.py b/src/openai/types/beta/realtime/response_create_event.py index 3b8a6de8df..bedac7bab6 100644 --- a/src/openai/types/beta/realtime/response_create_event.py +++ b/src/openai/types/beta/realtime/response_create_event.py @@ -115,7 +115,7 @@ class Response(BaseModel): class ResponseCreateEvent(BaseModel): - type: Literal["response.create"] + type: Literal["response.create"] = "response.create" """The event type, must be `response.create`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/response_create_event_param.py b/src/openai/types/beta/realtime/response_create_event_param.py index c569d507a0..be694c633b 100644 --- a/src/openai/types/beta/realtime/response_create_event_param.py +++ b/src/openai/types/beta/realtime/response_create_event_param.py @@ -24,7 +24,7 @@ class ResponseTool(TypedDict, total=False): parameters: object """Parameters of the function in JSON Schema.""" - type: Literal["function"] + type: Literal["function"] = "function" """The type of the tool, i.e. `function`.""" diff --git a/src/openai/types/beta/realtime/response_created_event.py b/src/openai/types/beta/realtime/response_created_event.py index a4990cf095..ec4abe646c 100644 --- a/src/openai/types/beta/realtime/response_created_event.py +++ b/src/openai/types/beta/realtime/response_created_event.py @@ -15,5 +15,5 @@ class ResponseCreatedEvent(BaseModel): response: RealtimeResponse """The response resource.""" - type: Literal["response.created"] + type: Literal["response.created"] = "response.created" """The event type, must be `response.created`.""" diff --git a/src/openai/types/beta/realtime/response_done_event.py b/src/openai/types/beta/realtime/response_done_event.py index 9e655184b6..5c8099bc41 100644 --- a/src/openai/types/beta/realtime/response_done_event.py +++ b/src/openai/types/beta/realtime/response_done_event.py @@ -15,5 +15,5 @@ class ResponseDoneEvent(BaseModel): response: RealtimeResponse """The response resource.""" - type: Literal["response.done"] + type: Literal["response.done"] = "response.done" """The event type, must be `response.done`.""" diff --git a/src/openai/types/beta/realtime/response_function_call_arguments_delta_event.py b/src/openai/types/beta/realtime/response_function_call_arguments_delta_event.py index cdbb64e658..46af2a4042 100644 --- a/src/openai/types/beta/realtime/response_function_call_arguments_delta_event.py +++ b/src/openai/types/beta/realtime/response_function_call_arguments_delta_event.py @@ -26,5 +26,5 @@ class ResponseFunctionCallArgumentsDeltaEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.function_call_arguments.delta"] + type: Literal["response.function_call_arguments.delta"] = "response.function_call_arguments.delta" """The event type, must be `response.function_call_arguments.delta`.""" diff --git a/src/openai/types/beta/realtime/response_function_call_arguments_done_event.py b/src/openai/types/beta/realtime/response_function_call_arguments_done_event.py index 0a5db53323..d3262b18ca 100644 --- a/src/openai/types/beta/realtime/response_function_call_arguments_done_event.py +++ b/src/openai/types/beta/realtime/response_function_call_arguments_done_event.py @@ -26,5 +26,5 @@ class ResponseFunctionCallArgumentsDoneEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.function_call_arguments.done"] + type: Literal["response.function_call_arguments.done"] = "response.function_call_arguments.done" """The event type, must be `response.function_call_arguments.done`.""" diff --git a/src/openai/types/beta/realtime/response_output_item_added_event.py b/src/openai/types/beta/realtime/response_output_item_added_event.py index c89bfdc3be..45d283fdc3 100644 --- a/src/openai/types/beta/realtime/response_output_item_added_event.py +++ b/src/openai/types/beta/realtime/response_output_item_added_event.py @@ -21,5 +21,5 @@ class ResponseOutputItemAddedEvent(BaseModel): response_id: str """The ID of the Response to which the item belongs.""" - type: Literal["response.output_item.added"] + type: Literal["response.output_item.added"] = "response.output_item.added" """The event type, must be `response.output_item.added`.""" diff --git a/src/openai/types/beta/realtime/response_output_item_done_event.py b/src/openai/types/beta/realtime/response_output_item_done_event.py index b5910e22aa..aeeb0ae359 100644 --- a/src/openai/types/beta/realtime/response_output_item_done_event.py +++ b/src/openai/types/beta/realtime/response_output_item_done_event.py @@ -21,5 +21,5 @@ class ResponseOutputItemDoneEvent(BaseModel): response_id: str """The ID of the Response to which the item belongs.""" - type: Literal["response.output_item.done"] + type: Literal["response.output_item.done"] = "response.output_item.done" """The event type, must be `response.output_item.done`.""" diff --git a/src/openai/types/beta/realtime/response_text_delta_event.py b/src/openai/types/beta/realtime/response_text_delta_event.py index c463b3c3d0..4348f6aa81 100644 --- a/src/openai/types/beta/realtime/response_text_delta_event.py +++ b/src/openai/types/beta/realtime/response_text_delta_event.py @@ -26,5 +26,5 @@ class ResponseTextDeltaEvent(BaseModel): response_id: str """The ID of the response.""" - type: Literal["response.text.delta"] + type: Literal["response.text.delta"] = "response.text.delta" """The event type, must be `response.text.delta`.""" diff --git a/src/openai/types/beta/realtime/response_text_done_event.py b/src/openai/types/beta/realtime/response_text_done_event.py index 020ff41d58..9e4006654d 100644 --- a/src/openai/types/beta/realtime/response_text_done_event.py +++ b/src/openai/types/beta/realtime/response_text_done_event.py @@ -26,5 +26,5 @@ class ResponseTextDoneEvent(BaseModel): text: str """The final text content.""" - type: Literal["response.text.done"] + type: Literal["response.text.done"] = "response.text.done" """The event type, must be `response.text.done`.""" diff --git a/src/openai/types/beta/realtime/session_create_params.py b/src/openai/types/beta/realtime/session_create_params.py index e04985d2b6..4ad8d6acd3 100644 --- a/src/openai/types/beta/realtime/session_create_params.py +++ b/src/openai/types/beta/realtime/session_create_params.py @@ -222,7 +222,7 @@ class Tool(TypedDict, total=False): parameters: object """Parameters of the function in JSON Schema.""" - type: Literal["function"] + type: Literal["function"] = "function" """The type of the tool, i.e. `function`.""" diff --git a/src/openai/types/beta/realtime/session_created_event.py b/src/openai/types/beta/realtime/session_created_event.py index baf6af388b..5bb454514b 100644 --- a/src/openai/types/beta/realtime/session_created_event.py +++ b/src/openai/types/beta/realtime/session_created_event.py @@ -15,5 +15,5 @@ class SessionCreatedEvent(BaseModel): session: Session """Realtime session object configuration.""" - type: Literal["session.created"] + type: Literal["session.created"] = "session.created" """The event type, must be `session.created`.""" diff --git a/src/openai/types/beta/realtime/session_update_event.py b/src/openai/types/beta/realtime/session_update_event.py index 6240763492..52bde92a7e 100644 --- a/src/openai/types/beta/realtime/session_update_event.py +++ b/src/openai/types/beta/realtime/session_update_event.py @@ -309,7 +309,7 @@ class SessionUpdateEvent(BaseModel): session: Session """Realtime session object configuration.""" - type: Literal["session.update"] + type: Literal["session.update"] = "session.update" """The event type, must be `session.update`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/session_update_event_param.py b/src/openai/types/beta/realtime/session_update_event_param.py index 2dfa2c26f3..6b5a3871eb 100644 --- a/src/openai/types/beta/realtime/session_update_event_param.py +++ b/src/openai/types/beta/realtime/session_update_event_param.py @@ -85,7 +85,7 @@ class SessionTool(TypedDict, total=False): parameters: object """Parameters of the function in JSON Schema.""" - type: Literal["function"] + type: Literal["function"] = "function" """The type of the tool, i.e. `function`.""" diff --git a/src/openai/types/beta/realtime/session_updated_event.py b/src/openai/types/beta/realtime/session_updated_event.py index b9b6488eb3..036aaf19ce 100644 --- a/src/openai/types/beta/realtime/session_updated_event.py +++ b/src/openai/types/beta/realtime/session_updated_event.py @@ -15,5 +15,5 @@ class SessionUpdatedEvent(BaseModel): session: Session """Realtime session object configuration.""" - type: Literal["session.updated"] + type: Literal["session.updated"] = "session.updated" """The event type, must be `session.updated`.""" diff --git a/src/openai/types/beta/realtime/transcription_session_update.py b/src/openai/types/beta/realtime/transcription_session_update.py index 73253b6848..de2383abd0 100644 --- a/src/openai/types/beta/realtime/transcription_session_update.py +++ b/src/openai/types/beta/realtime/transcription_session_update.py @@ -178,7 +178,7 @@ class TranscriptionSessionUpdate(BaseModel): session: Session """Realtime transcription session object configuration.""" - type: Literal["transcription_session.update"] + type: Literal["transcription_session.update"] = "transcription_session.update" """The event type, must be `transcription_session.update`.""" event_id: Optional[str] = None diff --git a/src/openai/types/beta/realtime/transcription_session_updated_event.py b/src/openai/types/beta/realtime/transcription_session_updated_event.py index 1f1fbdae14..4a5851f6df 100644 --- a/src/openai/types/beta/realtime/transcription_session_updated_event.py +++ b/src/openai/types/beta/realtime/transcription_session_updated_event.py @@ -20,5 +20,5 @@ class TranscriptionSessionUpdatedEvent(BaseModel): not present when a session is updated via the WebSocket API. """ - type: Literal["transcription_session.updated"] + type: Literal["transcription_session.updated"] = "transcription_session.updated" """The event type, must be `transcription_session.updated`."""