openai 0.22.1 → 0.23.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/realtime/audio_transcription.rb +60 -0
- data/lib/openai/models/realtime/client_secret_create_params.rb +18 -9
- data/lib/openai/models/realtime/client_secret_create_response.rb +11 -250
- data/lib/openai/models/realtime/conversation_item.rb +1 -1
- data/lib/openai/models/realtime/conversation_item_added.rb +14 -1
- data/lib/openai/models/realtime/conversation_item_done.rb +3 -0
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +10 -8
- data/lib/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rb +14 -5
- data/lib/openai/models/realtime/conversation_item_truncate_event.rb +2 -2
- data/lib/openai/models/realtime/input_audio_buffer_append_event.rb +10 -5
- data/lib/openai/models/realtime/models.rb +58 -0
- data/lib/openai/models/realtime/noise_reduction_type.rb +20 -0
- data/lib/openai/models/realtime/realtime_audio_config.rb +6 -427
- data/lib/openai/models/realtime/realtime_audio_config_input.rb +89 -0
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +100 -0
- data/lib/openai/models/realtime/realtime_audio_formats.rb +121 -0
- data/lib/openai/models/realtime/realtime_audio_input_turn_detection.rb +131 -0
- data/lib/openai/models/realtime/realtime_client_event.rb +31 -23
- data/lib/openai/models/realtime/realtime_conversation_item_assistant_message.rb +43 -10
- data/lib/openai/models/realtime/realtime_conversation_item_function_call.rb +16 -7
- data/lib/openai/models/realtime/realtime_conversation_item_function_call_output.rb +15 -7
- data/lib/openai/models/realtime/realtime_conversation_item_system_message.rb +18 -6
- data/lib/openai/models/realtime/realtime_conversation_item_user_message.rb +62 -13
- data/lib/openai/models/realtime/realtime_response.rb +117 -107
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +100 -0
- data/lib/openai/models/realtime/realtime_response_create_mcp_tool.rb +310 -0
- data/lib/openai/models/realtime/realtime_response_create_params.rb +225 -0
- data/lib/openai/models/realtime/realtime_response_status.rb +1 -1
- data/lib/openai/models/realtime/realtime_response_usage.rb +5 -2
- data/lib/openai/models/realtime/realtime_response_usage_input_token_details.rb +58 -8
- data/lib/openai/models/realtime/realtime_server_event.rb +21 -5
- data/lib/openai/models/realtime/realtime_session.rb +9 -125
- data/lib/openai/models/realtime/realtime_session_client_secret.rb +36 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +50 -71
- data/lib/openai/models/realtime/realtime_session_create_response.rb +621 -219
- data/lib/openai/models/realtime/realtime_tools_config_union.rb +2 -53
- data/lib/openai/models/realtime/realtime_tracing_config.rb +7 -6
- data/lib/openai/models/realtime/realtime_transcription_session_audio.rb +19 -0
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +90 -0
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rb +131 -0
- data/lib/openai/models/realtime/realtime_transcription_session_client_secret.rb +38 -0
- data/lib/openai/models/realtime/realtime_transcription_session_create_request.rb +12 -270
- data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +78 -0
- data/lib/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rb +66 -0
- data/lib/openai/models/realtime/realtime_transcription_session_turn_detection.rb +57 -0
- data/lib/openai/models/realtime/realtime_truncation.rb +8 -40
- data/lib/openai/models/realtime/realtime_truncation_retention_ratio.rb +34 -0
- data/lib/openai/models/realtime/response_cancel_event.rb +3 -1
- data/lib/openai/models/realtime/response_create_event.rb +18 -348
- data/lib/openai/models/realtime/response_done_event.rb +7 -0
- data/lib/openai/models/realtime/session_created_event.rb +20 -4
- data/lib/openai/models/realtime/session_update_event.rb +36 -12
- data/lib/openai/models/realtime/session_updated_event.rb +20 -4
- data/lib/openai/models/realtime/transcription_session_created.rb +8 -243
- data/lib/openai/models/realtime/transcription_session_update.rb +179 -3
- data/lib/openai/models/realtime/transcription_session_updated_event.rb +8 -243
- data/lib/openai/resources/realtime/client_secrets.rb +2 -3
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +19 -1
- data/rbi/openai/models/realtime/audio_transcription.rbi +132 -0
- data/rbi/openai/models/realtime/client_secret_create_params.rbi +25 -11
- data/rbi/openai/models/realtime/client_secret_create_response.rbi +2 -587
- data/rbi/openai/models/realtime/conversation_item_added.rbi +14 -1
- data/rbi/openai/models/realtime/conversation_item_done.rbi +3 -0
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +11 -8
- data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_delta_event.rbi +15 -5
- data/rbi/openai/models/realtime/conversation_item_truncate_event.rbi +2 -2
- data/rbi/openai/models/realtime/input_audio_buffer_append_event.rbi +10 -5
- data/rbi/openai/models/realtime/models.rbi +97 -0
- data/rbi/openai/models/realtime/noise_reduction_type.rbi +31 -0
- data/rbi/openai/models/realtime/realtime_audio_config.rbi +8 -956
- data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +221 -0
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +222 -0
- data/rbi/openai/models/realtime/realtime_audio_formats.rbi +329 -0
- data/rbi/openai/models/realtime/realtime_audio_input_turn_detection.rbi +262 -0
- data/rbi/openai/models/realtime/realtime_conversation_item_assistant_message.rbi +51 -10
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call.rbi +16 -7
- data/rbi/openai/models/realtime/realtime_conversation_item_function_call_output.rbi +14 -7
- data/rbi/openai/models/realtime/realtime_conversation_item_system_message.rbi +16 -6
- data/rbi/openai/models/realtime/realtime_conversation_item_user_message.rbi +110 -12
- data/rbi/openai/models/realtime/realtime_response.rbi +287 -212
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +250 -0
- data/rbi/openai/models/realtime/realtime_response_create_mcp_tool.rbi +616 -0
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +529 -0
- data/rbi/openai/models/realtime/realtime_response_usage.rbi +8 -2
- data/rbi/openai/models/realtime/realtime_response_usage_input_token_details.rbi +106 -7
- data/rbi/openai/models/realtime/realtime_server_event.rbi +4 -1
- data/rbi/openai/models/realtime/realtime_session.rbi +12 -262
- data/rbi/openai/models/realtime/realtime_session_client_secret.rbi +49 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +112 -133
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +1229 -405
- data/rbi/openai/models/realtime/realtime_tools_config_union.rbi +1 -117
- data/rbi/openai/models/realtime/realtime_tracing_config.rbi +11 -10
- data/rbi/openai/models/realtime/realtime_transcription_session_audio.rbi +50 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +226 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbi +259 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_client_secret.rbi +51 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_create_request.rbi +25 -597
- data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +195 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbi +144 -0
- data/rbi/openai/models/realtime/realtime_transcription_session_turn_detection.rbi +94 -0
- data/rbi/openai/models/realtime/realtime_truncation.rbi +5 -56
- data/rbi/openai/models/realtime/realtime_truncation_retention_ratio.rbi +45 -0
- data/rbi/openai/models/realtime/response_cancel_event.rbi +3 -1
- data/rbi/openai/models/realtime/response_create_event.rbi +19 -786
- data/rbi/openai/models/realtime/response_done_event.rbi +7 -0
- data/rbi/openai/models/realtime/session_created_event.rbi +42 -9
- data/rbi/openai/models/realtime/session_update_event.rbi +57 -19
- data/rbi/openai/models/realtime/session_updated_event.rbi +42 -9
- data/rbi/openai/models/realtime/transcription_session_created.rbi +17 -591
- data/rbi/openai/models/realtime/transcription_session_update.rbi +425 -7
- data/rbi/openai/models/realtime/transcription_session_updated_event.rbi +14 -591
- data/rbi/openai/resources/realtime/client_secrets.rbi +5 -3
- data/sig/openai/models/realtime/audio_transcription.rbs +57 -0
- data/sig/openai/models/realtime/client_secret_create_response.rbs +1 -251
- data/sig/openai/models/realtime/models.rbs +57 -0
- data/sig/openai/models/realtime/noise_reduction_type.rbs +16 -0
- data/sig/openai/models/realtime/realtime_audio_config.rbs +12 -331
- data/sig/openai/models/realtime/realtime_audio_config_input.rbs +72 -0
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +72 -0
- data/sig/openai/models/realtime/realtime_audio_formats.rbs +128 -0
- data/sig/openai/models/realtime/realtime_audio_input_turn_detection.rbs +99 -0
- data/sig/openai/models/realtime/realtime_conversation_item_assistant_message.rbs +17 -2
- data/sig/openai/models/realtime/realtime_conversation_item_user_message.rbs +30 -1
- data/sig/openai/models/realtime/realtime_response.rbs +103 -82
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +84 -0
- data/sig/openai/models/realtime/realtime_response_create_mcp_tool.rbs +218 -0
- data/sig/openai/models/realtime/realtime_response_create_params.rbs +148 -0
- data/sig/openai/models/realtime/realtime_response_usage_input_token_details.rbs +50 -1
- data/sig/openai/models/realtime/realtime_session.rbs +16 -106
- data/sig/openai/models/realtime/realtime_session_client_secret.rbs +20 -0
- data/sig/openai/models/realtime/realtime_session_create_request.rbs +27 -43
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +389 -187
- data/sig/openai/models/realtime/realtime_tools_config_union.rbs +1 -53
- data/sig/openai/models/realtime/realtime_transcription_session_audio.rbs +24 -0
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +72 -0
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input_turn_detection.rbs +99 -0
- data/sig/openai/models/realtime/realtime_transcription_session_client_secret.rbs +20 -0
- data/sig/openai/models/realtime/realtime_transcription_session_create_request.rbs +11 -203
- data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +69 -0
- data/sig/openai/models/realtime/realtime_transcription_session_input_audio_transcription.rbs +59 -0
- data/sig/openai/models/realtime/realtime_transcription_session_turn_detection.rbs +47 -0
- data/sig/openai/models/realtime/realtime_truncation.rbs +1 -28
- data/sig/openai/models/realtime/realtime_truncation_retention_ratio.rbs +21 -0
- data/sig/openai/models/realtime/response_create_event.rbs +6 -249
- data/sig/openai/models/realtime/session_created_event.rbs +14 -4
- data/sig/openai/models/realtime/session_update_event.rbs +14 -4
- data/sig/openai/models/realtime/session_updated_event.rbs +14 -4
- data/sig/openai/models/realtime/transcription_session_created.rbs +4 -254
- data/sig/openai/models/realtime/transcription_session_update.rbs +154 -4
- data/sig/openai/models/realtime/transcription_session_updated_event.rbs +4 -254
- metadata +59 -5
- data/lib/openai/models/realtime/realtime_client_secret_config.rb +0 -64
- data/rbi/openai/models/realtime/realtime_client_secret_config.rbi +0 -147
- data/sig/openai/models/realtime/realtime_client_secret_config.rbs +0 -60
|
@@ -16,14 +16,20 @@ module OpenAI
|
|
|
16
16
|
sig { returns(String) }
|
|
17
17
|
attr_accessor :event_id
|
|
18
18
|
|
|
19
|
-
# A Realtime transcription session configuration
|
|
20
|
-
|
|
19
|
+
# A new Realtime transcription session configuration.
|
|
20
|
+
#
|
|
21
|
+
# When a session is created on the server via REST API, the session object also
|
|
22
|
+
# contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
|
|
23
|
+
# not present when a session is updated via the WebSocket API.
|
|
24
|
+
sig do
|
|
25
|
+
returns(OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse)
|
|
26
|
+
end
|
|
21
27
|
attr_reader :session
|
|
22
28
|
|
|
23
29
|
sig do
|
|
24
30
|
params(
|
|
25
31
|
session:
|
|
26
|
-
OpenAI::Realtime::
|
|
32
|
+
OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::OrHash
|
|
27
33
|
).void
|
|
28
34
|
end
|
|
29
35
|
attr_writer :session
|
|
@@ -37,14 +43,18 @@ module OpenAI
|
|
|
37
43
|
params(
|
|
38
44
|
event_id: String,
|
|
39
45
|
session:
|
|
40
|
-
OpenAI::Realtime::
|
|
46
|
+
OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse::OrHash,
|
|
41
47
|
type: Symbol
|
|
42
48
|
).returns(T.attached_class)
|
|
43
49
|
end
|
|
44
50
|
def self.new(
|
|
45
51
|
# The unique ID of the server event.
|
|
46
52
|
event_id:,
|
|
47
|
-
# A Realtime transcription session configuration
|
|
53
|
+
# A new Realtime transcription session configuration.
|
|
54
|
+
#
|
|
55
|
+
# When a session is created on the server via REST API, the session object also
|
|
56
|
+
# contains an ephemeral key. Default TTL for keys is 10 minutes. This property is
|
|
57
|
+
# not present when a session is updated via the WebSocket API.
|
|
48
58
|
session:,
|
|
49
59
|
# The event type, must be `transcription_session.created`.
|
|
50
60
|
type: :"transcription_session.created"
|
|
@@ -55,598 +65,14 @@ module OpenAI
|
|
|
55
65
|
override.returns(
|
|
56
66
|
{
|
|
57
67
|
event_id: String,
|
|
58
|
-
session:
|
|
68
|
+
session:
|
|
69
|
+
OpenAI::Realtime::RealtimeTranscriptionSessionCreateResponse,
|
|
59
70
|
type: Symbol
|
|
60
71
|
}
|
|
61
72
|
)
|
|
62
73
|
end
|
|
63
74
|
def to_hash
|
|
64
75
|
end
|
|
65
|
-
|
|
66
|
-
class Session < OpenAI::Internal::Type::BaseModel
|
|
67
|
-
OrHash =
|
|
68
|
-
T.type_alias do
|
|
69
|
-
T.any(
|
|
70
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session,
|
|
71
|
-
OpenAI::Internal::AnyHash
|
|
72
|
-
)
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
|
76
|
-
sig { returns(T.nilable(String)) }
|
|
77
|
-
attr_reader :id
|
|
78
|
-
|
|
79
|
-
sig { params(id: String).void }
|
|
80
|
-
attr_writer :id
|
|
81
|
-
|
|
82
|
-
# Configuration for input audio for the session.
|
|
83
|
-
sig do
|
|
84
|
-
returns(
|
|
85
|
-
T.nilable(
|
|
86
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio
|
|
87
|
-
)
|
|
88
|
-
)
|
|
89
|
-
end
|
|
90
|
-
attr_reader :audio
|
|
91
|
-
|
|
92
|
-
sig do
|
|
93
|
-
params(
|
|
94
|
-
audio:
|
|
95
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::OrHash
|
|
96
|
-
).void
|
|
97
|
-
end
|
|
98
|
-
attr_writer :audio
|
|
99
|
-
|
|
100
|
-
# Expiration timestamp for the session, in seconds since epoch.
|
|
101
|
-
sig { returns(T.nilable(Integer)) }
|
|
102
|
-
attr_reader :expires_at
|
|
103
|
-
|
|
104
|
-
sig { params(expires_at: Integer).void }
|
|
105
|
-
attr_writer :expires_at
|
|
106
|
-
|
|
107
|
-
# Additional fields to include in server outputs.
|
|
108
|
-
#
|
|
109
|
-
# - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
|
110
|
-
# transcription.
|
|
111
|
-
sig do
|
|
112
|
-
returns(
|
|
113
|
-
T.nilable(
|
|
114
|
-
T::Array[
|
|
115
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::OrSymbol
|
|
116
|
-
]
|
|
117
|
-
)
|
|
118
|
-
)
|
|
119
|
-
end
|
|
120
|
-
attr_reader :include
|
|
121
|
-
|
|
122
|
-
sig do
|
|
123
|
-
params(
|
|
124
|
-
include:
|
|
125
|
-
T::Array[
|
|
126
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::OrSymbol
|
|
127
|
-
]
|
|
128
|
-
).void
|
|
129
|
-
end
|
|
130
|
-
attr_writer :include
|
|
131
|
-
|
|
132
|
-
# The object type. Always `realtime.transcription_session`.
|
|
133
|
-
sig { returns(T.nilable(String)) }
|
|
134
|
-
attr_reader :object
|
|
135
|
-
|
|
136
|
-
sig { params(object: String).void }
|
|
137
|
-
attr_writer :object
|
|
138
|
-
|
|
139
|
-
# A Realtime transcription session configuration object.
|
|
140
|
-
sig do
|
|
141
|
-
params(
|
|
142
|
-
id: String,
|
|
143
|
-
audio:
|
|
144
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::OrHash,
|
|
145
|
-
expires_at: Integer,
|
|
146
|
-
include:
|
|
147
|
-
T::Array[
|
|
148
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::OrSymbol
|
|
149
|
-
],
|
|
150
|
-
object: String
|
|
151
|
-
).returns(T.attached_class)
|
|
152
|
-
end
|
|
153
|
-
def self.new(
|
|
154
|
-
# Unique identifier for the session that looks like `sess_1234567890abcdef`.
|
|
155
|
-
id: nil,
|
|
156
|
-
# Configuration for input audio for the session.
|
|
157
|
-
audio: nil,
|
|
158
|
-
# Expiration timestamp for the session, in seconds since epoch.
|
|
159
|
-
expires_at: nil,
|
|
160
|
-
# Additional fields to include in server outputs.
|
|
161
|
-
#
|
|
162
|
-
# - `item.input_audio_transcription.logprobs`: Include logprobs for input audio
|
|
163
|
-
# transcription.
|
|
164
|
-
include: nil,
|
|
165
|
-
# The object type. Always `realtime.transcription_session`.
|
|
166
|
-
object: nil
|
|
167
|
-
)
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
sig do
|
|
171
|
-
override.returns(
|
|
172
|
-
{
|
|
173
|
-
id: String,
|
|
174
|
-
audio:
|
|
175
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio,
|
|
176
|
-
expires_at: Integer,
|
|
177
|
-
include:
|
|
178
|
-
T::Array[
|
|
179
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::OrSymbol
|
|
180
|
-
],
|
|
181
|
-
object: String
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
end
|
|
185
|
-
def to_hash
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
class Audio < OpenAI::Internal::Type::BaseModel
|
|
189
|
-
OrHash =
|
|
190
|
-
T.type_alias do
|
|
191
|
-
T.any(
|
|
192
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio,
|
|
193
|
-
OpenAI::Internal::AnyHash
|
|
194
|
-
)
|
|
195
|
-
end
|
|
196
|
-
|
|
197
|
-
sig do
|
|
198
|
-
returns(
|
|
199
|
-
T.nilable(
|
|
200
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input
|
|
201
|
-
)
|
|
202
|
-
)
|
|
203
|
-
end
|
|
204
|
-
attr_reader :input
|
|
205
|
-
|
|
206
|
-
sig do
|
|
207
|
-
params(
|
|
208
|
-
input:
|
|
209
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::OrHash
|
|
210
|
-
).void
|
|
211
|
-
end
|
|
212
|
-
attr_writer :input
|
|
213
|
-
|
|
214
|
-
# Configuration for input audio for the session.
|
|
215
|
-
sig do
|
|
216
|
-
params(
|
|
217
|
-
input:
|
|
218
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::OrHash
|
|
219
|
-
).returns(T.attached_class)
|
|
220
|
-
end
|
|
221
|
-
def self.new(input: nil)
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
sig do
|
|
225
|
-
override.returns(
|
|
226
|
-
{
|
|
227
|
-
input:
|
|
228
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
end
|
|
232
|
-
def to_hash
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
class Input < OpenAI::Internal::Type::BaseModel
|
|
236
|
-
OrHash =
|
|
237
|
-
T.type_alias do
|
|
238
|
-
T.any(
|
|
239
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input,
|
|
240
|
-
OpenAI::Internal::AnyHash
|
|
241
|
-
)
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
|
245
|
-
sig { returns(T.nilable(String)) }
|
|
246
|
-
attr_reader :format_
|
|
247
|
-
|
|
248
|
-
sig { params(format_: String).void }
|
|
249
|
-
attr_writer :format_
|
|
250
|
-
|
|
251
|
-
# Configuration for input audio noise reduction.
|
|
252
|
-
sig do
|
|
253
|
-
returns(
|
|
254
|
-
T.nilable(
|
|
255
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction
|
|
256
|
-
)
|
|
257
|
-
)
|
|
258
|
-
end
|
|
259
|
-
attr_reader :noise_reduction
|
|
260
|
-
|
|
261
|
-
sig do
|
|
262
|
-
params(
|
|
263
|
-
noise_reduction:
|
|
264
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::OrHash
|
|
265
|
-
).void
|
|
266
|
-
end
|
|
267
|
-
attr_writer :noise_reduction
|
|
268
|
-
|
|
269
|
-
# Configuration of the transcription model.
|
|
270
|
-
sig do
|
|
271
|
-
returns(
|
|
272
|
-
T.nilable(
|
|
273
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription
|
|
274
|
-
)
|
|
275
|
-
)
|
|
276
|
-
end
|
|
277
|
-
attr_reader :transcription
|
|
278
|
-
|
|
279
|
-
sig do
|
|
280
|
-
params(
|
|
281
|
-
transcription:
|
|
282
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::OrHash
|
|
283
|
-
).void
|
|
284
|
-
end
|
|
285
|
-
attr_writer :transcription
|
|
286
|
-
|
|
287
|
-
# Configuration for turn detection.
|
|
288
|
-
sig do
|
|
289
|
-
returns(
|
|
290
|
-
T.nilable(
|
|
291
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::TurnDetection
|
|
292
|
-
)
|
|
293
|
-
)
|
|
294
|
-
end
|
|
295
|
-
attr_reader :turn_detection
|
|
296
|
-
|
|
297
|
-
sig do
|
|
298
|
-
params(
|
|
299
|
-
turn_detection:
|
|
300
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::TurnDetection::OrHash
|
|
301
|
-
).void
|
|
302
|
-
end
|
|
303
|
-
attr_writer :turn_detection
|
|
304
|
-
|
|
305
|
-
sig do
|
|
306
|
-
params(
|
|
307
|
-
format_: String,
|
|
308
|
-
noise_reduction:
|
|
309
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::OrHash,
|
|
310
|
-
transcription:
|
|
311
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::OrHash,
|
|
312
|
-
turn_detection:
|
|
313
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::TurnDetection::OrHash
|
|
314
|
-
).returns(T.attached_class)
|
|
315
|
-
end
|
|
316
|
-
def self.new(
|
|
317
|
-
# The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
|
|
318
|
-
format_: nil,
|
|
319
|
-
# Configuration for input audio noise reduction.
|
|
320
|
-
noise_reduction: nil,
|
|
321
|
-
# Configuration of the transcription model.
|
|
322
|
-
transcription: nil,
|
|
323
|
-
# Configuration for turn detection.
|
|
324
|
-
turn_detection: nil
|
|
325
|
-
)
|
|
326
|
-
end
|
|
327
|
-
|
|
328
|
-
sig do
|
|
329
|
-
override.returns(
|
|
330
|
-
{
|
|
331
|
-
format_: String,
|
|
332
|
-
noise_reduction:
|
|
333
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction,
|
|
334
|
-
transcription:
|
|
335
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription,
|
|
336
|
-
turn_detection:
|
|
337
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::TurnDetection
|
|
338
|
-
}
|
|
339
|
-
)
|
|
340
|
-
end
|
|
341
|
-
def to_hash
|
|
342
|
-
end
|
|
343
|
-
|
|
344
|
-
class NoiseReduction < OpenAI::Internal::Type::BaseModel
|
|
345
|
-
OrHash =
|
|
346
|
-
T.type_alias do
|
|
347
|
-
T.any(
|
|
348
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction,
|
|
349
|
-
OpenAI::Internal::AnyHash
|
|
350
|
-
)
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
sig do
|
|
354
|
-
returns(
|
|
355
|
-
T.nilable(
|
|
356
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::OrSymbol
|
|
357
|
-
)
|
|
358
|
-
)
|
|
359
|
-
end
|
|
360
|
-
attr_reader :type
|
|
361
|
-
|
|
362
|
-
sig do
|
|
363
|
-
params(
|
|
364
|
-
type:
|
|
365
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::OrSymbol
|
|
366
|
-
).void
|
|
367
|
-
end
|
|
368
|
-
attr_writer :type
|
|
369
|
-
|
|
370
|
-
# Configuration for input audio noise reduction.
|
|
371
|
-
sig do
|
|
372
|
-
params(
|
|
373
|
-
type:
|
|
374
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::OrSymbol
|
|
375
|
-
).returns(T.attached_class)
|
|
376
|
-
end
|
|
377
|
-
def self.new(type: nil)
|
|
378
|
-
end
|
|
379
|
-
|
|
380
|
-
sig do
|
|
381
|
-
override.returns(
|
|
382
|
-
{
|
|
383
|
-
type:
|
|
384
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::OrSymbol
|
|
385
|
-
}
|
|
386
|
-
)
|
|
387
|
-
end
|
|
388
|
-
def to_hash
|
|
389
|
-
end
|
|
390
|
-
|
|
391
|
-
module Type
|
|
392
|
-
extend OpenAI::Internal::Type::Enum
|
|
393
|
-
|
|
394
|
-
TaggedSymbol =
|
|
395
|
-
T.type_alias do
|
|
396
|
-
T.all(
|
|
397
|
-
Symbol,
|
|
398
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type
|
|
399
|
-
)
|
|
400
|
-
end
|
|
401
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
402
|
-
|
|
403
|
-
NEAR_FIELD =
|
|
404
|
-
T.let(
|
|
405
|
-
:near_field,
|
|
406
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::TaggedSymbol
|
|
407
|
-
)
|
|
408
|
-
FAR_FIELD =
|
|
409
|
-
T.let(
|
|
410
|
-
:far_field,
|
|
411
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::TaggedSymbol
|
|
412
|
-
)
|
|
413
|
-
|
|
414
|
-
sig do
|
|
415
|
-
override.returns(
|
|
416
|
-
T::Array[
|
|
417
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::NoiseReduction::Type::TaggedSymbol
|
|
418
|
-
]
|
|
419
|
-
)
|
|
420
|
-
end
|
|
421
|
-
def self.values
|
|
422
|
-
end
|
|
423
|
-
end
|
|
424
|
-
end
|
|
425
|
-
|
|
426
|
-
class Transcription < OpenAI::Internal::Type::BaseModel
|
|
427
|
-
OrHash =
|
|
428
|
-
T.type_alias do
|
|
429
|
-
T.any(
|
|
430
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription,
|
|
431
|
-
OpenAI::Internal::AnyHash
|
|
432
|
-
)
|
|
433
|
-
end
|
|
434
|
-
|
|
435
|
-
# The language of the input audio. Supplying the input language in
|
|
436
|
-
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
437
|
-
# format will improve accuracy and latency.
|
|
438
|
-
sig { returns(T.nilable(String)) }
|
|
439
|
-
attr_reader :language
|
|
440
|
-
|
|
441
|
-
sig { params(language: String).void }
|
|
442
|
-
attr_writer :language
|
|
443
|
-
|
|
444
|
-
# The model to use for transcription. Can be `gpt-4o-transcribe`,
|
|
445
|
-
# `gpt-4o-mini-transcribe`, or `whisper-1`.
|
|
446
|
-
sig do
|
|
447
|
-
returns(
|
|
448
|
-
T.nilable(
|
|
449
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::OrSymbol
|
|
450
|
-
)
|
|
451
|
-
)
|
|
452
|
-
end
|
|
453
|
-
attr_reader :model
|
|
454
|
-
|
|
455
|
-
sig do
|
|
456
|
-
params(
|
|
457
|
-
model:
|
|
458
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::OrSymbol
|
|
459
|
-
).void
|
|
460
|
-
end
|
|
461
|
-
attr_writer :model
|
|
462
|
-
|
|
463
|
-
# An optional text to guide the model's style or continue a previous audio
|
|
464
|
-
# segment. The
|
|
465
|
-
# [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
466
|
-
# should match the audio language.
|
|
467
|
-
sig { returns(T.nilable(String)) }
|
|
468
|
-
attr_reader :prompt
|
|
469
|
-
|
|
470
|
-
sig { params(prompt: String).void }
|
|
471
|
-
attr_writer :prompt
|
|
472
|
-
|
|
473
|
-
# Configuration of the transcription model.
|
|
474
|
-
sig do
|
|
475
|
-
params(
|
|
476
|
-
language: String,
|
|
477
|
-
model:
|
|
478
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::OrSymbol,
|
|
479
|
-
prompt: String
|
|
480
|
-
).returns(T.attached_class)
|
|
481
|
-
end
|
|
482
|
-
def self.new(
|
|
483
|
-
# The language of the input audio. Supplying the input language in
|
|
484
|
-
# [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
|
|
485
|
-
# format will improve accuracy and latency.
|
|
486
|
-
language: nil,
|
|
487
|
-
# The model to use for transcription. Can be `gpt-4o-transcribe`,
|
|
488
|
-
# `gpt-4o-mini-transcribe`, or `whisper-1`.
|
|
489
|
-
model: nil,
|
|
490
|
-
# An optional text to guide the model's style or continue a previous audio
|
|
491
|
-
# segment. The
|
|
492
|
-
# [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
|
|
493
|
-
# should match the audio language.
|
|
494
|
-
prompt: nil
|
|
495
|
-
)
|
|
496
|
-
end
|
|
497
|
-
|
|
498
|
-
sig do
|
|
499
|
-
override.returns(
|
|
500
|
-
{
|
|
501
|
-
language: String,
|
|
502
|
-
model:
|
|
503
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::OrSymbol,
|
|
504
|
-
prompt: String
|
|
505
|
-
}
|
|
506
|
-
)
|
|
507
|
-
end
|
|
508
|
-
def to_hash
|
|
509
|
-
end
|
|
510
|
-
|
|
511
|
-
# The model to use for transcription. Can be `gpt-4o-transcribe`,
|
|
512
|
-
# `gpt-4o-mini-transcribe`, or `whisper-1`.
|
|
513
|
-
module Model
|
|
514
|
-
extend OpenAI::Internal::Type::Enum
|
|
515
|
-
|
|
516
|
-
TaggedSymbol =
|
|
517
|
-
T.type_alias do
|
|
518
|
-
T.all(
|
|
519
|
-
Symbol,
|
|
520
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model
|
|
521
|
-
)
|
|
522
|
-
end
|
|
523
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
524
|
-
|
|
525
|
-
GPT_4O_TRANSCRIBE =
|
|
526
|
-
T.let(
|
|
527
|
-
:"gpt-4o-transcribe",
|
|
528
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::TaggedSymbol
|
|
529
|
-
)
|
|
530
|
-
GPT_4O_MINI_TRANSCRIBE =
|
|
531
|
-
T.let(
|
|
532
|
-
:"gpt-4o-mini-transcribe",
|
|
533
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::TaggedSymbol
|
|
534
|
-
)
|
|
535
|
-
WHISPER_1 =
|
|
536
|
-
T.let(
|
|
537
|
-
:"whisper-1",
|
|
538
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::TaggedSymbol
|
|
539
|
-
)
|
|
540
|
-
|
|
541
|
-
sig do
|
|
542
|
-
override.returns(
|
|
543
|
-
T::Array[
|
|
544
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::Transcription::Model::TaggedSymbol
|
|
545
|
-
]
|
|
546
|
-
)
|
|
547
|
-
end
|
|
548
|
-
def self.values
|
|
549
|
-
end
|
|
550
|
-
end
|
|
551
|
-
end
|
|
552
|
-
|
|
553
|
-
class TurnDetection < OpenAI::Internal::Type::BaseModel
|
|
554
|
-
OrHash =
|
|
555
|
-
T.type_alias do
|
|
556
|
-
T.any(
|
|
557
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Audio::Input::TurnDetection,
|
|
558
|
-
OpenAI::Internal::AnyHash
|
|
559
|
-
)
|
|
560
|
-
end
|
|
561
|
-
|
|
562
|
-
sig { returns(T.nilable(Integer)) }
|
|
563
|
-
attr_reader :prefix_padding_ms
|
|
564
|
-
|
|
565
|
-
sig { params(prefix_padding_ms: Integer).void }
|
|
566
|
-
attr_writer :prefix_padding_ms
|
|
567
|
-
|
|
568
|
-
sig { returns(T.nilable(Integer)) }
|
|
569
|
-
attr_reader :silence_duration_ms
|
|
570
|
-
|
|
571
|
-
sig { params(silence_duration_ms: Integer).void }
|
|
572
|
-
attr_writer :silence_duration_ms
|
|
573
|
-
|
|
574
|
-
sig { returns(T.nilable(Float)) }
|
|
575
|
-
attr_reader :threshold
|
|
576
|
-
|
|
577
|
-
sig { params(threshold: Float).void }
|
|
578
|
-
attr_writer :threshold
|
|
579
|
-
|
|
580
|
-
# Type of turn detection, only `server_vad` is currently supported.
|
|
581
|
-
sig { returns(T.nilable(String)) }
|
|
582
|
-
attr_reader :type
|
|
583
|
-
|
|
584
|
-
sig { params(type: String).void }
|
|
585
|
-
attr_writer :type
|
|
586
|
-
|
|
587
|
-
# Configuration for turn detection.
|
|
588
|
-
sig do
|
|
589
|
-
params(
|
|
590
|
-
prefix_padding_ms: Integer,
|
|
591
|
-
silence_duration_ms: Integer,
|
|
592
|
-
threshold: Float,
|
|
593
|
-
type: String
|
|
594
|
-
).returns(T.attached_class)
|
|
595
|
-
end
|
|
596
|
-
def self.new(
|
|
597
|
-
prefix_padding_ms: nil,
|
|
598
|
-
silence_duration_ms: nil,
|
|
599
|
-
threshold: nil,
|
|
600
|
-
# Type of turn detection, only `server_vad` is currently supported.
|
|
601
|
-
type: nil
|
|
602
|
-
)
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
sig do
|
|
606
|
-
override.returns(
|
|
607
|
-
{
|
|
608
|
-
prefix_padding_ms: Integer,
|
|
609
|
-
silence_duration_ms: Integer,
|
|
610
|
-
threshold: Float,
|
|
611
|
-
type: String
|
|
612
|
-
}
|
|
613
|
-
)
|
|
614
|
-
end
|
|
615
|
-
def to_hash
|
|
616
|
-
end
|
|
617
|
-
end
|
|
618
|
-
end
|
|
619
|
-
end
|
|
620
|
-
|
|
621
|
-
module Include
|
|
622
|
-
extend OpenAI::Internal::Type::Enum
|
|
623
|
-
|
|
624
|
-
TaggedSymbol =
|
|
625
|
-
T.type_alias do
|
|
626
|
-
T.all(
|
|
627
|
-
Symbol,
|
|
628
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include
|
|
629
|
-
)
|
|
630
|
-
end
|
|
631
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
632
|
-
|
|
633
|
-
ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS =
|
|
634
|
-
T.let(
|
|
635
|
-
:"item.input_audio_transcription.logprobs",
|
|
636
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::TaggedSymbol
|
|
637
|
-
)
|
|
638
|
-
|
|
639
|
-
sig do
|
|
640
|
-
override.returns(
|
|
641
|
-
T::Array[
|
|
642
|
-
OpenAI::Realtime::TranscriptionSessionCreated::Session::Include::TaggedSymbol
|
|
643
|
-
]
|
|
644
|
-
)
|
|
645
|
-
end
|
|
646
|
-
def self.values
|
|
647
|
-
end
|
|
648
|
-
end
|
|
649
|
-
end
|
|
650
76
|
end
|
|
651
77
|
end
|
|
652
78
|
end
|