openai 0.118.0 → 0.119.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 +10 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +1 -1
- data/lib/openai/helpers/data_residency.rb +4 -1
- data/lib/openai/models/all_models.rb +1 -0
- data/lib/openai/models/beta/beta_compacted_response.rb +34 -1
- data/lib/openai/models/beta/beta_response.rb +34 -1
- data/lib/openai/models/beta/beta_response_input_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_output_item.rb +45 -1
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +186 -13
- data/lib/openai/models/beta/beta_responses_client_event.rb +48 -1
- data/lib/openai/models/beta/beta_tool.rb +164 -13
- data/lib/openai/models/beta/response_compact_params.rb +44 -1
- data/lib/openai/models/beta/response_create_params.rb +44 -1
- data/lib/openai/models/beta/session_turn_error.rb +3 -0
- data/lib/openai/models/conversations/conversation_item.rb +45 -1
- data/lib/openai/models/image_edit_params.rb +72 -16
- data/lib/openai/models/image_generate_params.rb +160 -8
- data/lib/openai/models/image_model.rb +2 -0
- data/lib/openai/models/images_response.rb +55 -4
- data/lib/openai/models/realtime/realtime_audio_config_input.rb +14 -1
- data/lib/openai/models/realtime/realtime_session_create_response.rb +14 -1
- data/lib/openai/models/realtime/realtime_transcription_session_audio_input.rb +14 -1
- data/lib/openai/models/realtime/realtime_transcription_session_create_response.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session_create_request.rb +14 -1
- data/lib/openai/models/realtime/realtime_translation_session_update_request.rb +14 -1
- data/lib/openai/models/responses/compacted_response.rb +37 -1
- data/lib/openai/models/responses/response.rb +34 -1
- data/lib/openai/models/responses/response_compact_params.rb +50 -1
- data/lib/openai/models/responses/response_create_params.rb +47 -1
- data/lib/openai/models/responses/response_input_item.rb +45 -1
- data/lib/openai/models/responses/response_item.rb +45 -1
- data/lib/openai/models/responses/response_output_item.rb +45 -1
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +186 -13
- data/lib/openai/models/responses/responses_client_event.rb +48 -1
- data/lib/openai/models/responses/tool.rb +164 -13
- data/lib/openai/models/responses_model.rb +1 -0
- data/lib/openai/resources/admin/organization/projects.rb +6 -6
- data/lib/openai/resources/admin/organization.rb +6 -6
- data/lib/openai/resources/beta/responses.rb +12 -3
- data/lib/openai/resources/images.rb +102 -18
- data/lib/openai/resources/responses.rb +12 -3
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/models/all_models.rbi +1 -0
- data/rbi/openai/models/beta/beta_compacted_response.rbi +67 -1
- data/rbi/openai/models/beta/beta_response.rbi +62 -0
- data/rbi/openai/models/beta/beta_response_input_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_output_item.rbi +82 -1
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +338 -13
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +105 -0
- data/rbi/openai/models/beta/beta_tool.rbi +245 -13
- data/rbi/openai/models/beta/response_compact_params.rbi +81 -0
- data/rbi/openai/models/beta/response_create_params.rbi +81 -0
- data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +84 -1
- data/rbi/openai/models/image_edit_params.rbi +76 -14
- data/rbi/openai/models/image_generate_params.rbi +218 -6
- data/rbi/openai/models/image_model.rbi +2 -0
- data/rbi/openai/models/images_response.rbi +90 -3
- data/rbi/openai/models/realtime/realtime_audio_config_input.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_transcription_session_audio_input.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_transcription_session_create_response.rbi +17 -1
- data/rbi/openai/models/realtime/realtime_translation_session.rbi +19 -3
- data/rbi/openai/models/realtime/realtime_translation_session_create_request.rbi +19 -3
- data/rbi/openai/models/realtime/realtime_translation_session_update_request.rbi +19 -3
- data/rbi/openai/models/responses/compacted_response.rbi +67 -1
- data/rbi/openai/models/responses/response.rbi +62 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +88 -0
- data/rbi/openai/models/responses/response_create_params.rbi +87 -0
- data/rbi/openai/models/responses/response_input_item.rbi +82 -1
- data/rbi/openai/models/responses/response_item.rbi +82 -1
- data/rbi/openai/models/responses/response_output_item.rbi +82 -1
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +340 -13
- data/rbi/openai/models/responses/responses_client_event.rbi +105 -0
- data/rbi/openai/models/responses/tool.rbi +248 -13
- data/rbi/openai/models/responses_model.rbi +1 -0
- data/rbi/openai/resources/admin/organization/projects.rbi +3 -3
- data/rbi/openai/resources/admin/organization.rbi +3 -3
- data/rbi/openai/resources/beta/responses.rbi +9 -0
- data/rbi/openai/resources/images.rbi +98 -14
- data/rbi/openai/resources/responses.rbi +11 -0
- data/sig/openai/models/all_models.rbs +2 -0
- data/sig/openai/models/beta/beta_compacted_response.rbs +42 -2
- data/sig/openai/models/beta/beta_response.rbs +40 -0
- data/sig/openai/models/beta/beta_response_input_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_output_item.rbs +51 -3
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +188 -15
- data/sig/openai/models/beta/beta_responses_client_event.rbs +56 -0
- data/sig/openai/models/beta/beta_tool.rbs +188 -15
- data/sig/openai/models/beta/response_compact_params.rbs +56 -0
- data/sig/openai/models/beta/response_create_params.rbs +56 -0
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/conversations/conversation_item.rbs +51 -3
- data/sig/openai/models/image_edit_params.rbs +63 -12
- data/sig/openai/models/image_generate_params.rbs +150 -5
- data/sig/openai/models/image_model.rbs +4 -0
- data/sig/openai/models/images_response.rbs +59 -4
- data/sig/openai/models/realtime/realtime_audio_config_input.rbs +20 -1
- data/sig/openai/models/realtime/realtime_session_create_response.rbs +20 -1
- data/sig/openai/models/realtime/realtime_transcription_session_audio_input.rbs +20 -1
- data/sig/openai/models/realtime/realtime_transcription_session_create_response.rbs +20 -1
- data/sig/openai/models/realtime/realtime_translation_session.rbs +22 -3
- data/sig/openai/models/realtime/realtime_translation_session_create_request.rbs +22 -3
- data/sig/openai/models/realtime/realtime_translation_session_update_request.rbs +22 -3
- data/sig/openai/models/responses/compacted_response.rbs +42 -2
- data/sig/openai/models/responses/response.rbs +40 -0
- data/sig/openai/models/responses/response_compact_params.rbs +58 -0
- data/sig/openai/models/responses/response_create_params.rbs +56 -0
- data/sig/openai/models/responses/response_input_item.rbs +51 -3
- data/sig/openai/models/responses/response_item.rbs +51 -3
- data/sig/openai/models/responses/response_output_item.rbs +51 -3
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +188 -15
- data/sig/openai/models/responses/responses_client_event.rbs +56 -0
- data/sig/openai/models/responses/tool.rbs +188 -15
- data/sig/openai/models/responses_model.rbs +2 -0
- data/sig/openai/resources/admin/organization/projects.rbs +2 -2
- data/sig/openai/resources/admin/organization.rbs +2 -2
- data/sig/openai/resources/beta/responses.rbs +3 -0
- data/sig/openai/resources/images.rbs +14 -0
- data/sig/openai/resources/responses.rbs +4 -0
- metadata +1 -1
|
@@ -31,7 +31,7 @@ module OpenAI
|
|
|
31
31
|
sig { params(data: T::Array[OpenAI::Image::OrHash]).void }
|
|
32
32
|
attr_writer :data
|
|
33
33
|
|
|
34
|
-
# The output format of the image
|
|
34
|
+
# The output format of the generated image.
|
|
35
35
|
sig { returns(T.nilable(OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)) }
|
|
36
36
|
attr_reader :output_format
|
|
37
37
|
|
|
@@ -59,6 +59,14 @@ module OpenAI
|
|
|
59
59
|
sig { params(size: T.any(String, OpenAI::ImagesResponse::Size::OrSymbol)).void }
|
|
60
60
|
attr_writer :size
|
|
61
61
|
|
|
62
|
+
# Token usage for the model that authored the SVG, separate from image rendering
|
|
63
|
+
# usage.
|
|
64
|
+
sig { returns(T.nilable(OpenAI::ImagesResponse::SvgUsage)) }
|
|
65
|
+
attr_reader :svg_usage
|
|
66
|
+
|
|
67
|
+
sig { params(svg_usage: OpenAI::ImagesResponse::SvgUsage::OrHash).void }
|
|
68
|
+
attr_writer :svg_usage
|
|
69
|
+
|
|
62
70
|
# For `gpt-image-1` only, the token usage information for the image generation.
|
|
63
71
|
sig { returns(T.nilable(OpenAI::ImagesResponse::Usage)) }
|
|
64
72
|
attr_reader :usage
|
|
@@ -84,6 +92,8 @@ module OpenAI
|
|
|
84
92
|
|
|
85
93
|
size: T.any(String, OpenAI::ImagesResponse::Size::OrSymbol),
|
|
86
94
|
|
|
95
|
+
svg_usage: OpenAI::ImagesResponse::SvgUsage::OrHash,
|
|
96
|
+
|
|
87
97
|
usage: OpenAI::ImagesResponse::Usage::OrHash
|
|
88
98
|
)
|
|
89
99
|
.returns(T.attached_class)
|
|
@@ -100,7 +110,7 @@ module OpenAI
|
|
|
100
110
|
# The list of generated images.
|
|
101
111
|
data: nil,
|
|
102
112
|
|
|
103
|
-
# The output format of the image
|
|
113
|
+
# The output format of the generated image.
|
|
104
114
|
output_format: nil,
|
|
105
115
|
|
|
106
116
|
# The quality of the image generated. One of `low`, `medium`, `high`, `xhigh`, or
|
|
@@ -115,6 +125,10 @@ module OpenAI
|
|
|
115
125
|
# The image dimensions as a `WIDTHxHEIGHT` string, for example `1536x864`.
|
|
116
126
|
size: nil,
|
|
117
127
|
|
|
128
|
+
# Token usage for the model that authored the SVG, separate from image rendering
|
|
129
|
+
# usage.
|
|
130
|
+
svg_usage: nil,
|
|
131
|
+
|
|
118
132
|
# For `gpt-image-1` only, the token usage information for the image generation.
|
|
119
133
|
|
|
120
134
|
usage: nil
|
|
@@ -131,6 +145,7 @@ module OpenAI
|
|
|
131
145
|
quality: OpenAI::ImagesResponse::Quality::TaggedSymbol,
|
|
132
146
|
safety_identifier: T.nilable(String),
|
|
133
147
|
size: OpenAI::ImagesResponse::Size::Variants,
|
|
148
|
+
svg_usage: OpenAI::ImagesResponse::SvgUsage,
|
|
134
149
|
usage: OpenAI::ImagesResponse::Usage
|
|
135
150
|
}
|
|
136
151
|
)
|
|
@@ -154,7 +169,7 @@ module OpenAI
|
|
|
154
169
|
end
|
|
155
170
|
end
|
|
156
171
|
|
|
157
|
-
# The output format of the image
|
|
172
|
+
# The output format of the generated image.
|
|
158
173
|
module OutputFormat
|
|
159
174
|
extend OpenAI::Internal::Type::Enum
|
|
160
175
|
|
|
@@ -164,6 +179,8 @@ module OpenAI
|
|
|
164
179
|
PNG = T.let(:png, OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)
|
|
165
180
|
WEBP = T.let(:webp, OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)
|
|
166
181
|
JPEG = T.let(:jpeg, OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)
|
|
182
|
+
GIF = T.let(:gif, OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)
|
|
183
|
+
SVG = T.let(:svg, OpenAI::ImagesResponse::OutputFormat::TaggedSymbol)
|
|
167
184
|
|
|
168
185
|
sig { override.returns(T::Array[OpenAI::ImagesResponse::OutputFormat::TaggedSymbol]) }
|
|
169
186
|
def self.values
|
|
@@ -215,6 +232,76 @@ module OpenAI
|
|
|
215
232
|
|
|
216
233
|
end
|
|
217
234
|
|
|
235
|
+
class SvgUsage < OpenAI::Internal::Type::BaseModel
|
|
236
|
+
OrHash = T.type_alias do
|
|
237
|
+
T.any(
|
|
238
|
+
OpenAI::ImagesResponse::SvgUsage,
|
|
239
|
+
OpenAI::Internal::AnyHash
|
|
240
|
+
)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
sig { returns(Integer) }
|
|
244
|
+
attr_accessor :input_tokens
|
|
245
|
+
|
|
246
|
+
sig { returns(String) }
|
|
247
|
+
attr_accessor :model
|
|
248
|
+
|
|
249
|
+
sig { returns(Integer) }
|
|
250
|
+
attr_accessor :output_tokens
|
|
251
|
+
|
|
252
|
+
sig { returns(Integer) }
|
|
253
|
+
attr_accessor :reasoning_tokens
|
|
254
|
+
|
|
255
|
+
sig { returns(Integer) }
|
|
256
|
+
attr_accessor :total_tokens
|
|
257
|
+
|
|
258
|
+
# Token usage for the model that authored the SVG, separate from image rendering
|
|
259
|
+
# usage.
|
|
260
|
+
sig do
|
|
261
|
+
params(
|
|
262
|
+
|
|
263
|
+
input_tokens: Integer,
|
|
264
|
+
|
|
265
|
+
model: String,
|
|
266
|
+
|
|
267
|
+
output_tokens: Integer,
|
|
268
|
+
|
|
269
|
+
reasoning_tokens: Integer,
|
|
270
|
+
|
|
271
|
+
total_tokens: Integer
|
|
272
|
+
)
|
|
273
|
+
.returns(T.attached_class)
|
|
274
|
+
end
|
|
275
|
+
def self.new(
|
|
276
|
+
|
|
277
|
+
input_tokens:,
|
|
278
|
+
|
|
279
|
+
model:,
|
|
280
|
+
|
|
281
|
+
output_tokens:,
|
|
282
|
+
|
|
283
|
+
reasoning_tokens:,
|
|
284
|
+
|
|
285
|
+
total_tokens:
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
sig do
|
|
290
|
+
override.returns(
|
|
291
|
+
{
|
|
292
|
+
input_tokens: Integer,
|
|
293
|
+
model: String,
|
|
294
|
+
output_tokens: Integer,
|
|
295
|
+
reasoning_tokens: Integer,
|
|
296
|
+
total_tokens: Integer
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
end
|
|
300
|
+
def to_hash
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
end
|
|
304
|
+
|
|
218
305
|
class Usage < OpenAI::Internal::Type::BaseModel
|
|
219
306
|
OrHash = T.type_alias do
|
|
220
307
|
T.any(
|
|
@@ -188,6 +188,15 @@ module OpenAI
|
|
|
188
188
|
)
|
|
189
189
|
end
|
|
190
190
|
|
|
191
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
192
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
193
|
+
# update preserves the current strength.
|
|
194
|
+
sig { returns(T.nilable(Float)) }
|
|
195
|
+
attr_reader :strength
|
|
196
|
+
|
|
197
|
+
sig { params(strength: Float).void }
|
|
198
|
+
attr_writer :strength
|
|
199
|
+
|
|
191
200
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
192
201
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
193
202
|
# conference room microphones.
|
|
@@ -205,12 +214,19 @@ module OpenAI
|
|
|
205
214
|
sig do
|
|
206
215
|
params(
|
|
207
216
|
|
|
217
|
+
strength: Float,
|
|
218
|
+
|
|
208
219
|
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
209
220
|
)
|
|
210
221
|
.returns(T.attached_class)
|
|
211
222
|
end
|
|
212
223
|
def self.new(
|
|
213
224
|
|
|
225
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
226
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
227
|
+
# update preserves the current strength.
|
|
228
|
+
strength: nil,
|
|
229
|
+
|
|
214
230
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
215
231
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
216
232
|
# conference room microphones.
|
|
@@ -221,7 +237,7 @@ module OpenAI
|
|
|
221
237
|
|
|
222
238
|
sig do
|
|
223
239
|
override.returns(
|
|
224
|
-
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
240
|
+
{strength: Float, type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
225
241
|
)
|
|
226
242
|
end
|
|
227
243
|
def to_hash
|
|
@@ -560,6 +560,15 @@ module OpenAI
|
|
|
560
560
|
)
|
|
561
561
|
end
|
|
562
562
|
|
|
563
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
564
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
565
|
+
# update preserves the current strength.
|
|
566
|
+
sig { returns(T.nilable(Float)) }
|
|
567
|
+
attr_reader :strength
|
|
568
|
+
|
|
569
|
+
sig { params(strength: Float).void }
|
|
570
|
+
attr_writer :strength
|
|
571
|
+
|
|
563
572
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
564
573
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
565
574
|
# conference room microphones.
|
|
@@ -577,12 +586,19 @@ module OpenAI
|
|
|
577
586
|
sig do
|
|
578
587
|
params(
|
|
579
588
|
|
|
589
|
+
strength: Float,
|
|
590
|
+
|
|
580
591
|
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
581
592
|
)
|
|
582
593
|
.returns(T.attached_class)
|
|
583
594
|
end
|
|
584
595
|
def self.new(
|
|
585
596
|
|
|
597
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
598
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
599
|
+
# update preserves the current strength.
|
|
600
|
+
strength: nil,
|
|
601
|
+
|
|
586
602
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
587
603
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
588
604
|
# conference room microphones.
|
|
@@ -593,7 +609,7 @@ module OpenAI
|
|
|
593
609
|
|
|
594
610
|
sig do
|
|
595
611
|
override.returns(
|
|
596
|
-
{type: OpenAI::Realtime::NoiseReductionType::TaggedSymbol}
|
|
612
|
+
{strength: Float, type: OpenAI::Realtime::NoiseReductionType::TaggedSymbol}
|
|
597
613
|
)
|
|
598
614
|
end
|
|
599
615
|
def to_hash
|
|
@@ -190,6 +190,15 @@ module OpenAI
|
|
|
190
190
|
)
|
|
191
191
|
end
|
|
192
192
|
|
|
193
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
194
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
195
|
+
# update preserves the current strength.
|
|
196
|
+
sig { returns(T.nilable(Float)) }
|
|
197
|
+
attr_reader :strength
|
|
198
|
+
|
|
199
|
+
sig { params(strength: Float).void }
|
|
200
|
+
attr_writer :strength
|
|
201
|
+
|
|
193
202
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
194
203
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
195
204
|
# conference room microphones.
|
|
@@ -207,12 +216,19 @@ module OpenAI
|
|
|
207
216
|
sig do
|
|
208
217
|
params(
|
|
209
218
|
|
|
219
|
+
strength: Float,
|
|
220
|
+
|
|
210
221
|
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
211
222
|
)
|
|
212
223
|
.returns(T.attached_class)
|
|
213
224
|
end
|
|
214
225
|
def self.new(
|
|
215
226
|
|
|
227
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
228
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
229
|
+
# update preserves the current strength.
|
|
230
|
+
strength: nil,
|
|
231
|
+
|
|
216
232
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
217
233
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
218
234
|
# conference room microphones.
|
|
@@ -223,7 +239,7 @@ module OpenAI
|
|
|
223
239
|
|
|
224
240
|
sig do
|
|
225
241
|
override.returns(
|
|
226
|
-
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
242
|
+
{strength: Float, type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
227
243
|
)
|
|
228
244
|
end
|
|
229
245
|
def to_hash
|
|
@@ -272,6 +272,15 @@ module OpenAI
|
|
|
272
272
|
)
|
|
273
273
|
end
|
|
274
274
|
|
|
275
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
276
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
277
|
+
# update preserves the current strength.
|
|
278
|
+
sig { returns(T.nilable(Float)) }
|
|
279
|
+
attr_reader :strength
|
|
280
|
+
|
|
281
|
+
sig { params(strength: Float).void }
|
|
282
|
+
attr_writer :strength
|
|
283
|
+
|
|
275
284
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
276
285
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
277
286
|
# conference room microphones.
|
|
@@ -285,12 +294,19 @@ module OpenAI
|
|
|
285
294
|
sig do
|
|
286
295
|
params(
|
|
287
296
|
|
|
297
|
+
strength: Float,
|
|
298
|
+
|
|
288
299
|
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
289
300
|
)
|
|
290
301
|
.returns(T.attached_class)
|
|
291
302
|
end
|
|
292
303
|
def self.new(
|
|
293
304
|
|
|
305
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
306
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
307
|
+
# update preserves the current strength.
|
|
308
|
+
strength: nil,
|
|
309
|
+
|
|
294
310
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
295
311
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
296
312
|
# conference room microphones.
|
|
@@ -301,7 +317,7 @@ module OpenAI
|
|
|
301
317
|
|
|
302
318
|
sig do
|
|
303
319
|
override.returns(
|
|
304
|
-
{type: OpenAI::Realtime::NoiseReductionType::TaggedSymbol}
|
|
320
|
+
{strength: Float, type: OpenAI::Realtime::NoiseReductionType::TaggedSymbol}
|
|
305
321
|
)
|
|
306
322
|
end
|
|
307
323
|
def to_hash
|
|
@@ -228,11 +228,22 @@ module OpenAI
|
|
|
228
228
|
sig { returns(OpenAI::Realtime::NoiseReductionType::OrSymbol) }
|
|
229
229
|
attr_accessor :type
|
|
230
230
|
|
|
231
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
232
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
233
|
+
# update preserves the current strength.
|
|
234
|
+
sig { returns(T.nilable(Float)) }
|
|
235
|
+
attr_reader :strength
|
|
236
|
+
|
|
237
|
+
sig { params(strength: Float).void }
|
|
238
|
+
attr_writer :strength
|
|
239
|
+
|
|
231
240
|
# Optional input noise reduction.
|
|
232
241
|
sig do
|
|
233
242
|
params(
|
|
234
243
|
|
|
235
|
-
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
244
|
+
type: OpenAI::Realtime::NoiseReductionType::OrSymbol,
|
|
245
|
+
|
|
246
|
+
strength: Float
|
|
236
247
|
)
|
|
237
248
|
.returns(T.attached_class)
|
|
238
249
|
end
|
|
@@ -241,14 +252,19 @@ module OpenAI
|
|
|
241
252
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
242
253
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
243
254
|
# conference room microphones.
|
|
255
|
+
type:,
|
|
256
|
+
|
|
257
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
258
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
259
|
+
# update preserves the current strength.
|
|
244
260
|
|
|
245
|
-
|
|
261
|
+
strength: nil
|
|
246
262
|
)
|
|
247
263
|
end
|
|
248
264
|
|
|
249
265
|
sig do
|
|
250
266
|
override.returns(
|
|
251
|
-
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
267
|
+
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol, strength: Float}
|
|
252
268
|
)
|
|
253
269
|
end
|
|
254
270
|
def to_hash
|
|
@@ -203,11 +203,22 @@ module OpenAI
|
|
|
203
203
|
sig { returns(OpenAI::Realtime::NoiseReductionType::OrSymbol) }
|
|
204
204
|
attr_accessor :type
|
|
205
205
|
|
|
206
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
207
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
208
|
+
# update preserves the current strength.
|
|
209
|
+
sig { returns(T.nilable(Float)) }
|
|
210
|
+
attr_reader :strength
|
|
211
|
+
|
|
212
|
+
sig { params(strength: Float).void }
|
|
213
|
+
attr_writer :strength
|
|
214
|
+
|
|
206
215
|
# Optional input noise reduction. Set to `null` to disable it.
|
|
207
216
|
sig do
|
|
208
217
|
params(
|
|
209
218
|
|
|
210
|
-
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
219
|
+
type: OpenAI::Realtime::NoiseReductionType::OrSymbol,
|
|
220
|
+
|
|
221
|
+
strength: Float
|
|
211
222
|
)
|
|
212
223
|
.returns(T.attached_class)
|
|
213
224
|
end
|
|
@@ -216,14 +227,19 @@ module OpenAI
|
|
|
216
227
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
217
228
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
218
229
|
# conference room microphones.
|
|
230
|
+
type:,
|
|
231
|
+
|
|
232
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
233
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
234
|
+
# update preserves the current strength.
|
|
219
235
|
|
|
220
|
-
|
|
236
|
+
strength: nil
|
|
221
237
|
)
|
|
222
238
|
end
|
|
223
239
|
|
|
224
240
|
sig do
|
|
225
241
|
override.returns(
|
|
226
|
-
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
242
|
+
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol, strength: Float}
|
|
227
243
|
)
|
|
228
244
|
end
|
|
229
245
|
def to_hash
|
|
@@ -193,11 +193,22 @@ module OpenAI
|
|
|
193
193
|
sig { returns(OpenAI::Realtime::NoiseReductionType::OrSymbol) }
|
|
194
194
|
attr_accessor :type
|
|
195
195
|
|
|
196
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
197
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
198
|
+
# update preserves the current strength.
|
|
199
|
+
sig { returns(T.nilable(Float)) }
|
|
200
|
+
attr_reader :strength
|
|
201
|
+
|
|
202
|
+
sig { params(strength: Float).void }
|
|
203
|
+
attr_writer :strength
|
|
204
|
+
|
|
196
205
|
# Optional input noise reduction. Set to `null` to disable it.
|
|
197
206
|
sig do
|
|
198
207
|
params(
|
|
199
208
|
|
|
200
|
-
type: OpenAI::Realtime::NoiseReductionType::OrSymbol
|
|
209
|
+
type: OpenAI::Realtime::NoiseReductionType::OrSymbol,
|
|
210
|
+
|
|
211
|
+
strength: Float
|
|
201
212
|
)
|
|
202
213
|
.returns(T.attached_class)
|
|
203
214
|
end
|
|
@@ -206,14 +217,19 @@ module OpenAI
|
|
|
206
217
|
# Type of noise reduction. `near_field` is for close-talking microphones such as
|
|
207
218
|
# headphones, `far_field` is for far-field microphones such as laptop or
|
|
208
219
|
# conference room microphones.
|
|
220
|
+
type:,
|
|
221
|
+
|
|
222
|
+
# Input noise suppression strength. Higher values apply more suppression. Defaults
|
|
223
|
+
# to 1 when noise reduction is first enabled. Omitting strength from a session
|
|
224
|
+
# update preserves the current strength.
|
|
209
225
|
|
|
210
|
-
|
|
226
|
+
strength: nil
|
|
211
227
|
)
|
|
212
228
|
end
|
|
213
229
|
|
|
214
230
|
sig do
|
|
215
231
|
override.returns(
|
|
216
|
-
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol}
|
|
232
|
+
{type: OpenAI::Realtime::NoiseReductionType::OrSymbol, strength: Float}
|
|
217
233
|
)
|
|
218
234
|
end
|
|
219
235
|
def to_hash
|
|
@@ -39,6 +39,12 @@ module OpenAI
|
|
|
39
39
|
sig { params(usage: OpenAI::Responses::ResponseUsage::OrHash).void }
|
|
40
40
|
attr_writer :usage
|
|
41
41
|
|
|
42
|
+
sig { returns(T.nilable(OpenAI::Responses::CompactedResponse::Image)) }
|
|
43
|
+
attr_reader :image
|
|
44
|
+
|
|
45
|
+
sig { params(image: OpenAI::Responses::CompactedResponse::Image::OrHash).void }
|
|
46
|
+
attr_writer :image
|
|
47
|
+
|
|
42
48
|
sig do
|
|
43
49
|
params(
|
|
44
50
|
|
|
@@ -81,6 +87,8 @@ module OpenAI
|
|
|
81
87
|
|
|
82
88
|
usage: OpenAI::Responses::ResponseUsage::OrHash,
|
|
83
89
|
|
|
90
|
+
image: OpenAI::Responses::CompactedResponse::Image::OrHash,
|
|
91
|
+
|
|
84
92
|
object: Symbol
|
|
85
93
|
)
|
|
86
94
|
.returns(T.attached_class)
|
|
@@ -101,6 +109,8 @@ module OpenAI
|
|
|
101
109
|
# tokens.
|
|
102
110
|
usage:,
|
|
103
111
|
|
|
112
|
+
image: nil,
|
|
113
|
+
|
|
104
114
|
# The object type. Always `response.compaction`.
|
|
105
115
|
|
|
106
116
|
object: :"response.compaction"
|
|
@@ -114,13 +124,69 @@ module OpenAI
|
|
|
114
124
|
created_at: Integer,
|
|
115
125
|
object: Symbol,
|
|
116
126
|
output: T::Array[OpenAI::Responses::ResponseOutputItem::Variants],
|
|
117
|
-
usage: OpenAI::Responses::ResponseUsage
|
|
127
|
+
usage: OpenAI::Responses::ResponseUsage,
|
|
128
|
+
image: OpenAI::Responses::CompactedResponse::Image
|
|
118
129
|
}
|
|
119
130
|
)
|
|
120
131
|
end
|
|
121
132
|
def to_hash
|
|
122
133
|
end
|
|
123
134
|
|
|
135
|
+
class Image < OpenAI::Internal::Type::BaseModel
|
|
136
|
+
OrHash = T.type_alias do
|
|
137
|
+
T.any(
|
|
138
|
+
OpenAI::Responses::CompactedResponse::Image,
|
|
139
|
+
OpenAI::Internal::AnyHash
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Effective image context optimization policy.
|
|
144
|
+
sig { returns(OpenAI::Responses::CompactedResponse::Image::ContextCompression::TaggedSymbol) }
|
|
145
|
+
attr_accessor :context_compression
|
|
146
|
+
|
|
147
|
+
sig do
|
|
148
|
+
params(
|
|
149
|
+
|
|
150
|
+
context_compression: OpenAI::Responses::CompactedResponse::Image::ContextCompression::OrSymbol
|
|
151
|
+
)
|
|
152
|
+
.returns(T.attached_class)
|
|
153
|
+
end
|
|
154
|
+
def self.new(
|
|
155
|
+
|
|
156
|
+
# Effective image context optimization policy.
|
|
157
|
+
|
|
158
|
+
context_compression:
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
sig do
|
|
163
|
+
override.returns(
|
|
164
|
+
{context_compression: OpenAI::Responses::CompactedResponse::Image::ContextCompression::TaggedSymbol}
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
def to_hash
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Effective image context optimization policy.
|
|
171
|
+
module ContextCompression
|
|
172
|
+
extend OpenAI::Internal::Type::Enum
|
|
173
|
+
|
|
174
|
+
TaggedSymbol = T.type_alias {
|
|
175
|
+
T.all(Symbol, OpenAI::Responses::CompactedResponse::Image::ContextCompression)
|
|
176
|
+
}
|
|
177
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
178
|
+
|
|
179
|
+
ENABLED = T.let(:enabled, OpenAI::Responses::CompactedResponse::Image::ContextCompression::TaggedSymbol)
|
|
180
|
+
DISABLED = T.let(:disabled, OpenAI::Responses::CompactedResponse::Image::ContextCompression::TaggedSymbol)
|
|
181
|
+
|
|
182
|
+
sig {
|
|
183
|
+
override.returns(T::Array[OpenAI::Responses::CompactedResponse::Image::ContextCompression::TaggedSymbol])
|
|
184
|
+
}
|
|
185
|
+
def self.values
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
124
190
|
end
|
|
125
191
|
|
|
126
192
|
end
|
|
@@ -147,6 +147,12 @@ module OpenAI
|
|
|
147
147
|
sig { params(conversation: T.nilable(OpenAI::Responses::Response::Conversation::OrHash)).void }
|
|
148
148
|
attr_writer :conversation
|
|
149
149
|
|
|
150
|
+
sig { returns(T.nilable(OpenAI::Responses::Response::Image)) }
|
|
151
|
+
attr_reader :image
|
|
152
|
+
|
|
153
|
+
sig { params(image: OpenAI::Responses::Response::Image::OrHash).void }
|
|
154
|
+
attr_writer :image
|
|
155
|
+
|
|
150
156
|
# An upper bound for the number of tokens that can be generated for a response,
|
|
151
157
|
# including visible output tokens and
|
|
152
158
|
# [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning).
|
|
@@ -449,6 +455,8 @@ module OpenAI
|
|
|
449
455
|
|
|
450
456
|
conversation: T.nilable(OpenAI::Responses::Response::Conversation::OrHash),
|
|
451
457
|
|
|
458
|
+
image: OpenAI::Responses::Response::Image::OrHash,
|
|
459
|
+
|
|
452
460
|
max_output_tokens: T.nilable(Integer),
|
|
453
461
|
|
|
454
462
|
max_tool_calls: T.nilable(Integer),
|
|
@@ -598,6 +606,8 @@ module OpenAI
|
|
|
598
606
|
# from this response were automatically added to this conversation.
|
|
599
607
|
conversation: nil,
|
|
600
608
|
|
|
609
|
+
image: nil,
|
|
610
|
+
|
|
601
611
|
# An upper bound for the number of tokens that can be generated for a response,
|
|
602
612
|
# including visible output tokens and
|
|
603
613
|
# [reasoning tokens](https://developers.openai.com/api/docs/guides/reasoning).
|
|
@@ -771,6 +781,7 @@ module OpenAI
|
|
|
771
781
|
background: T.nilable(T::Boolean),
|
|
772
782
|
completed_at: T.nilable(Float),
|
|
773
783
|
conversation: T.nilable(OpenAI::Responses::Response::Conversation),
|
|
784
|
+
image: OpenAI::Responses::Response::Image,
|
|
774
785
|
max_output_tokens: T.nilable(Integer),
|
|
775
786
|
max_tool_calls: T.nilable(Integer),
|
|
776
787
|
moderation: T.nilable(OpenAI::Responses::Response::Moderation),
|
|
@@ -1040,6 +1051,57 @@ module OpenAI
|
|
|
1040
1051
|
|
|
1041
1052
|
end
|
|
1042
1053
|
|
|
1054
|
+
class Image < OpenAI::Internal::Type::BaseModel
|
|
1055
|
+
OrHash = T.type_alias do
|
|
1056
|
+
T.any(
|
|
1057
|
+
OpenAI::Responses::Response::Image,
|
|
1058
|
+
OpenAI::Internal::AnyHash
|
|
1059
|
+
)
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
# Effective image context optimization policy.
|
|
1063
|
+
sig { returns(OpenAI::Responses::Response::Image::ContextCompression::TaggedSymbol) }
|
|
1064
|
+
attr_accessor :context_compression
|
|
1065
|
+
|
|
1066
|
+
sig do
|
|
1067
|
+
params(
|
|
1068
|
+
|
|
1069
|
+
context_compression: OpenAI::Responses::Response::Image::ContextCompression::OrSymbol
|
|
1070
|
+
)
|
|
1071
|
+
.returns(T.attached_class)
|
|
1072
|
+
end
|
|
1073
|
+
def self.new(
|
|
1074
|
+
|
|
1075
|
+
# Effective image context optimization policy.
|
|
1076
|
+
|
|
1077
|
+
context_compression:
|
|
1078
|
+
)
|
|
1079
|
+
end
|
|
1080
|
+
|
|
1081
|
+
sig do
|
|
1082
|
+
override.returns(
|
|
1083
|
+
{context_compression: OpenAI::Responses::Response::Image::ContextCompression::TaggedSymbol}
|
|
1084
|
+
)
|
|
1085
|
+
end
|
|
1086
|
+
def to_hash
|
|
1087
|
+
end
|
|
1088
|
+
|
|
1089
|
+
# Effective image context optimization policy.
|
|
1090
|
+
module ContextCompression
|
|
1091
|
+
extend OpenAI::Internal::Type::Enum
|
|
1092
|
+
|
|
1093
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Responses::Response::Image::ContextCompression) }
|
|
1094
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1095
|
+
|
|
1096
|
+
ENABLED = T.let(:enabled, OpenAI::Responses::Response::Image::ContextCompression::TaggedSymbol)
|
|
1097
|
+
DISABLED = T.let(:disabled, OpenAI::Responses::Response::Image::ContextCompression::TaggedSymbol)
|
|
1098
|
+
|
|
1099
|
+
sig { override.returns(T::Array[OpenAI::Responses::Response::Image::ContextCompression::TaggedSymbol]) }
|
|
1100
|
+
def self.values
|
|
1101
|
+
end
|
|
1102
|
+
end
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1043
1105
|
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
1044
1106
|
OrHash = T.type_alias do
|
|
1045
1107
|
T.any(
|