openai 0.72.0 → 0.73.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/openai/models/audio/transcription.rb +10 -1
- data/lib/openai/models/audio/transcription_create_params.rb +24 -5
- data/lib/openai/models/audio/transcription_language.rb +20 -0
- data/lib/openai/models/audio/transcription_text_done_event.rb +10 -1
- data/lib/openai/models/audio_model.rb +1 -0
- data/lib/openai/models/realtime/audio_transcription.rb +35 -8
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +10 -1
- data/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +121 -0
- data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +6 -3
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -2
- data/lib/openai/resources/audio/transcriptions.rb +12 -4
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +2 -0
- data/rbi/openai/models/audio/transcription.rbi +19 -0
- data/rbi/openai/models/audio/transcription_create_params.rbi +31 -3
- data/rbi/openai/models/audio/transcription_language.rbi +33 -0
- data/rbi/openai/models/audio/transcription_text_done_event.rbi +19 -0
- data/rbi/openai/models/audio_model.rbi +2 -0
- data/rbi/openai/models/realtime/audio_transcription.rbi +50 -9
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +19 -0
- data/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +7 -3
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
- data/rbi/openai/resources/audio/transcriptions.rbi +20 -2
- data/rbi/openai/resources/webhooks.rbi +1 -0
- data/sig/openai/models/audio/transcription.rbs +9 -0
- data/sig/openai/models/audio/transcription_create_params.rbs +14 -0
- data/sig/openai/models/audio/transcription_language.rbs +15 -0
- data/sig/openai/models/audio/transcription_text_done_event.rbs +9 -0
- data/sig/openai/models/audio_model.rbs +2 -0
- data/sig/openai/models/realtime/audio_transcription.rbs +18 -0
- data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +9 -0
- data/sig/openai/models/webhooks/live_call_incoming_webhook_event.rbs +90 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
- data/sig/openai/resources/audio/transcriptions.rbs +4 -0
- data/sig/openai/resources/webhooks.rbs +1 -0
- metadata +8 -2
|
@@ -13,6 +13,20 @@ module OpenAI
|
|
|
13
13
|
sig { returns(String) }
|
|
14
14
|
attr_accessor :text
|
|
15
15
|
|
|
16
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
17
|
+
# array indicates that no language could be reliably detected.
|
|
18
|
+
sig do
|
|
19
|
+
returns(T.nilable(T::Array[OpenAI::Audio::TranscriptionLanguage]))
|
|
20
|
+
end
|
|
21
|
+
attr_reader :languages
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash]
|
|
26
|
+
).void
|
|
27
|
+
end
|
|
28
|
+
attr_writer :languages
|
|
29
|
+
|
|
16
30
|
# The log probabilities of the tokens in the transcription. Only returned with the
|
|
17
31
|
# models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added
|
|
18
32
|
# to the `include` array.
|
|
@@ -50,6 +64,7 @@ module OpenAI
|
|
|
50
64
|
sig do
|
|
51
65
|
params(
|
|
52
66
|
text: String,
|
|
67
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash],
|
|
53
68
|
logprobs: T::Array[OpenAI::Audio::Transcription::Logprob::OrHash],
|
|
54
69
|
usage:
|
|
55
70
|
T.any(
|
|
@@ -61,6 +76,9 @@ module OpenAI
|
|
|
61
76
|
def self.new(
|
|
62
77
|
# The transcribed text.
|
|
63
78
|
text:,
|
|
79
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
80
|
+
# array indicates that no language could be reliably detected.
|
|
81
|
+
languages: nil,
|
|
64
82
|
# The log probabilities of the tokens in the transcription. Only returned with the
|
|
65
83
|
# models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added
|
|
66
84
|
# to the `include` array.
|
|
@@ -74,6 +92,7 @@ module OpenAI
|
|
|
74
92
|
override.returns(
|
|
75
93
|
{
|
|
76
94
|
text: String,
|
|
95
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage],
|
|
77
96
|
logprobs: T::Array[OpenAI::Audio::Transcription::Logprob],
|
|
78
97
|
usage: OpenAI::Audio::Transcription::Usage::Variants
|
|
79
98
|
}
|
|
@@ -20,7 +20,7 @@ module OpenAI
|
|
|
20
20
|
sig { returns(OpenAI::Internal::FileInput) }
|
|
21
21
|
attr_accessor :file
|
|
22
22
|
|
|
23
|
-
# ID of the model to use. The options are `gpt-4o-transcribe`,
|
|
23
|
+
# ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
|
|
24
24
|
# `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
|
|
25
25
|
# (which is powered by our open source Whisper V2 model), and
|
|
26
26
|
# `gpt-4o-transcribe-diarize`.
|
|
@@ -65,6 +65,14 @@ module OpenAI
|
|
|
65
65
|
end
|
|
66
66
|
attr_writer :include
|
|
67
67
|
|
|
68
|
+
# Words or phrases to guide transcription of the input audio. Supported by
|
|
69
|
+
# `gpt-transcribe`.
|
|
70
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
71
|
+
attr_reader :keywords
|
|
72
|
+
|
|
73
|
+
sig { params(keywords: T::Array[String]).void }
|
|
74
|
+
attr_writer :keywords
|
|
75
|
+
|
|
68
76
|
# Optional list of speaker names that correspond to the audio samples provided in
|
|
69
77
|
# `known_speaker_references[]`. Each entry should be a short identifier (for
|
|
70
78
|
# example `customer` or `agent`). Up to 4 speakers are supported.
|
|
@@ -94,6 +102,15 @@ module OpenAI
|
|
|
94
102
|
sig { params(language: String).void }
|
|
95
103
|
attr_writer :language
|
|
96
104
|
|
|
105
|
+
# Possible languages of the input audio, in
|
|
106
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
107
|
+
# Supported by `gpt-transcribe`.
|
|
108
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
109
|
+
attr_reader :languages
|
|
110
|
+
|
|
111
|
+
sig { params(languages: T::Array[String]).void }
|
|
112
|
+
attr_writer :languages
|
|
113
|
+
|
|
97
114
|
# An optional text to guide the model's style or continue a previous audio
|
|
98
115
|
# segment. The
|
|
99
116
|
# [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
@@ -168,9 +185,11 @@ module OpenAI
|
|
|
168
185
|
)
|
|
169
186
|
),
|
|
170
187
|
include: T::Array[OpenAI::Audio::TranscriptionInclude::OrSymbol],
|
|
188
|
+
keywords: T::Array[String],
|
|
171
189
|
known_speaker_names: T::Array[String],
|
|
172
190
|
known_speaker_references: T::Array[String],
|
|
173
191
|
language: String,
|
|
192
|
+
languages: T::Array[String],
|
|
174
193
|
prompt: String,
|
|
175
194
|
response_format: OpenAI::AudioResponseFormat::OrSymbol,
|
|
176
195
|
temperature: Float,
|
|
@@ -185,7 +204,7 @@ module OpenAI
|
|
|
185
204
|
# The audio file object (not file name) to transcribe, in one of these formats:
|
|
186
205
|
# flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
|
|
187
206
|
file:,
|
|
188
|
-
# ID of the model to use. The options are `gpt-4o-transcribe`,
|
|
207
|
+
# ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
|
|
189
208
|
# `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
|
|
190
209
|
# (which is powered by our open source Whisper V2 model), and
|
|
191
210
|
# `gpt-4o-transcribe-diarize`.
|
|
@@ -204,6 +223,9 @@ module OpenAI
|
|
|
204
223
|
# `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is
|
|
205
224
|
# not supported when using `gpt-4o-transcribe-diarize`.
|
|
206
225
|
include: nil,
|
|
226
|
+
# Words or phrases to guide transcription of the input audio. Supported by
|
|
227
|
+
# `gpt-transcribe`.
|
|
228
|
+
keywords: nil,
|
|
207
229
|
# Optional list of speaker names that correspond to the audio samples provided in
|
|
208
230
|
# `known_speaker_references[]`. Each entry should be a short identifier (for
|
|
209
231
|
# example `customer` or `agent`). Up to 4 speakers are supported.
|
|
@@ -218,6 +240,10 @@ module OpenAI
|
|
|
218
240
|
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
219
241
|
# format will improve accuracy and latency.
|
|
220
242
|
language: nil,
|
|
243
|
+
# Possible languages of the input audio, in
|
|
244
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
245
|
+
# Supported by `gpt-transcribe`.
|
|
246
|
+
languages: nil,
|
|
221
247
|
# An optional text to guide the model's style or continue a previous audio
|
|
222
248
|
# segment. The
|
|
223
249
|
# [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
@@ -260,9 +286,11 @@ module OpenAI
|
|
|
260
286
|
)
|
|
261
287
|
),
|
|
262
288
|
include: T::Array[OpenAI::Audio::TranscriptionInclude::OrSymbol],
|
|
289
|
+
keywords: T::Array[String],
|
|
263
290
|
known_speaker_names: T::Array[String],
|
|
264
291
|
known_speaker_references: T::Array[String],
|
|
265
292
|
language: String,
|
|
293
|
+
languages: T::Array[String],
|
|
266
294
|
prompt: String,
|
|
267
295
|
response_format: OpenAI::AudioResponseFormat::OrSymbol,
|
|
268
296
|
temperature: Float,
|
|
@@ -277,7 +305,7 @@ module OpenAI
|
|
|
277
305
|
def to_hash
|
|
278
306
|
end
|
|
279
307
|
|
|
280
|
-
# ID of the model to use. The options are `gpt-4o-transcribe`,
|
|
308
|
+
# ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
|
|
281
309
|
# `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
|
|
282
310
|
# (which is powered by our open source Whisper V2 model), and
|
|
283
311
|
# `gpt-4o-transcribe-diarize`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Audio
|
|
6
|
+
class TranscriptionLanguage < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
OpenAI::Audio::TranscriptionLanguage,
|
|
11
|
+
OpenAI::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The code of a language detected in the audio.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :code
|
|
18
|
+
|
|
19
|
+
# A language detected in transcribed audio.
|
|
20
|
+
sig { params(code: String).returns(T.attached_class) }
|
|
21
|
+
def self.new(
|
|
22
|
+
# The code of a language detected in the audio.
|
|
23
|
+
code:
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
sig { override.returns({ code: String }) }
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -20,6 +20,20 @@ module OpenAI
|
|
|
20
20
|
sig { returns(Symbol) }
|
|
21
21
|
attr_accessor :type
|
|
22
22
|
|
|
23
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
24
|
+
# array indicates that no language could be reliably detected.
|
|
25
|
+
sig do
|
|
26
|
+
returns(T.nilable(T::Array[OpenAI::Audio::TranscriptionLanguage]))
|
|
27
|
+
end
|
|
28
|
+
attr_reader :languages
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash]
|
|
33
|
+
).void
|
|
34
|
+
end
|
|
35
|
+
attr_writer :languages
|
|
36
|
+
|
|
23
37
|
# The log probabilities of the individual tokens in the transcription. Only
|
|
24
38
|
# included if you
|
|
25
39
|
# [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription)
|
|
@@ -63,6 +77,7 @@ module OpenAI
|
|
|
63
77
|
sig do
|
|
64
78
|
params(
|
|
65
79
|
text: String,
|
|
80
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash],
|
|
66
81
|
logprobs:
|
|
67
82
|
T::Array[
|
|
68
83
|
OpenAI::Audio::TranscriptionTextDoneEvent::Logprob::OrHash
|
|
@@ -74,6 +89,9 @@ module OpenAI
|
|
|
74
89
|
def self.new(
|
|
75
90
|
# The text that was transcribed.
|
|
76
91
|
text:,
|
|
92
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
93
|
+
# array indicates that no language could be reliably detected.
|
|
94
|
+
languages: nil,
|
|
77
95
|
# The log probabilities of the individual tokens in the transcription. Only
|
|
78
96
|
# included if you
|
|
79
97
|
# [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription)
|
|
@@ -91,6 +109,7 @@ module OpenAI
|
|
|
91
109
|
{
|
|
92
110
|
text: String,
|
|
93
111
|
type: Symbol,
|
|
112
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage],
|
|
94
113
|
logprobs:
|
|
95
114
|
T::Array[OpenAI::Audio::TranscriptionTextDoneEvent::Logprob],
|
|
96
115
|
usage: OpenAI::Audio::TranscriptionTextDoneEvent::Usage
|
|
@@ -9,6 +9,8 @@ module OpenAI
|
|
|
9
9
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
10
10
|
|
|
11
11
|
WHISPER_1 = T.let(:"whisper-1", OpenAI::AudioModel::TaggedSymbol)
|
|
12
|
+
GPT_TRANSCRIBE =
|
|
13
|
+
T.let(:"gpt-transcribe", OpenAI::AudioModel::TaggedSymbol)
|
|
12
14
|
GPT_4O_TRANSCRIBE =
|
|
13
15
|
T.let(:"gpt-4o-transcribe", OpenAI::AudioModel::TaggedSymbol)
|
|
14
16
|
GPT_4O_MINI_TRANSCRIBE =
|
|
@@ -29,6 +29,14 @@ module OpenAI
|
|
|
29
29
|
end
|
|
30
30
|
attr_writer :delay
|
|
31
31
|
|
|
32
|
+
# Words or phrases to guide transcription of the input audio. Supported by
|
|
33
|
+
# `gpt-transcribe` and `gpt-live-transcribe`.
|
|
34
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
35
|
+
attr_reader :keywords
|
|
36
|
+
|
|
37
|
+
sig { params(keywords: T::Array[String]).void }
|
|
38
|
+
attr_writer :keywords
|
|
39
|
+
|
|
32
40
|
# The language of the input audio. Supplying the input language in
|
|
33
41
|
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
34
42
|
# format will improve accuracy and latency.
|
|
@@ -38,10 +46,20 @@ module OpenAI
|
|
|
38
46
|
sig { params(language: String).void }
|
|
39
47
|
attr_writer :language
|
|
40
48
|
|
|
49
|
+
# Possible languages of the input audio, in
|
|
50
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
51
|
+
# Supported by `gpt-transcribe` and `gpt-live-transcribe`.
|
|
52
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
53
|
+
attr_reader :languages
|
|
54
|
+
|
|
55
|
+
sig { params(languages: T::Array[String]).void }
|
|
56
|
+
attr_writer :languages
|
|
57
|
+
|
|
41
58
|
# The model to use for transcription. Current options are `whisper-1`,
|
|
42
|
-
# `gpt-
|
|
43
|
-
# `gpt-4o-transcribe`, `gpt-4o-transcribe
|
|
44
|
-
#
|
|
59
|
+
# `gpt-transcribe`, `gpt-live-transcribe`, `gpt-4o-mini-transcribe`,
|
|
60
|
+
# `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`,
|
|
61
|
+
# `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use
|
|
62
|
+
# `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
|
|
45
63
|
sig do
|
|
46
64
|
returns(
|
|
47
65
|
T.nilable(
|
|
@@ -80,7 +98,9 @@ module OpenAI
|
|
|
80
98
|
sig do
|
|
81
99
|
params(
|
|
82
100
|
delay: OpenAI::Realtime::AudioTranscription::Delay::OrSymbol,
|
|
101
|
+
keywords: T::Array[String],
|
|
83
102
|
language: String,
|
|
103
|
+
languages: T::Array[String],
|
|
84
104
|
model:
|
|
85
105
|
T.any(
|
|
86
106
|
String,
|
|
@@ -94,14 +114,22 @@ module OpenAI
|
|
|
94
114
|
# values can improve transcription accuracy at the cost of latency. Only supported
|
|
95
115
|
# with `gpt-realtime-whisper` in GA Realtime sessions.
|
|
96
116
|
delay: nil,
|
|
117
|
+
# Words or phrases to guide transcription of the input audio. Supported by
|
|
118
|
+
# `gpt-transcribe` and `gpt-live-transcribe`.
|
|
119
|
+
keywords: nil,
|
|
97
120
|
# The language of the input audio. Supplying the input language in
|
|
98
121
|
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
99
122
|
# format will improve accuracy and latency.
|
|
100
123
|
language: nil,
|
|
124
|
+
# Possible languages of the input audio, in
|
|
125
|
+
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
|
|
126
|
+
# Supported by `gpt-transcribe` and `gpt-live-transcribe`.
|
|
127
|
+
languages: nil,
|
|
101
128
|
# The model to use for transcription. Current options are `whisper-1`,
|
|
102
|
-
# `gpt-
|
|
103
|
-
# `gpt-4o-transcribe`, `gpt-4o-transcribe
|
|
104
|
-
#
|
|
129
|
+
# `gpt-transcribe`, `gpt-live-transcribe`, `gpt-4o-mini-transcribe`,
|
|
130
|
+
# `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`,
|
|
131
|
+
# `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use
|
|
132
|
+
# `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
|
|
105
133
|
model: nil,
|
|
106
134
|
# An optional text to guide the model's style or continue a previous audio
|
|
107
135
|
# segment. For `whisper-1`, the
|
|
@@ -117,7 +145,9 @@ module OpenAI
|
|
|
117
145
|
override.returns(
|
|
118
146
|
{
|
|
119
147
|
delay: OpenAI::Realtime::AudioTranscription::Delay::OrSymbol,
|
|
148
|
+
keywords: T::Array[String],
|
|
120
149
|
language: String,
|
|
150
|
+
languages: T::Array[String],
|
|
121
151
|
model:
|
|
122
152
|
T.any(
|
|
123
153
|
String,
|
|
@@ -180,9 +210,10 @@ module OpenAI
|
|
|
180
210
|
end
|
|
181
211
|
|
|
182
212
|
# The model to use for transcription. Current options are `whisper-1`,
|
|
183
|
-
# `gpt-
|
|
184
|
-
# `gpt-4o-transcribe`, `gpt-4o-transcribe
|
|
185
|
-
#
|
|
213
|
+
# `gpt-transcribe`, `gpt-live-transcribe`, `gpt-4o-mini-transcribe`,
|
|
214
|
+
# `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`,
|
|
215
|
+
# `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use
|
|
216
|
+
# `gpt-4o-transcribe-diarize` when you need diarization with speaker labels.
|
|
186
217
|
module Model
|
|
187
218
|
extend OpenAI::Internal::Type::Union
|
|
188
219
|
|
|
@@ -213,6 +244,16 @@ module OpenAI
|
|
|
213
244
|
:"whisper-1",
|
|
214
245
|
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
215
246
|
)
|
|
247
|
+
GPT_TRANSCRIBE =
|
|
248
|
+
T.let(
|
|
249
|
+
:"gpt-transcribe",
|
|
250
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
251
|
+
)
|
|
252
|
+
GPT_LIVE_TRANSCRIBE =
|
|
253
|
+
T.let(
|
|
254
|
+
:"gpt-live-transcribe",
|
|
255
|
+
OpenAI::Realtime::AudioTranscription::Model::TaggedSymbol
|
|
256
|
+
)
|
|
216
257
|
GPT_4O_MINI_TRANSCRIBE =
|
|
217
258
|
T.let(
|
|
218
259
|
:"gpt-4o-mini-transcribe",
|
data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi
CHANGED
|
@@ -44,6 +44,20 @@ module OpenAI
|
|
|
44
44
|
end
|
|
45
45
|
attr_accessor :usage
|
|
46
46
|
|
|
47
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
48
|
+
# array indicates that no language could be reliably detected.
|
|
49
|
+
sig do
|
|
50
|
+
returns(T.nilable(T::Array[OpenAI::Audio::TranscriptionLanguage]))
|
|
51
|
+
end
|
|
52
|
+
attr_reader :languages
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash]
|
|
57
|
+
).void
|
|
58
|
+
end
|
|
59
|
+
attr_writer :languages
|
|
60
|
+
|
|
47
61
|
# The log probabilities of the transcription.
|
|
48
62
|
sig do
|
|
49
63
|
returns(T.nilable(T::Array[OpenAI::Realtime::LogProbProperties]))
|
|
@@ -71,6 +85,7 @@ module OpenAI
|
|
|
71
85
|
OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens::OrHash,
|
|
72
86
|
OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration::OrHash
|
|
73
87
|
),
|
|
88
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash],
|
|
74
89
|
logprobs:
|
|
75
90
|
T.nilable(T::Array[OpenAI::Realtime::LogProbProperties::OrHash]),
|
|
76
91
|
type: Symbol
|
|
@@ -88,6 +103,9 @@ module OpenAI
|
|
|
88
103
|
# Usage statistics for the transcription, this is billed according to the ASR
|
|
89
104
|
# model's pricing rather than the realtime model's pricing.
|
|
90
105
|
usage:,
|
|
106
|
+
# The languages detected in the audio. Returned by `gpt-transcribe`. An empty
|
|
107
|
+
# array indicates that no language could be reliably detected.
|
|
108
|
+
languages: nil,
|
|
91
109
|
# The log probabilities of the transcription.
|
|
92
110
|
logprobs: nil,
|
|
93
111
|
# The event type, must be `conversation.item.input_audio_transcription.completed`.
|
|
@@ -108,6 +126,7 @@ module OpenAI
|
|
|
108
126
|
OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageTokens,
|
|
109
127
|
OpenAI::Realtime::ConversationItemInputAudioTranscriptionCompletedEvent::Usage::TranscriptTextUsageDuration
|
|
110
128
|
),
|
|
129
|
+
languages: T::Array[OpenAI::Audio::TranscriptionLanguage],
|
|
111
130
|
logprobs: T.nilable(T::Array[OpenAI::Realtime::LogProbProperties])
|
|
112
131
|
}
|
|
113
132
|
)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Webhooks
|
|
6
|
+
class LiveCallIncomingWebhookEvent < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent,
|
|
11
|
+
OpenAI::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The unique ID of the event.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :id
|
|
18
|
+
|
|
19
|
+
# The Unix timestamp (in seconds) of when the event was created.
|
|
20
|
+
sig { returns(Integer) }
|
|
21
|
+
attr_accessor :created_at
|
|
22
|
+
|
|
23
|
+
# Event data payload.
|
|
24
|
+
sig { returns(OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data) }
|
|
25
|
+
attr_reader :data
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
data: OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::OrHash
|
|
30
|
+
).void
|
|
31
|
+
end
|
|
32
|
+
attr_writer :data
|
|
33
|
+
|
|
34
|
+
# The type of the event. Always `live.call.incoming`.
|
|
35
|
+
sig { returns(Symbol) }
|
|
36
|
+
attr_accessor :type
|
|
37
|
+
|
|
38
|
+
# The object of the event. Always `event`.
|
|
39
|
+
sig do
|
|
40
|
+
returns(
|
|
41
|
+
T.nilable(
|
|
42
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::TaggedSymbol
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
attr_reader :object
|
|
47
|
+
|
|
48
|
+
sig do
|
|
49
|
+
params(
|
|
50
|
+
object:
|
|
51
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::OrSymbol
|
|
52
|
+
).void
|
|
53
|
+
end
|
|
54
|
+
attr_writer :object
|
|
55
|
+
|
|
56
|
+
# Sent when an incoming API SIP session is available for Live acceptance. The same
|
|
57
|
+
# pending session can also emit `realtime.call.incoming`; the first successful
|
|
58
|
+
# Realtime or Live accept endpoint selects the runtime surface.
|
|
59
|
+
sig do
|
|
60
|
+
params(
|
|
61
|
+
id: String,
|
|
62
|
+
created_at: Integer,
|
|
63
|
+
data: OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::OrHash,
|
|
64
|
+
object:
|
|
65
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::OrSymbol,
|
|
66
|
+
type: Symbol
|
|
67
|
+
).returns(T.attached_class)
|
|
68
|
+
end
|
|
69
|
+
def self.new(
|
|
70
|
+
# The unique ID of the event.
|
|
71
|
+
id:,
|
|
72
|
+
# The Unix timestamp (in seconds) of when the event was created.
|
|
73
|
+
created_at:,
|
|
74
|
+
# Event data payload.
|
|
75
|
+
data:,
|
|
76
|
+
# The object of the event. Always `event`.
|
|
77
|
+
object: nil,
|
|
78
|
+
# The type of the event. Always `live.call.incoming`.
|
|
79
|
+
type: :"live.call.incoming"
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
sig do
|
|
84
|
+
override.returns(
|
|
85
|
+
{
|
|
86
|
+
id: String,
|
|
87
|
+
created_at: Integer,
|
|
88
|
+
data: OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data,
|
|
89
|
+
type: Symbol,
|
|
90
|
+
object:
|
|
91
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::TaggedSymbol
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
def to_hash
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
|
99
|
+
OrHash =
|
|
100
|
+
T.type_alias do
|
|
101
|
+
T.any(
|
|
102
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data,
|
|
103
|
+
OpenAI::Internal::AnyHash
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
|
|
108
|
+
# as `call_id` in `realtime.call.incoming`.
|
|
109
|
+
sig { returns(String) }
|
|
110
|
+
attr_accessor :session_id
|
|
111
|
+
|
|
112
|
+
# Headers from the SIP Invite.
|
|
113
|
+
sig do
|
|
114
|
+
returns(
|
|
115
|
+
T::Array[
|
|
116
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader
|
|
117
|
+
]
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
attr_accessor :sip_headers
|
|
121
|
+
|
|
122
|
+
# Event data payload.
|
|
123
|
+
sig do
|
|
124
|
+
params(
|
|
125
|
+
session_id: String,
|
|
126
|
+
sip_headers:
|
|
127
|
+
T::Array[
|
|
128
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader::OrHash
|
|
129
|
+
]
|
|
130
|
+
).returns(T.attached_class)
|
|
131
|
+
end
|
|
132
|
+
def self.new(
|
|
133
|
+
# The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
|
|
134
|
+
# as `call_id` in `realtime.call.incoming`.
|
|
135
|
+
session_id:,
|
|
136
|
+
# Headers from the SIP Invite.
|
|
137
|
+
sip_headers:
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
sig do
|
|
142
|
+
override.returns(
|
|
143
|
+
{
|
|
144
|
+
session_id: String,
|
|
145
|
+
sip_headers:
|
|
146
|
+
T::Array[
|
|
147
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
end
|
|
152
|
+
def to_hash
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
class SipHeader < OpenAI::Internal::Type::BaseModel
|
|
156
|
+
OrHash =
|
|
157
|
+
T.type_alias do
|
|
158
|
+
T.any(
|
|
159
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader,
|
|
160
|
+
OpenAI::Internal::AnyHash
|
|
161
|
+
)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Name of the SIP Header.
|
|
165
|
+
sig { returns(String) }
|
|
166
|
+
attr_accessor :name
|
|
167
|
+
|
|
168
|
+
# Value of the SIP Header.
|
|
169
|
+
sig { returns(String) }
|
|
170
|
+
attr_accessor :value
|
|
171
|
+
|
|
172
|
+
# A header from the SIP Invite.
|
|
173
|
+
sig do
|
|
174
|
+
params(name: String, value: String).returns(T.attached_class)
|
|
175
|
+
end
|
|
176
|
+
def self.new(
|
|
177
|
+
# Name of the SIP Header.
|
|
178
|
+
name:,
|
|
179
|
+
# Value of the SIP Header.
|
|
180
|
+
value:
|
|
181
|
+
)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
sig { override.returns({ name: String, value: String }) }
|
|
185
|
+
def to_hash
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# The object of the event. Always `event`.
|
|
191
|
+
module Object
|
|
192
|
+
extend OpenAI::Internal::Type::Enum
|
|
193
|
+
|
|
194
|
+
TaggedSymbol =
|
|
195
|
+
T.type_alias do
|
|
196
|
+
T.all(
|
|
197
|
+
Symbol,
|
|
198
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object
|
|
199
|
+
)
|
|
200
|
+
end
|
|
201
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
202
|
+
|
|
203
|
+
EVENT =
|
|
204
|
+
T.let(
|
|
205
|
+
:event,
|
|
206
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::TaggedSymbol
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
sig do
|
|
210
|
+
override.returns(
|
|
211
|
+
T::Array[
|
|
212
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object::TaggedSymbol
|
|
213
|
+
]
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
def self.values
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
end
|
|
@@ -56,7 +56,9 @@ module OpenAI
|
|
|
56
56
|
end
|
|
57
57
|
attr_writer :object
|
|
58
58
|
|
|
59
|
-
# Sent when
|
|
59
|
+
# Sent when an incoming API SIP session is available for Realtime acceptance. The
|
|
60
|
+
# same pending session can also emit `live.call.incoming`; the first successful
|
|
61
|
+
# Realtime or Live accept endpoint selects the runtime surface.
|
|
60
62
|
sig do
|
|
61
63
|
params(
|
|
62
64
|
id: String,
|
|
@@ -106,7 +108,8 @@ module OpenAI
|
|
|
106
108
|
)
|
|
107
109
|
end
|
|
108
110
|
|
|
109
|
-
# The
|
|
111
|
+
# The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
|
|
112
|
+
# as `session_id` in `live.call.incoming`.
|
|
110
113
|
sig { returns(String) }
|
|
111
114
|
attr_accessor :call_id
|
|
112
115
|
|
|
@@ -131,7 +134,8 @@ module OpenAI
|
|
|
131
134
|
).returns(T.attached_class)
|
|
132
135
|
end
|
|
133
136
|
def self.new(
|
|
134
|
-
# The
|
|
137
|
+
# The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
|
|
138
|
+
# as `session_id` in `live.call.incoming`.
|
|
135
139
|
call_id:,
|
|
136
140
|
# Headers from the SIP Invite.
|
|
137
141
|
sip_headers:
|
|
@@ -20,6 +20,7 @@ module OpenAI
|
|
|
20
20
|
OpenAI::Webhooks::FineTuningJobCancelledWebhookEvent,
|
|
21
21
|
OpenAI::Webhooks::FineTuningJobFailedWebhookEvent,
|
|
22
22
|
OpenAI::Webhooks::FineTuningJobSucceededWebhookEvent,
|
|
23
|
+
OpenAI::Webhooks::LiveCallIncomingWebhookEvent,
|
|
23
24
|
OpenAI::Webhooks::RealtimeCallIncomingWebhookEvent,
|
|
24
25
|
OpenAI::Webhooks::ResponseCancelledWebhookEvent,
|
|
25
26
|
OpenAI::Webhooks::ResponseCompletedWebhookEvent,
|