openai 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/openai/models/realtime/client_secret_create_response.rb +6 -8
- data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +1 -1
- data/lib/openai/models/realtime/realtime_client_event.rb +2 -6
- data/lib/openai/models/realtime/{models.rb → realtime_function_tool.rb} +6 -6
- data/lib/openai/models/realtime/realtime_response_create_params.rb +4 -4
- data/lib/openai/models/realtime/realtime_server_event.rb +1 -8
- data/lib/openai/models/realtime/realtime_session.rb +3 -3
- data/lib/openai/models/realtime/realtime_session_create_request.rb +2 -2
- data/lib/openai/models/realtime/realtime_session_create_response.rb +21 -33
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +2 -2
- data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +117 -40
- data/lib/openai/models/realtime/transcription_session_updated_event.rb +152 -3
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +1 -4
- data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +2 -2
- data/rbi/openai/models/realtime/realtime_client_event.rbi +1 -2
- data/rbi/openai/models/realtime/{models.rbi → realtime_function_tool.rbi} +27 -9
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +5 -5
- data/rbi/openai/models/realtime/realtime_server_event.rbi +0 -2
- data/rbi/openai/models/realtime/realtime_session.rbi +10 -4
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +4 -4
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +29 -77
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +1 -1
- data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +290 -101
- data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +311 -4
- data/sig/openai/models/realtime/realtime_client_event.rbs +0 -1
- data/sig/openai/models/realtime/{models.rbs → realtime_function_tool.rbs} +9 -9
- data/sig/openai/models/realtime/realtime_response_create_params.rbs +1 -1
- data/sig/openai/models/realtime/realtime_server_event.rbs +0 -2
- data/sig/openai/models/realtime/realtime_session.rbs +6 -6
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +13 -31
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +1 -1
- data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +123 -35
- data/sig/openai/models/realtime/transcription_session_updated_event.rbs +118 -4
- metadata +5 -14
- data/lib/openai/models/realtime/realtime_transcription_session_client_secret.rb +0 -38
- data/lib/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rb +0 -66
- data/lib/openai/models/realtime/transcription_session_created.rb +0 -43
- data/rbi/openai/models/realtime/realtime_transcription_session_client_secret.rbi +0 -51
- data/rbi/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbi +0 -144
- data/rbi/openai/models/realtime/transcription_session_created.rbi +0 -79
- data/sig/openai/models/realtime/realtime_transcription_session_client_secret.rbs +0 -20
- data/sig/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbs +0 -59
- data/sig/openai/models/realtime/transcription_session_created.rbs +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c61159341c0fe919d9f1042f0c705f57d05fc656407e03498bdf1367f704b6ca
|
4
|
+
data.tar.gz: 26c9718404d8d1519acb3d9364f9918c623952679a0b29d11c159ebb070a6227
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5bebf2d7459cf64493d9ce74b839ad8c9326df50953ff064ecd9b5a912c077ebef0c0c38b6a95b40f01b7f37e161ed42be30d985e7b608ca76db18908da2d8d
|
7
|
+
data.tar.gz: 0a1fb39beb43b71336e7d0a398bbb56705c850de30f6eb110821b974967e21848d6cc5b626e57434df8bc247b4cd23f71f3c0b41ff425fe39b606ea44454fe2d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.23.1 (2025-09-10)
|
4
|
+
|
5
|
+
Full Changelog: [v0.23.0...v0.23.1](https://github.com/openai/openai-ruby/compare/v0.23.0...v0.23.1)
|
6
|
+
|
7
|
+
### Chores
|
8
|
+
|
9
|
+
* **api:** fix realtime GA types ([342f8d9](https://github.com/openai/openai-ruby/commit/342f8d9a4322cc1afba9aeabc1ff0fda5daec5c3))
|
10
|
+
|
3
11
|
## 0.23.0 (2025-09-08)
|
4
12
|
|
5
13
|
Full Changelog: [v0.22.1...v0.23.0](https://github.com/openai/openai-ruby/compare/v0.22.1...v0.23.0)
|
data/README.md
CHANGED
@@ -41,16 +41,14 @@ module OpenAI
|
|
41
41
|
module Session
|
42
42
|
extend OpenAI::Internal::Type::Union
|
43
43
|
|
44
|
+
discriminator :type
|
45
|
+
|
44
46
|
# A new Realtime session configuration, with an ephemeral key. Default TTL
|
45
47
|
# for keys is one minute.
|
46
|
-
variant -> { OpenAI::Realtime::RealtimeSessionCreateResponse }
|
47
|
-
|
48
|
-
# A
|
49
|
-
|
50
|
-
# When a session is created on the server via REST API, the session object
|
51
|
-
# also contains an ephemeral key. Default TTL for keys is 10 minutes. This
|
52
|
-
# property is not present when a session is updated via the WebSocket API.
|
53
|
-
variant -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse }
|
48
|
+
variant :realtime, -> { OpenAI::Realtime::RealtimeSessionCreateResponse }
|
49
|
+
|
50
|
+
# A Realtime transcription session configuration object.
|
51
|
+
variant :transcription, -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse }
|
54
52
|
|
55
53
|
# @!method self.variants
|
56
54
|
# @return [Array(OpenAI::Models::Realtime::RealtimeSessionCreateResponse, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse)]
|
@@ -22,7 +22,7 @@ module OpenAI
|
|
22
22
|
|
23
23
|
# @!attribute idle_timeout_ms
|
24
24
|
# Optional idle timeout after which turn detection will auto-timeout when no
|
25
|
-
# additional audio is received.
|
25
|
+
# additional audio is received and emits a `timeout_triggered` event.
|
26
26
|
#
|
27
27
|
# @return [Integer, nil]
|
28
28
|
optional :idle_timeout_ms, Integer, nil?: true
|
@@ -110,8 +110,7 @@ module OpenAI
|
|
110
110
|
|
111
111
|
# Send this event to update the session’s configuration.
|
112
112
|
# The client may send this event at any time to update any field
|
113
|
-
# except for `voice` and `model`. `voice` can be updated only if there have been no other
|
114
|
-
# audio outputs yet.
|
113
|
+
# except for `voice` and `model`. `voice` can be updated only if there have been no other audio outputs yet.
|
115
114
|
#
|
116
115
|
# When the server receives a `session.update`, it will respond
|
117
116
|
# with a `session.updated` event showing the full, effective configuration.
|
@@ -120,11 +119,8 @@ module OpenAI
|
|
120
119
|
# To clear a field like `turn_detection`, pass `null`.
|
121
120
|
variant :"session.update", -> { OpenAI::Realtime::SessionUpdateEvent }
|
122
121
|
|
123
|
-
# Send this event to update a transcription session.
|
124
|
-
variant :"transcription_session.update", -> { OpenAI::Realtime::TranscriptionSessionUpdate }
|
125
|
-
|
126
122
|
# @!method self.variants
|
127
|
-
# @return [Array(OpenAI::Models::Realtime::ConversationItemCreateEvent, OpenAI::Models::Realtime::ConversationItemDeleteEvent, OpenAI::Models::Realtime::ConversationItemRetrieveEvent, OpenAI::Models::Realtime::ConversationItemTruncateEvent, OpenAI::Models::Realtime::InputAudioBufferAppendEvent, OpenAI::Models::Realtime::InputAudioBufferClearEvent, OpenAI::Models::Realtime::OutputAudioBufferClearEvent, OpenAI::Models::Realtime::InputAudioBufferCommitEvent, OpenAI::Models::Realtime::ResponseCancelEvent, OpenAI::Models::Realtime::ResponseCreateEvent, OpenAI::Models::Realtime::SessionUpdateEvent
|
123
|
+
# @return [Array(OpenAI::Models::Realtime::ConversationItemCreateEvent, OpenAI::Models::Realtime::ConversationItemDeleteEvent, OpenAI::Models::Realtime::ConversationItemRetrieveEvent, OpenAI::Models::Realtime::ConversationItemTruncateEvent, OpenAI::Models::Realtime::InputAudioBufferAppendEvent, OpenAI::Models::Realtime::InputAudioBufferClearEvent, OpenAI::Models::Realtime::OutputAudioBufferClearEvent, OpenAI::Models::Realtime::InputAudioBufferCommitEvent, OpenAI::Models::Realtime::ResponseCancelEvent, OpenAI::Models::Realtime::ResponseCreateEvent, OpenAI::Models::Realtime::SessionUpdateEvent)]
|
128
124
|
end
|
129
125
|
end
|
130
126
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module OpenAI
|
4
4
|
module Models
|
5
5
|
module Realtime
|
6
|
-
class
|
6
|
+
class RealtimeFunctionTool < OpenAI::Internal::Type::BaseModel
|
7
7
|
# @!attribute description
|
8
8
|
# The description of the function, including guidance on when and how to call it,
|
9
9
|
# and guidance about what to tell the user when calling (if anything).
|
@@ -26,12 +26,12 @@ module OpenAI
|
|
26
26
|
# @!attribute type
|
27
27
|
# The type of the tool, i.e. `function`.
|
28
28
|
#
|
29
|
-
# @return [Symbol, OpenAI::Models::Realtime::
|
30
|
-
optional :type, enum: -> { OpenAI::Realtime::
|
29
|
+
# @return [Symbol, OpenAI::Models::Realtime::RealtimeFunctionTool::Type, nil]
|
30
|
+
optional :type, enum: -> { OpenAI::Realtime::RealtimeFunctionTool::Type }
|
31
31
|
|
32
32
|
# @!method initialize(description: nil, name: nil, parameters: nil, type: nil)
|
33
33
|
# Some parameter documentations has been truncated, see
|
34
|
-
# {OpenAI::Models::Realtime::
|
34
|
+
# {OpenAI::Models::Realtime::RealtimeFunctionTool} for more details.
|
35
35
|
#
|
36
36
|
# @param description [String] The description of the function, including guidance on when and how
|
37
37
|
#
|
@@ -39,11 +39,11 @@ module OpenAI
|
|
39
39
|
#
|
40
40
|
# @param parameters [Object] Parameters of the function in JSON Schema.
|
41
41
|
#
|
42
|
-
# @param type [Symbol, OpenAI::Models::Realtime::
|
42
|
+
# @param type [Symbol, OpenAI::Models::Realtime::RealtimeFunctionTool::Type] The type of the tool, i.e. `function`.
|
43
43
|
|
44
44
|
# The type of the tool, i.e. `function`.
|
45
45
|
#
|
46
|
-
# @see OpenAI::Models::Realtime::
|
46
|
+
# @see OpenAI::Models::Realtime::RealtimeFunctionTool#type
|
47
47
|
module Type
|
48
48
|
extend OpenAI::Internal::Type::Enum
|
49
49
|
|
@@ -90,7 +90,7 @@ module OpenAI
|
|
90
90
|
# @!attribute tools
|
91
91
|
# Tools available to the model.
|
92
92
|
#
|
93
|
-
# @return [Array<OpenAI::Models::Realtime::
|
93
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool>, nil]
|
94
94
|
optional :tools,
|
95
95
|
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeResponseCreateParams::Tool] }
|
96
96
|
|
@@ -118,7 +118,7 @@ module OpenAI
|
|
118
118
|
#
|
119
119
|
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
|
120
120
|
#
|
121
|
-
# @param tools [Array<OpenAI::Models::Realtime::
|
121
|
+
# @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool>] Tools available to the model.
|
122
122
|
|
123
123
|
# Controls which conversation the response is added to. Currently supports `auto`
|
124
124
|
# and `none`, with `auto` as the default value. The `auto` value means that the
|
@@ -210,14 +210,14 @@ module OpenAI
|
|
210
210
|
module Tool
|
211
211
|
extend OpenAI::Internal::Type::Union
|
212
212
|
|
213
|
-
variant -> { OpenAI::Realtime::
|
213
|
+
variant -> { OpenAI::Realtime::RealtimeFunctionTool }
|
214
214
|
|
215
215
|
# Give the model access to additional tools via remote Model Context Protocol
|
216
216
|
# (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
217
217
|
variant -> { OpenAI::Realtime::RealtimeResponseCreateMcpTool }
|
218
218
|
|
219
219
|
# @!method self.variants
|
220
|
-
# @return [Array(OpenAI::Models::Realtime::
|
220
|
+
# @return [Array(OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeResponseCreateMcpTool)]
|
221
221
|
end
|
222
222
|
end
|
223
223
|
end
|
@@ -173,13 +173,6 @@ module OpenAI
|
|
173
173
|
# there is an error.
|
174
174
|
variant :"session.updated", -> { OpenAI::Realtime::SessionUpdatedEvent }
|
175
175
|
|
176
|
-
# Returned when a transcription session is updated with a `transcription_session.update` event, unless
|
177
|
-
# there is an error.
|
178
|
-
variant :"transcription_session.updated", -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent }
|
179
|
-
|
180
|
-
# Returned when a transcription session is created.
|
181
|
-
variant :"transcription_session.created", -> { OpenAI::Realtime::TranscriptionSessionCreated }
|
182
|
-
|
183
176
|
# **WebRTC Only:** Emitted when the server begins streaming audio to the client. This event is
|
184
177
|
# emitted after an audio content part has been added (`response.content_part.added`)
|
185
178
|
# to the response.
|
@@ -378,7 +371,7 @@ module OpenAI
|
|
378
371
|
end
|
379
372
|
|
380
373
|
# @!method self.variants
|
381
|
-
# @return [Array(OpenAI::Models::Realtime::ConversationCreatedEvent, OpenAI::Models::Realtime::ConversationItemCreatedEvent, OpenAI::Models::Realtime::ConversationItemDeletedEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionDeltaEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent, OpenAI::Models::Realtime::RealtimeServerEvent::ConversationItemRetrieved, OpenAI::Models::Realtime::ConversationItemTruncatedEvent, OpenAI::Models::Realtime::RealtimeErrorEvent, OpenAI::Models::Realtime::InputAudioBufferClearedEvent, OpenAI::Models::Realtime::InputAudioBufferCommittedEvent, OpenAI::Models::Realtime::InputAudioBufferSpeechStartedEvent, OpenAI::Models::Realtime::InputAudioBufferSpeechStoppedEvent, OpenAI::Models::Realtime::RateLimitsUpdatedEvent, OpenAI::Models::Realtime::ResponseAudioDeltaEvent, OpenAI::Models::Realtime::ResponseAudioDoneEvent, OpenAI::Models::Realtime::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Realtime::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Realtime::ResponseContentPartAddedEvent, OpenAI::Models::Realtime::ResponseContentPartDoneEvent, OpenAI::Models::Realtime::ResponseCreatedEvent, OpenAI::Models::Realtime::ResponseDoneEvent, OpenAI::Models::Realtime::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Realtime::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Realtime::ResponseOutputItemAddedEvent, OpenAI::Models::Realtime::ResponseOutputItemDoneEvent, OpenAI::Models::Realtime::ResponseTextDeltaEvent, OpenAI::Models::Realtime::ResponseTextDoneEvent, OpenAI::Models::Realtime::SessionCreatedEvent, OpenAI::Models::Realtime::SessionUpdatedEvent, OpenAI::Models::Realtime::
|
374
|
+
# @return [Array(OpenAI::Models::Realtime::ConversationCreatedEvent, OpenAI::Models::Realtime::ConversationItemCreatedEvent, OpenAI::Models::Realtime::ConversationItemDeletedEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionDeltaEvent, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionFailedEvent, OpenAI::Models::Realtime::RealtimeServerEvent::ConversationItemRetrieved, OpenAI::Models::Realtime::ConversationItemTruncatedEvent, OpenAI::Models::Realtime::RealtimeErrorEvent, OpenAI::Models::Realtime::InputAudioBufferClearedEvent, OpenAI::Models::Realtime::InputAudioBufferCommittedEvent, OpenAI::Models::Realtime::InputAudioBufferSpeechStartedEvent, OpenAI::Models::Realtime::InputAudioBufferSpeechStoppedEvent, OpenAI::Models::Realtime::RateLimitsUpdatedEvent, OpenAI::Models::Realtime::ResponseAudioDeltaEvent, OpenAI::Models::Realtime::ResponseAudioDoneEvent, OpenAI::Models::Realtime::ResponseAudioTranscriptDeltaEvent, OpenAI::Models::Realtime::ResponseAudioTranscriptDoneEvent, OpenAI::Models::Realtime::ResponseContentPartAddedEvent, OpenAI::Models::Realtime::ResponseContentPartDoneEvent, OpenAI::Models::Realtime::ResponseCreatedEvent, OpenAI::Models::Realtime::ResponseDoneEvent, OpenAI::Models::Realtime::ResponseFunctionCallArgumentsDeltaEvent, OpenAI::Models::Realtime::ResponseFunctionCallArgumentsDoneEvent, OpenAI::Models::Realtime::ResponseOutputItemAddedEvent, OpenAI::Models::Realtime::ResponseOutputItemDoneEvent, OpenAI::Models::Realtime::ResponseTextDeltaEvent, OpenAI::Models::Realtime::ResponseTextDoneEvent, OpenAI::Models::Realtime::SessionCreatedEvent, OpenAI::Models::Realtime::SessionUpdatedEvent, OpenAI::Models::Realtime::RealtimeServerEvent::OutputAudioBufferStarted, OpenAI::Models::Realtime::RealtimeServerEvent::OutputAudioBufferStopped, OpenAI::Models::Realtime::RealtimeServerEvent::OutputAudioBufferCleared, OpenAI::Models::Realtime::ConversationItemAdded, OpenAI::Models::Realtime::ConversationItemDone, OpenAI::Models::Realtime::InputAudioBufferTimeoutTriggered, OpenAI::Models::Realtime::ConversationItemInputAudioTranscriptionSegment, OpenAI::Models::Realtime::McpListToolsInProgress, OpenAI::Models::Realtime::McpListToolsCompleted, OpenAI::Models::Realtime::McpListToolsFailed, OpenAI::Models::Realtime::ResponseMcpCallArgumentsDelta, OpenAI::Models::Realtime::ResponseMcpCallArgumentsDone, OpenAI::Models::Realtime::ResponseMcpCallInProgress, OpenAI::Models::Realtime::ResponseMcpCallCompleted, OpenAI::Models::Realtime::ResponseMcpCallFailed)]
|
382
375
|
end
|
383
376
|
end
|
384
377
|
end
|
@@ -142,8 +142,8 @@ module OpenAI
|
|
142
142
|
# @!attribute tools
|
143
143
|
# Tools (functions) available to the model.
|
144
144
|
#
|
145
|
-
# @return [Array<OpenAI::Models::Realtime::
|
146
|
-
optional :tools, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::
|
145
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeFunctionTool>, nil]
|
146
|
+
optional :tools, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Realtime::RealtimeFunctionTool] }
|
147
147
|
|
148
148
|
# @!attribute tracing
|
149
149
|
# Configuration options for tracing. Set to null to disable tracing. Once tracing
|
@@ -216,7 +216,7 @@ module OpenAI
|
|
216
216
|
#
|
217
217
|
# @param tool_choice [String] How the model chooses tools. Options are `auto`, `none`, `required`, or
|
218
218
|
#
|
219
|
-
# @param tools [Array<OpenAI::Models::Realtime::
|
219
|
+
# @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool>] Tools (functions) available to the model.
|
220
220
|
#
|
221
221
|
# @param tracing [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSession::Tracing::TracingConfiguration, nil] Configuration options for tracing. Set to null to disable tracing. Once
|
222
222
|
#
|
@@ -83,7 +83,7 @@ module OpenAI
|
|
83
83
|
# @!attribute tools
|
84
84
|
# Tools available to the model.
|
85
85
|
#
|
86
|
-
# @return [Array<OpenAI::Models::Realtime::
|
86
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp>, nil]
|
87
87
|
optional :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeToolsConfigUnion] }
|
88
88
|
|
89
89
|
# @!attribute tracing
|
@@ -126,7 +126,7 @@ module OpenAI
|
|
126
126
|
#
|
127
127
|
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
|
128
128
|
#
|
129
|
-
# @param tools [Array<OpenAI::Models::Realtime::
|
129
|
+
# @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp>] Tools available to the model.
|
130
130
|
#
|
131
131
|
# @param tracing [Symbol, :auto, OpenAI::Models::Realtime::RealtimeTracingConfig::TracingConfiguration, nil] Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces
|
132
132
|
#
|
@@ -4,18 +4,24 @@ module OpenAI
|
|
4
4
|
module Models
|
5
5
|
module Realtime
|
6
6
|
class RealtimeSessionCreateResponse < OpenAI::Internal::Type::BaseModel
|
7
|
+
# @!attribute client_secret
|
8
|
+
# Ephemeral key returned by the API.
|
9
|
+
#
|
10
|
+
# @return [OpenAI::Models::Realtime::RealtimeSessionClientSecret]
|
11
|
+
required :client_secret, -> { OpenAI::Realtime::RealtimeSessionClientSecret }
|
12
|
+
|
13
|
+
# @!attribute type
|
14
|
+
# The type of session to create. Always `realtime` for the Realtime API.
|
15
|
+
#
|
16
|
+
# @return [Symbol, :realtime]
|
17
|
+
required :type, const: :realtime
|
18
|
+
|
7
19
|
# @!attribute audio
|
8
20
|
# Configuration for input and output audio.
|
9
21
|
#
|
10
22
|
# @return [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio, nil]
|
11
23
|
optional :audio, -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Audio }
|
12
24
|
|
13
|
-
# @!attribute client_secret
|
14
|
-
# Ephemeral key returned by the API.
|
15
|
-
#
|
16
|
-
# @return [OpenAI::Models::Realtime::RealtimeSessionClientSecret, nil]
|
17
|
-
optional :client_secret, -> { OpenAI::Realtime::RealtimeSessionClientSecret }
|
18
|
-
|
19
25
|
# @!attribute include
|
20
26
|
# Additional fields to include in server outputs.
|
21
27
|
#
|
@@ -84,7 +90,7 @@ module OpenAI
|
|
84
90
|
# @!attribute tools
|
85
91
|
# Tools available to the model.
|
86
92
|
#
|
87
|
-
# @return [Array<OpenAI::Models::Realtime::
|
93
|
+
# @return [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool>, nil]
|
88
94
|
optional :tools,
|
89
95
|
-> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Realtime::RealtimeSessionCreateResponse::Tool] }
|
90
96
|
|
@@ -106,23 +112,17 @@ module OpenAI
|
|
106
112
|
# @return [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio, nil]
|
107
113
|
optional :truncation, union: -> { OpenAI::Realtime::RealtimeTruncation }
|
108
114
|
|
109
|
-
# @!
|
110
|
-
# The type of session to create. Always `realtime` for the Realtime API.
|
111
|
-
#
|
112
|
-
# @return [Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Type, nil]
|
113
|
-
optional :type, enum: -> { OpenAI::Realtime::RealtimeSessionCreateResponse::Type }
|
114
|
-
|
115
|
-
# @!method initialize(audio: nil, client_secret: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: nil)
|
115
|
+
# @!method initialize(client_secret:, audio: nil, include: nil, instructions: nil, max_output_tokens: nil, model: nil, output_modalities: nil, prompt: nil, tool_choice: nil, tools: nil, tracing: nil, truncation: nil, type: :realtime)
|
116
116
|
# Some parameter documentations has been truncated, see
|
117
117
|
# {OpenAI::Models::Realtime::RealtimeSessionCreateResponse} for more details.
|
118
118
|
#
|
119
119
|
# A new Realtime session configuration, with an ephemeral key. Default TTL for
|
120
120
|
# keys is one minute.
|
121
121
|
#
|
122
|
-
# @param audio [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio] Configuration for input and output audio.
|
123
|
-
#
|
124
122
|
# @param client_secret [OpenAI::Models::Realtime::RealtimeSessionClientSecret] Ephemeral key returned by the API.
|
125
123
|
#
|
124
|
+
# @param audio [OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio] Configuration for input and output audio.
|
125
|
+
#
|
126
126
|
# @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Include>] Additional fields to include in server outputs.
|
127
127
|
#
|
128
128
|
# @param instructions [String] The default system instructions (i.e. system message) prepended to model calls.
|
@@ -137,13 +137,13 @@ module OpenAI
|
|
137
137
|
#
|
138
138
|
# @param tool_choice [Symbol, OpenAI::Models::Responses::ToolChoiceOptions, OpenAI::Models::Responses::ToolChoiceFunction, OpenAI::Models::Responses::ToolChoiceMcp] How the model chooses tools. Provide one of the string modes or force a specific
|
139
139
|
#
|
140
|
-
# @param tools [Array<OpenAI::Models::Realtime::
|
140
|
+
# @param tools [Array<OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool>] Tools available to the model.
|
141
141
|
#
|
142
142
|
# @param tracing [Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration, nil] Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces
|
143
143
|
#
|
144
144
|
# @param truncation [Symbol, OpenAI::Models::Realtime::RealtimeTruncation::RealtimeTruncationStrategy, OpenAI::Models::Realtime::RealtimeTruncationRetentionRatio] Controls how the realtime conversation is truncated prior to model inference.
|
145
145
|
#
|
146
|
-
# @param type [Symbol,
|
146
|
+
# @param type [Symbol, :realtime] The type of session to create. Always `realtime` for the Realtime API.
|
147
147
|
|
148
148
|
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#audio
|
149
149
|
class Audio < OpenAI::Internal::Type::BaseModel
|
@@ -269,7 +269,7 @@ module OpenAI
|
|
269
269
|
|
270
270
|
# @!attribute idle_timeout_ms
|
271
271
|
# Optional idle timeout after which turn detection will auto-timeout when no
|
272
|
-
# additional audio is received.
|
272
|
+
# additional audio is received and emits a `timeout_triggered` event.
|
273
273
|
#
|
274
274
|
# @return [Integer, nil]
|
275
275
|
optional :idle_timeout_ms, Integer, nil?: true
|
@@ -586,7 +586,7 @@ module OpenAI
|
|
586
586
|
module Tool
|
587
587
|
extend OpenAI::Internal::Type::Union
|
588
588
|
|
589
|
-
variant -> { OpenAI::Realtime::
|
589
|
+
variant -> { OpenAI::Realtime::RealtimeFunctionTool }
|
590
590
|
|
591
591
|
# Give the model access to additional tools via remote Model Context Protocol
|
592
592
|
# (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
@@ -902,7 +902,7 @@ module OpenAI
|
|
902
902
|
end
|
903
903
|
|
904
904
|
# @!method self.variants
|
905
|
-
# @return [Array(OpenAI::Models::Realtime::
|
905
|
+
# @return [Array(OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tool::McpTool)]
|
906
906
|
end
|
907
907
|
|
908
908
|
# Realtime API can write session traces to the
|
@@ -961,18 +961,6 @@ module OpenAI
|
|
961
961
|
# @!method self.variants
|
962
962
|
# @return [Array(Symbol, :auto, OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Tracing::TracingConfiguration)]
|
963
963
|
end
|
964
|
-
|
965
|
-
# The type of session to create. Always `realtime` for the Realtime API.
|
966
|
-
#
|
967
|
-
# @see OpenAI::Models::Realtime::RealtimeSessionCreateResponse#type
|
968
|
-
module Type
|
969
|
-
extend OpenAI::Internal::Type::Enum
|
970
|
-
|
971
|
-
REALTIME = :realtime
|
972
|
-
|
973
|
-
# @!method self.values
|
974
|
-
# @return [Array<Symbol>]
|
975
|
-
end
|
976
964
|
end
|
977
965
|
end
|
978
966
|
|
@@ -11,7 +11,7 @@ module OpenAI
|
|
11
11
|
|
12
12
|
discriminator :type
|
13
13
|
|
14
|
-
variant :function, -> { OpenAI::Realtime::
|
14
|
+
variant :function, -> { OpenAI::Realtime::RealtimeFunctionTool }
|
15
15
|
|
16
16
|
# Give the model access to additional tools via remote Model Context Protocol
|
17
17
|
# (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
@@ -321,7 +321,7 @@ module OpenAI
|
|
321
321
|
end
|
322
322
|
|
323
323
|
# @!method self.variants
|
324
|
-
# @return [Array(OpenAI::Models::Realtime::
|
324
|
+
# @return [Array(OpenAI::Models::Realtime::RealtimeFunctionTool, OpenAI::Models::Realtime::RealtimeToolsConfigUnion::Mcp)]
|
325
325
|
end
|
326
326
|
end
|
327
327
|
end
|
@@ -4,68 +4,145 @@ module OpenAI
|
|
4
4
|
module Models
|
5
5
|
module Realtime
|
6
6
|
class RealtimeTranscriptionSessionCreateResponse < OpenAI::Internal::Type::BaseModel
|
7
|
-
# @!attribute
|
8
|
-
#
|
9
|
-
# the server via REST API.
|
7
|
+
# @!attribute id
|
8
|
+
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
10
9
|
#
|
11
|
-
# @return [
|
12
|
-
required :
|
10
|
+
# @return [String]
|
11
|
+
required :id, String
|
13
12
|
|
14
|
-
# @!attribute
|
15
|
-
# The
|
13
|
+
# @!attribute object
|
14
|
+
# The object type. Always `realtime.transcription_session`.
|
16
15
|
#
|
17
|
-
# @return [String
|
18
|
-
|
16
|
+
# @return [String]
|
17
|
+
required :object, String
|
19
18
|
|
20
|
-
# @!attribute
|
21
|
-
#
|
19
|
+
# @!attribute type
|
20
|
+
# The type of session. Always `transcription` for transcription sessions.
|
22
21
|
#
|
23
|
-
# @return [
|
24
|
-
|
25
|
-
-> { OpenAI::Realtime::RealtimeTranscriptionSessionInputAudioTranscription }
|
22
|
+
# @return [Symbol, :transcription]
|
23
|
+
required :type, const: :transcription
|
26
24
|
|
27
|
-
# @!attribute
|
28
|
-
#
|
29
|
-
# ["text"].
|
25
|
+
# @!attribute audio
|
26
|
+
# Configuration for input audio for the session.
|
30
27
|
#
|
31
|
-
# @return [
|
32
|
-
optional :
|
33
|
-
|
34
|
-
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
|
28
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio, nil]
|
29
|
+
optional :audio, -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio }
|
30
|
+
|
31
|
+
# @!attribute expires_at
|
32
|
+
# Expiration timestamp for the session, in seconds since epoch.
|
33
|
+
#
|
34
|
+
# @return [Integer, nil]
|
35
|
+
optional :expires_at, Integer
|
36
|
+
|
37
|
+
# @!attribute include
|
38
|
+
# Additional fields to include in server outputs.
|
39
|
+
#
|
40
|
+
# - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
41
|
+
# transcription.
|
39
42
|
#
|
40
|
-
# @return [OpenAI::Models::Realtime::
|
41
|
-
optional :
|
43
|
+
# @return [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Include>, nil]
|
44
|
+
optional :include,
|
45
|
+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::Include] }
|
42
46
|
|
43
|
-
# @!method initialize(
|
47
|
+
# @!method initialize(id:, object:, audio: nil, expires_at: nil, include: nil, type: :transcription)
|
44
48
|
# Some parameter documentations has been truncated, see
|
45
49
|
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse} for more
|
46
50
|
# details.
|
47
51
|
#
|
48
|
-
# A
|
52
|
+
# A Realtime transcription session configuration object.
|
49
53
|
#
|
50
|
-
#
|
51
|
-
# contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
|
52
|
-
# not present when a session is updated via the WebSocket API.
|
54
|
+
# @param id [String] Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
53
55
|
#
|
54
|
-
# @param
|
56
|
+
# @param object [String] The object type. Always `realtime.transcription_session`.
|
55
57
|
#
|
56
|
-
# @param
|
58
|
+
# @param audio [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio] Configuration for input audio for the session.
|
57
59
|
#
|
58
|
-
# @param
|
60
|
+
# @param expires_at [Integer] Expiration timestamp for the session, in seconds since epoch.
|
59
61
|
#
|
60
|
-
# @param
|
62
|
+
# @param include [Array<Symbol, OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Include>] Additional fields to include in server outputs.
|
61
63
|
#
|
62
|
-
# @param
|
64
|
+
# @param type [Symbol, :transcription] The type of session. Always `transcription` for transcription sessions.
|
65
|
+
|
66
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse#audio
|
67
|
+
class Audio < OpenAI::Internal::Type::BaseModel
|
68
|
+
# @!attribute input
|
69
|
+
#
|
70
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input, nil]
|
71
|
+
optional :input, -> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input }
|
72
|
+
|
73
|
+
# @!method initialize(input: nil)
|
74
|
+
# Configuration for input audio for the session.
|
75
|
+
#
|
76
|
+
# @param input [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input]
|
77
|
+
|
78
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio#input
|
79
|
+
class Input < OpenAI::Internal::Type::BaseModel
|
80
|
+
# @!attribute format_
|
81
|
+
# The PCM audio format. Only a 24kHz sample rate is supported.
|
82
|
+
#
|
83
|
+
# @return [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA, nil]
|
84
|
+
optional :format_, union: -> { OpenAI::Realtime::RealtimeAudioFormats }, api_name: :format
|
85
|
+
|
86
|
+
# @!attribute noise_reduction
|
87
|
+
# Configuration for input audio noise reduction.
|
88
|
+
#
|
89
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input::NoiseReduction, nil]
|
90
|
+
optional :noise_reduction,
|
91
|
+
-> { OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input::NoiseReduction }
|
92
|
+
|
93
|
+
# @!attribute transcription
|
94
|
+
# Configuration of the transcription model.
|
95
|
+
#
|
96
|
+
# @return [OpenAI::Models::Realtime::AudioTranscription, nil]
|
97
|
+
optional :transcription, -> { OpenAI::Realtime::AudioTranscription }
|
98
|
+
|
99
|
+
# @!attribute turn_detection
|
100
|
+
# Configuration for turn detection. Can be set to `null` to turn off. Server VAD
|
101
|
+
# means that the model will detect the start and end of speech based on audio
|
102
|
+
# volume and respond at the end of user speech.
|
103
|
+
#
|
104
|
+
# @return [OpenAI::Models::Realtime::RealtimeTranscriptionSessionTurnDetection, nil]
|
105
|
+
optional :turn_detection, -> { OpenAI::Realtime::RealtimeTranscriptionSessionTurnDetection }
|
106
|
+
|
107
|
+
# @!method initialize(format_: nil, noise_reduction: nil, transcription: nil, turn_detection: nil)
|
108
|
+
# Some parameter documentations has been truncated, see
|
109
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input}
|
110
|
+
# for more details.
|
111
|
+
#
|
112
|
+
# @param format_ [OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCM, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMU, OpenAI::Models::Realtime::RealtimeAudioFormats::AudioPCMA] The PCM audio format. Only a 24kHz sample rate is supported.
|
113
|
+
#
|
114
|
+
# @param noise_reduction [OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input::NoiseReduction] Configuration for input audio noise reduction.
|
115
|
+
#
|
116
|
+
# @param transcription [OpenAI::Models::Realtime::AudioTranscription] Configuration of the transcription model.
|
117
|
+
#
|
118
|
+
# @param turn_detection [OpenAI::Models::Realtime::RealtimeTranscriptionSessionTurnDetection] Configuration for turn detection. Can be set to `null` to turn off. Server
|
119
|
+
|
120
|
+
# @see OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input#noise_reduction
|
121
|
+
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
122
|
+
# @!attribute type
|
123
|
+
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
124
|
+
# headphones, `far_field` is for far-field microphones such as laptop or
|
125
|
+
# conference room microphones.
|
126
|
+
#
|
127
|
+
# @return [Symbol, OpenAI::Models::Realtime::NoiseReductionType, nil]
|
128
|
+
optional :type, enum: -> { OpenAI::Realtime::NoiseReductionType }
|
129
|
+
|
130
|
+
# @!method initialize(type: nil)
|
131
|
+
# Some parameter documentations has been truncated, see
|
132
|
+
# {OpenAI::Models::Realtime::RealtimeTranscriptionSessionCreateResponse::Audio::Input::NoiseReduction}
|
133
|
+
# for more details.
|
134
|
+
#
|
135
|
+
# Configuration for input audio noise reduction.
|
136
|
+
#
|
137
|
+
# @param type [Symbol, OpenAI::Models::Realtime::NoiseReductionType] Type of noise reduction. `near_field` is for close-talking microphones such as h
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
63
141
|
|
64
|
-
module
|
142
|
+
module Include
|
65
143
|
extend OpenAI::Internal::Type::Enum
|
66
144
|
|
67
|
-
|
68
|
-
AUDIO = :audio
|
145
|
+
ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = :"item.input_audio_transcription.logprobs"
|
69
146
|
|
70
147
|
# @!method self.values
|
71
148
|
# @return [Array<Symbol>]
|