openai 0.129.0 → 0.130.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b77f4f62985711f26b4a54609be4bebfbd40d33b5d3c523ff52a9c1ac6b30a97
4
- data.tar.gz: 0baa4839b42bd24166314eec4b4473e5b7494668e655328c47b9c0791fbbc8dd
3
+ metadata.gz: 3fba7a2c7f876ae814d8285709ca3c8f15dad5c7d6900e0be147650e4752e692
4
+ data.tar.gz: 9232801d1477a0a54d5fefca64383b2a020448fed338817dd43e6c7ee5a9f4eb
5
5
  SHA512:
6
- metadata.gz: 9b6fb5b1fc4e704ef4ce1e97482eac5fdc67dc96a411c74b46be4bbb856ec40e2792db4904a3fb22b6a6a998b5954a737e3ca9c626d233f557e04d81d0023ab4
7
- data.tar.gz: c9a9a1d8c924d3f43167d019e96325281c1aa68aade4cfc8fae2adef190c339dca1163edf69ea1716bc4c4d3d8a754403d09a1196a821e3502ddb91ff42f1d4f
6
+ metadata.gz: e252c4107d33b4afd812864970ee683823686b27249b2e111ded379b1c465b5632f7eb2bb481fbfb92fbdd0ee705c58ec642d3ca1347dbd31d0d1dffacaa94b0
7
+ data.tar.gz: 9cdf3ed4fe5cddb9a3a7c72c93a4730452ccb9e1cc886d873452a8a2bd7f88864bcadfe12073edc87fe39992b6ee0bf6ee6d7ebd144fcb2342e65373cc544921
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.130.0](https://github.com/openai/openai-ruby/compare/v0.129.0...v0.130.0) (2026-11-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** support Live WebRTC standby ([#1090](https://github.com/openai/openai-ruby/issues/1090)) ([ac0997c](https://github.com/openai/openai-ruby/commit/ac0997ca949572dbc6840ef1be4a0e989f4a5b13))
9
+
3
10
  ## [0.129.0](https://github.com/openai/openai-ruby/compare/v0.128.1...v0.129.0) (2026-11-19)
4
11
 
5
12
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.129.0"
18
+ gem "openai", "~> 0.130.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -19,6 +19,12 @@ module OpenAI
19
19
  # Returned when a Live session update is accepted. Contains the resolved session configuration after the update.
20
20
  variant :"session.updated", -> { OpenAI::Live::SessionUpdatedEvent }
21
21
 
22
+ # Sent when speech resumes paused inference and it is ready for audio in a Live WebRTC session. Delivered to the sideband and, when permitted by its event settings, the data channel.
23
+ variant :"session.resumed", -> { OpenAI::Live::ForkServerEvent::SessionResumed }
24
+
25
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC connection, sideband, and session ID persist. Delivered to the sideband and, when permitted by its event settings, the data channel.
26
+ variant :"session.paused", -> { OpenAI::Live::ForkServerEvent::SessionPaused }
27
+
22
28
  # Acknowledges a session.input_audio.mute command. An independent input mute sends silence to the model and preserves sideband audio reflection. Fixture playback does not emit this event.
23
29
  variant :"session.input_audio.muted", -> { OpenAI::Live::InputAudioMutedEvent }
24
30
 
@@ -97,6 +103,74 @@ module OpenAI
97
103
  # An asynchronous outbound SIP setup failure. Delivered only to sideband observers.
98
104
  variant :"transport.failed", -> { OpenAI::Live::ForkServerEvent::TransportFailed }
99
105
 
106
+ class SessionResumed < OpenAI::Internal::Type::BaseModel
107
+ # @!attribute event_id
108
+ # The unique ID of the Live server event.
109
+ #
110
+ # @return [String]
111
+ required :event_id, String
112
+
113
+ # @!attribute type
114
+ #
115
+ # @return [Symbol, :"session.resumed"]
116
+ required :type, const: :"session.resumed"
117
+
118
+ # @!attribute client_event_id
119
+ # The event_id of the client command associated with this server event, when
120
+ # supplied.
121
+ #
122
+ # @return [String, nil]
123
+ optional :client_event_id, String
124
+
125
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.resumed")
126
+ # Sent when speech resumes paused inference and it is ready for audio in a Live
127
+ # WebRTC session. Delivered to the sideband and, when permitted by its event
128
+ # settings, the data channel.
129
+ #
130
+ # @param event_id [String]
131
+ # The unique ID of the Live server event.
132
+ #
133
+ # @param client_event_id [String]
134
+ # The event_id of the client command associated with this server event, when
135
+ # supplied.
136
+ #
137
+ # @param type [Symbol, :"session.resumed"]
138
+ end
139
+
140
+ class SessionPaused < OpenAI::Internal::Type::BaseModel
141
+ # @!attribute event_id
142
+ # The unique ID of the Live server event.
143
+ #
144
+ # @return [String]
145
+ required :event_id, String
146
+
147
+ # @!attribute type
148
+ #
149
+ # @return [Symbol, :"session.paused"]
150
+ required :type, const: :"session.paused"
151
+
152
+ # @!attribute client_event_id
153
+ # The event_id of the client command associated with this server event, when
154
+ # supplied.
155
+ #
156
+ # @return [String, nil]
157
+ optional :client_event_id, String
158
+
159
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.paused")
160
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC
161
+ # connection, sideband, and session ID persist. Delivered to the sideband and,
162
+ # when permitted by its event settings, the data channel.
163
+ #
164
+ # @param event_id [String]
165
+ # The unique ID of the Live server event.
166
+ #
167
+ # @param client_event_id [String]
168
+ # The event_id of the client command associated with this server event, when
169
+ # supplied.
170
+ #
171
+ # @param type [Symbol, :"session.paused"]
172
+ end
173
+
100
174
  class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
101
175
  # @!attribute audio
102
176
  # Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
@@ -354,7 +428,7 @@ module OpenAI
354
428
  end
355
429
 
356
430
  # @!method self.variants
357
- # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::ForkServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::ForkServerEvent::TransportDtmfReceived, OpenAI::Models::Live::ForkServerEvent::TransportDtmfSend, OpenAI::Models::Live::ForkServerEvent::TransportDtmfSent, OpenAI::Models::Live::ForkServerEvent::TransportRinging, OpenAI::Models::Live::ForkServerEvent::TransportAnswered, OpenAI::Models::Live::ForkServerEvent::TransportFailed)]
431
+ # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::ForkServerEvent::SessionResumed, OpenAI::Models::Live::ForkServerEvent::SessionPaused, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::ForkServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::ForkServerEvent::TransportDtmfReceived, OpenAI::Models::Live::ForkServerEvent::TransportDtmfSend, OpenAI::Models::Live::ForkServerEvent::TransportDtmfSent, OpenAI::Models::Live::ForkServerEvent::TransportRinging, OpenAI::Models::Live::ForkServerEvent::TransportAnswered, OpenAI::Models::Live::ForkServerEvent::TransportFailed)]
358
432
  end
359
433
  end
360
434
  end
@@ -33,6 +33,14 @@ module OpenAI
33
33
  # @return [OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::MediaSessionConfig::Delegation::Responses, OpenAI::Models::Live::MediaSessionConfig::Delegation::Decisions, nil]
34
34
  optional :delegation, union: -> { OpenAI::Live::MediaSessionConfig::Delegation }, nil?: true
35
35
 
36
+ # @!attribute idle_timeout_s
37
+ # Whole seconds of inactivity after which a Live WebRTC session with a speech wake
38
+ # policy pauses inference. The connection and conversation history are retained.
39
+ # Omit to keep inference active until the session ends.
40
+ #
41
+ # @return [Integer, nil]
42
+ optional :idle_timeout_s, Integer
43
+
36
44
  # @!attribute input
37
45
  # Ordered text-only history supplied before startup. Supports developer, user, and
38
46
  # assistant messages with one text part each; at most 128 messages and a
@@ -76,7 +84,14 @@ module OpenAI
76
84
  # @return [Array<OpenAI::Models::Live::DecisionTrigger>, nil]
77
85
  optional :triggers, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger] }
78
86
 
79
- # @!method initialize(model:, audio: nil, client: nil, delegation: nil, input: nil, instructions: nil, safety_identifier: nil, store: nil, triggers: nil)
87
+ # @!attribute wake_policy
88
+ # Inference starts when the Live WebRTC session connects. After an idle pause,
89
+ # microphone speech resumes inference.
90
+ #
91
+ # @return [OpenAI::Models::Live::MediaSessionConfig::WakePolicy, nil]
92
+ optional :wake_policy, -> { OpenAI::Live::MediaSessionConfig::WakePolicy }
93
+
94
+ # @!method initialize(model:, audio: nil, client: nil, delegation: nil, idle_timeout_s: nil, input: nil, instructions: nil, safety_identifier: nil, store: nil, triggers: nil, wake_policy: nil)
80
95
  # Startup configuration for a Live media session. Follow the
81
96
  # [Live prompting guide](https://developers.openai.com/api/docs/guides/live-prompting)
82
97
  # when writing frontend instructions and the backend prompt under
@@ -99,6 +114,11 @@ module OpenAI
99
114
  # application; use `responses` or `decisions` to delegate to the corresponding
100
115
  # API.
101
116
  #
117
+ # @param idle_timeout_s [Integer]
118
+ # Whole seconds of inactivity after which a Live WebRTC session with a speech wake
119
+ # policy pauses inference. The connection and conversation history are retained.
120
+ # Omit to keep inference active until the session ends.
121
+ #
102
122
  # @param input [Array<OpenAI::Models::Live::InitialItem::Developer, OpenAI::Models::Live::InitialItem::User, OpenAI::Models::Live::InitialItem::Assistant>]
103
123
  # Ordered text-only history supplied before startup. Supports developer, user, and
104
124
  # assistant messages with one text part each; at most 128 messages and a
@@ -126,6 +146,10 @@ module OpenAI
126
146
  # independently of delegation. On update, omit triggers to keep the current
127
147
  # configuration, send a list to replace it, or send an empty list to disable
128
148
  # triggers.
149
+ #
150
+ # @param wake_policy [OpenAI::Models::Live::MediaSessionConfig::WakePolicy]
151
+ # Inference starts when the Live WebRTC session connects. After an idle pause,
152
+ # microphone speech resumes inference.
129
153
 
130
154
  # The Live model. Required in the session configuration for every transport; do
131
155
  # not pass it as a URL query parameter.
@@ -308,6 +332,35 @@ module OpenAI
308
332
  # @!method self.variants
309
333
  # @return [Array(OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::MediaSessionConfig::Delegation::Responses, OpenAI::Models::Live::MediaSessionConfig::Delegation::Decisions)]
310
334
  end
335
+
336
+ # @see OpenAI::Models::Live::MediaSessionConfig#wake_policy
337
+ class WakePolicy < OpenAI::Internal::Type::BaseModel
338
+ # @!attribute type
339
+ # The wake policy type, always `speech`.
340
+ #
341
+ # @return [Symbol, :speech]
342
+ required :type, const: :speech
343
+
344
+ # @!attribute vad_threshold
345
+ # The speech detection threshold for resuming paused inference, from 0 to 1
346
+ # inclusive. Defaults to 0.5. Higher values require stronger evidence of speech.
347
+ # This setting is independent of active turn detection.
348
+ #
349
+ # @return [Float, nil]
350
+ optional :vad_threshold, Float
351
+
352
+ # @!method initialize(vad_threshold: nil, type: :speech)
353
+ # Inference starts when the Live WebRTC session connects. After an idle pause,
354
+ # microphone speech resumes inference.
355
+ #
356
+ # @param vad_threshold [Float]
357
+ # The speech detection threshold for resuming paused inference, from 0 to 1
358
+ # inclusive. Defaults to 0.5. Higher values require stronger evidence of speech.
359
+ # This setting is independent of active turn detection.
360
+ #
361
+ # @param type [Symbol, :speech]
362
+ # The wake policy type, always `speech`.
363
+ end
311
364
  end
312
365
  end
313
366
  end
@@ -19,6 +19,12 @@ module OpenAI
19
19
  # Returned when a Live session update is accepted. Contains the resolved session configuration after the update.
20
20
  variant :"session.updated", -> { OpenAI::Live::SessionUpdatedEvent }
21
21
 
22
+ # Sent when speech resumes paused inference and it is ready for audio in a Live WebRTC session. Delivered to the sideband and, when permitted by its event settings, the data channel.
23
+ variant :"session.resumed", -> { OpenAI::Live::ServerEvent::SessionResumed }
24
+
25
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC connection, sideband, and session ID persist. Delivered to the sideband and, when permitted by its event settings, the data channel.
26
+ variant :"session.paused", -> { OpenAI::Live::ServerEvent::SessionPaused }
27
+
22
28
  # Acknowledges a session.input_audio.mute command. An independent input mute sends silence to the model and preserves sideband audio reflection. Fixture playback does not emit this event.
23
29
  variant :"session.input_audio.muted", -> { OpenAI::Live::InputAudioMutedEvent }
24
30
 
@@ -97,6 +103,74 @@ module OpenAI
97
103
  # An asynchronous outbound SIP setup failure. Delivered only to sideband observers.
98
104
  variant :"transport.failed", -> { OpenAI::Live::ServerEvent::TransportFailed }
99
105
 
106
+ class SessionResumed < OpenAI::Internal::Type::BaseModel
107
+ # @!attribute event_id
108
+ # The unique ID of the Live server event.
109
+ #
110
+ # @return [String]
111
+ required :event_id, String
112
+
113
+ # @!attribute type
114
+ #
115
+ # @return [Symbol, :"session.resumed"]
116
+ required :type, const: :"session.resumed"
117
+
118
+ # @!attribute client_event_id
119
+ # The event_id of the client command associated with this server event, when
120
+ # supplied.
121
+ #
122
+ # @return [String, nil]
123
+ optional :client_event_id, String
124
+
125
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.resumed")
126
+ # Sent when speech resumes paused inference and it is ready for audio in a Live
127
+ # WebRTC session. Delivered to the sideband and, when permitted by its event
128
+ # settings, the data channel.
129
+ #
130
+ # @param event_id [String]
131
+ # The unique ID of the Live server event.
132
+ #
133
+ # @param client_event_id [String]
134
+ # The event_id of the client command associated with this server event, when
135
+ # supplied.
136
+ #
137
+ # @param type [Symbol, :"session.resumed"]
138
+ end
139
+
140
+ class SessionPaused < OpenAI::Internal::Type::BaseModel
141
+ # @!attribute event_id
142
+ # The unique ID of the Live server event.
143
+ #
144
+ # @return [String]
145
+ required :event_id, String
146
+
147
+ # @!attribute type
148
+ #
149
+ # @return [Symbol, :"session.paused"]
150
+ required :type, const: :"session.paused"
151
+
152
+ # @!attribute client_event_id
153
+ # The event_id of the client command associated with this server event, when
154
+ # supplied.
155
+ #
156
+ # @return [String, nil]
157
+ optional :client_event_id, String
158
+
159
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.paused")
160
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC
161
+ # connection, sideband, and session ID persist. Delivered to the sideband and,
162
+ # when permitted by its event settings, the data channel.
163
+ #
164
+ # @param event_id [String]
165
+ # The unique ID of the Live server event.
166
+ #
167
+ # @param client_event_id [String]
168
+ # The event_id of the client command associated with this server event, when
169
+ # supplied.
170
+ #
171
+ # @param type [Symbol, :"session.paused"]
172
+ end
173
+
100
174
  class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
101
175
  # @!attribute audio
102
176
  # Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
@@ -354,7 +428,7 @@ module OpenAI
354
428
  end
355
429
 
356
430
  # @!method self.variants
357
- # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::ServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::ServerEvent::TransportDtmfReceived, OpenAI::Models::Live::ServerEvent::TransportDtmfSend, OpenAI::Models::Live::ServerEvent::TransportDtmfSent, OpenAI::Models::Live::ServerEvent::TransportRinging, OpenAI::Models::Live::ServerEvent::TransportAnswered, OpenAI::Models::Live::ServerEvent::TransportFailed)]
431
+ # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::ServerEvent::SessionResumed, OpenAI::Models::Live::ServerEvent::SessionPaused, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::ServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::ServerEvent::TransportDtmfReceived, OpenAI::Models::Live::ServerEvent::TransportDtmfSend, OpenAI::Models::Live::ServerEvent::TransportDtmfSent, OpenAI::Models::Live::ServerEvent::TransportRinging, OpenAI::Models::Live::ServerEvent::TransportAnswered, OpenAI::Models::Live::ServerEvent::TransportFailed)]
358
432
  end
359
433
  end
360
434
  end
@@ -5,19 +5,41 @@ module OpenAI
5
5
  module Live
6
6
  class SessionUsage < OpenAI::Internal::Type::BaseModel
7
7
  # @!attribute seconds
8
- # The cumulative Live audio duration in seconds. Do not sum this value across
9
- # usage events.
8
+ # The cumulative billable duration in whole seconds. When present, the active and
9
+ # paused breakdown adds up to this total.
10
10
  #
11
11
  # @return [Float]
12
12
  required :seconds, Float
13
13
 
14
- # @!method initialize(seconds:)
15
- # Cumulative audio duration for a Live session. Values are totals for the session,
16
- # not increments to sum across usage events.
14
+ # @!attribute active_seconds
15
+ # The remaining billable seconds attributed to active audio and any unused prepaid
16
+ # duration.
17
+ #
18
+ # @return [Integer, nil]
19
+ optional :active_seconds, Integer
20
+
21
+ # @!attribute paused_seconds
22
+ # Billable time attributed to paused inference at the configured rate, rounded
23
+ # down to whole seconds.
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :paused_seconds, Integer
27
+
28
+ # @!method initialize(seconds:, active_seconds: nil, paused_seconds: nil)
29
+ # Cumulative billable duration for a Live session. Eligible WebRTC sessions also
30
+ # report the active and paused breakdown. Do not sum values across usage events.
17
31
  #
18
32
  # @param seconds [Float]
19
- # The cumulative Live audio duration in seconds. Do not sum this value across
20
- # usage events.
33
+ # The cumulative billable duration in whole seconds. When present, the active and
34
+ # paused breakdown adds up to this total.
35
+ #
36
+ # @param active_seconds [Integer]
37
+ # The remaining billable seconds attributed to active audio and any unused prepaid
38
+ # duration.
39
+ #
40
+ # @param paused_seconds [Integer]
41
+ # Billable time attributed to paused inference at the configured rate, rounded
42
+ # down to whole seconds.
21
43
  end
22
44
  end
23
45
  end
@@ -16,6 +16,12 @@ module OpenAI
16
16
  # Returned when a Live session update is accepted. Contains the resolved session configuration after the update.
17
17
  variant :"session.updated", -> { OpenAI::Live::SessionUpdatedEvent }
18
18
 
19
+ # Sent when speech resumes paused inference and it is ready for audio in a Live WebRTC session. Delivered to the sideband and, when permitted by its event settings, the data channel.
20
+ variant :"session.resumed", -> { OpenAI::Live::SidebandServerEvent::SessionResumed }
21
+
22
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC connection, sideband, and session ID persist. Delivered to the sideband and, when permitted by its event settings, the data channel.
23
+ variant :"session.paused", -> { OpenAI::Live::SidebandServerEvent::SessionPaused }
24
+
19
25
  # Acknowledges a session.input_audio.mute command. An independent input mute sends silence to the model and preserves sideband audio reflection. Fixture playback does not emit this event.
20
26
  variant :"session.input_audio.muted", -> { OpenAI::Live::InputAudioMutedEvent }
21
27
 
@@ -94,6 +100,74 @@ module OpenAI
94
100
  # An asynchronous outbound SIP setup failure. Delivered only to sideband observers.
95
101
  variant :"transport.failed", -> { OpenAI::Live::SidebandServerEvent::TransportFailed }
96
102
 
103
+ class SessionResumed < OpenAI::Internal::Type::BaseModel
104
+ # @!attribute event_id
105
+ # The unique ID of the Live server event.
106
+ #
107
+ # @return [String]
108
+ required :event_id, String
109
+
110
+ # @!attribute type
111
+ #
112
+ # @return [Symbol, :"session.resumed"]
113
+ required :type, const: :"session.resumed"
114
+
115
+ # @!attribute client_event_id
116
+ # The event_id of the client command associated with this server event, when
117
+ # supplied.
118
+ #
119
+ # @return [String, nil]
120
+ optional :client_event_id, String
121
+
122
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.resumed")
123
+ # Sent when speech resumes paused inference and it is ready for audio in a Live
124
+ # WebRTC session. Delivered to the sideband and, when permitted by its event
125
+ # settings, the data channel.
126
+ #
127
+ # @param event_id [String]
128
+ # The unique ID of the Live server event.
129
+ #
130
+ # @param client_event_id [String]
131
+ # The event_id of the client command associated with this server event, when
132
+ # supplied.
133
+ #
134
+ # @param type [Symbol, :"session.resumed"]
135
+ end
136
+
137
+ class SessionPaused < OpenAI::Internal::Type::BaseModel
138
+ # @!attribute event_id
139
+ # The unique ID of the Live server event.
140
+ #
141
+ # @return [String]
142
+ required :event_id, String
143
+
144
+ # @!attribute type
145
+ #
146
+ # @return [Symbol, :"session.paused"]
147
+ required :type, const: :"session.paused"
148
+
149
+ # @!attribute client_event_id
150
+ # The event_id of the client command associated with this server event, when
151
+ # supplied.
152
+ #
153
+ # @return [String, nil]
154
+ optional :client_event_id, String
155
+
156
+ # @!method initialize(event_id:, client_event_id: nil, type: :"session.paused")
157
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC
158
+ # connection, sideband, and session ID persist. Delivered to the sideband and,
159
+ # when permitted by its event settings, the data channel.
160
+ #
161
+ # @param event_id [String]
162
+ # The unique ID of the Live server event.
163
+ #
164
+ # @param client_event_id [String]
165
+ # The event_id of the client command associated with this server event, when
166
+ # supplied.
167
+ #
168
+ # @param type [Symbol, :"session.paused"]
169
+ end
170
+
97
171
  class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
98
172
  # @!attribute audio
99
173
  # Base64-encoded raw mono PCM16LE at 24 kHz received from the primary transport,
@@ -351,7 +425,7 @@ module OpenAI
351
425
  end
352
426
 
353
427
  # @!method self.variants
354
- # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::SidebandServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfReceived, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfSend, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfSent, OpenAI::Models::Live::SidebandServerEvent::TransportRinging, OpenAI::Models::Live::SidebandServerEvent::TransportAnswered, OpenAI::Models::Live::SidebandServerEvent::TransportFailed)]
428
+ # @return [Array(OpenAI::Models::Live::SessionStartedEvent, OpenAI::Models::Live::SessionUpdatedEvent, OpenAI::Models::Live::SidebandServerEvent::SessionResumed, OpenAI::Models::Live::SidebandServerEvent::SessionPaused, OpenAI::Models::Live::InputAudioMutedEvent, OpenAI::Models::Live::InputAudioUnmutedEvent, OpenAI::Models::Live::OutputAudioFixturePlayingEvent, OpenAI::Models::Live::OutputAudioFixturePlayedEvent, OpenAI::Models::Live::InstructionsAppendedEvent, OpenAI::Models::Live::ThinkingAppendedEvent, OpenAI::Models::Live::CommentaryAppendedEvent, OpenAI::Models::Live::InputTranscriptDeltaEvent, OpenAI::Models::Live::OutputTranscriptDeltaEvent, OpenAI::Models::Live::DelegationCreatedEvent, OpenAI::Models::Live::DecisionEvent, OpenAI::Models::Live::DecisionItemCreatedEvent, OpenAI::Models::Live::DecisionItemDeletedEvent, OpenAI::Models::Live::ResponseEvent, OpenAI::Models::Live::SessionUsageUpdatedEvent, OpenAI::Models::Live::SessionClosedEvent, OpenAI::Models::Live::ErrorEvent, OpenAI::Models::Live::InfoEvent, OpenAI::Models::Live::SidebandServerEvent::SessionInputAudioAppend, OpenAI::Models::Live::OutputAudioDeltaEvent, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfReceived, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfSend, OpenAI::Models::Live::SidebandServerEvent::TransportDtmfSent, OpenAI::Models::Live::SidebandServerEvent::TransportRinging, OpenAI::Models::Live::SidebandServerEvent::TransportAnswered, OpenAI::Models::Live::SidebandServerEvent::TransportFailed)]
355
429
  end
356
430
  end
357
431
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.129.0"
4
+ VERSION = "0.130.0"
5
5
  end
@@ -17,6 +17,8 @@ module OpenAI
17
17
  T.any(
18
18
  OpenAI::Live::SessionStartedEvent,
19
19
  OpenAI::Live::SessionUpdatedEvent,
20
+ OpenAI::Live::ForkServerEvent::SessionResumed,
21
+ OpenAI::Live::ForkServerEvent::SessionPaused,
20
22
  OpenAI::Live::InputAudioMutedEvent,
21
23
  OpenAI::Live::InputAudioUnmutedEvent,
22
24
  OpenAI::Live::OutputAudioFixturePlayingEvent,
@@ -46,6 +48,126 @@ module OpenAI
46
48
  )
47
49
  end
48
50
 
51
+ class SessionResumed < OpenAI::Internal::Type::BaseModel
52
+ OrHash = T.type_alias do
53
+ T.any(
54
+ OpenAI::Live::ForkServerEvent::SessionResumed,
55
+ OpenAI::Internal::AnyHash
56
+ )
57
+ end
58
+
59
+ # The unique ID of the Live server event.
60
+ sig { returns(String) }
61
+ attr_accessor :event_id
62
+
63
+ sig { returns(Symbol) }
64
+ attr_accessor :type
65
+
66
+ # The event_id of the client command associated with this server event, when
67
+ # supplied.
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :client_event_id
70
+
71
+ sig { params(client_event_id: String).void }
72
+ attr_writer :client_event_id
73
+
74
+ # Sent when speech resumes paused inference and it is ready for audio in a Live
75
+ # WebRTC session. Delivered to the sideband and, when permitted by its event
76
+ # settings, the data channel.
77
+ sig do
78
+ params(
79
+
80
+ event_id: String,
81
+
82
+ client_event_id: String,
83
+
84
+ type: Symbol
85
+ )
86
+ .returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+
90
+ # The unique ID of the Live server event.
91
+ event_id:,
92
+
93
+ # The event_id of the client command associated with this server event, when
94
+ # supplied.
95
+ client_event_id: nil,
96
+
97
+ type: :"session.resumed"
98
+ )
99
+ end
100
+
101
+ sig do
102
+ override.returns(
103
+ {event_id: String, type: Symbol, client_event_id: T.nilable(String)}
104
+ )
105
+ end
106
+ def to_hash
107
+ end
108
+
109
+ end
110
+
111
+ class SessionPaused < OpenAI::Internal::Type::BaseModel
112
+ OrHash = T.type_alias do
113
+ T.any(
114
+ OpenAI::Live::ForkServerEvent::SessionPaused,
115
+ OpenAI::Internal::AnyHash
116
+ )
117
+ end
118
+
119
+ # The unique ID of the Live server event.
120
+ sig { returns(String) }
121
+ attr_accessor :event_id
122
+
123
+ sig { returns(Symbol) }
124
+ attr_accessor :type
125
+
126
+ # The event_id of the client command associated with this server event, when
127
+ # supplied.
128
+ sig { returns(T.nilable(String)) }
129
+ attr_reader :client_event_id
130
+
131
+ sig { params(client_event_id: String).void }
132
+ attr_writer :client_event_id
133
+
134
+ # Sent when the idle timeout pauses inference in a Live WebRTC session. The WebRTC
135
+ # connection, sideband, and session ID persist. Delivered to the sideband and,
136
+ # when permitted by its event settings, the data channel.
137
+ sig do
138
+ params(
139
+
140
+ event_id: String,
141
+
142
+ client_event_id: String,
143
+
144
+ type: Symbol
145
+ )
146
+ .returns(T.attached_class)
147
+ end
148
+ def self.new(
149
+
150
+ # The unique ID of the Live server event.
151
+ event_id:,
152
+
153
+ # The event_id of the client command associated with this server event, when
154
+ # supplied.
155
+ client_event_id: nil,
156
+
157
+ type: :"session.paused"
158
+ )
159
+ end
160
+
161
+ sig do
162
+ override.returns(
163
+ {event_id: String, type: Symbol, client_event_id: T.nilable(String)}
164
+ )
165
+ end
166
+ def to_hash
167
+ end
168
+
169
+ end
170
+
49
171
  class SessionInputAudioAppend < OpenAI::Internal::Type::BaseModel
50
172
  OrHash = T.type_alias do
51
173
  T.any(