openai 0.117.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 +23 -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/admin/organization/projects/project_optional_service_tier.rb +24 -0
- data/lib/openai/models/admin/organization/projects/project_service_tier_settings.rb +88 -0
- data/lib/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rb +29 -0
- data/lib/openai/models/admin/organization/projects/service_tier_setting_update_params.rb +92 -0
- 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 +35 -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_response_usage.rb +33 -1
- data/lib/openai/models/beta/beta_responses_client_event.rb +58 -10
- data/lib/openai/models/beta/beta_tool.rb +164 -13
- data/lib/openai/models/beta/response_compact_params.rb +47 -4
- data/lib/openai/models/beta/response_create_params.rb +54 -10
- data/lib/openai/models/beta/session_turn_error.rb +3 -0
- data/lib/openai/models/chat/completion_create_params.rb +3 -3
- 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 +35 -1
- data/lib/openai/models/responses/response_compact_params.rb +53 -4
- data/lib/openai/models/responses/response_create_params.rb +57 -10
- 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/response_usage.rb +33 -1
- data/lib/openai/models/responses/responses_client_event.rb +58 -10
- 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/service_tier_settings.rb +77 -0
- data/lib/openai/resources/admin/organization/projects.rb +6 -0
- data/lib/openai/resources/admin/organization.rb +6 -6
- data/lib/openai/resources/beta/responses.rb +18 -9
- data/lib/openai/resources/chat/completions.rb +2 -2
- data/lib/openai/resources/images.rb +102 -18
- data/lib/openai/resources/responses.rb +15 -6
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +5 -0
- data/rbi/openai/models/admin/organization/projects/project_optional_service_tier.rbi +45 -0
- data/rbi/openai/models/admin/organization/projects/project_service_tier_settings.rbi +143 -0
- data/rbi/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbi +63 -0
- data/rbi/openai/models/admin/organization/projects/service_tier_setting_update_params.rbi +183 -0
- 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 +63 -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_response_usage.rbi +66 -3
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +118 -9
- data/rbi/openai/models/beta/beta_tool.rbi +245 -13
- data/rbi/openai/models/beta/response_compact_params.rbi +84 -3
- data/rbi/openai/models/beta/response_create_params.rbi +91 -9
- data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
- data/rbi/openai/models/chat/completion_create_params.rbi +3 -3
- 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 +63 -0
- data/rbi/openai/models/responses/response_compact_params.rbi +91 -3
- data/rbi/openai/models/responses/response_create_params.rbi +97 -9
- 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/response_usage.rbi +66 -3
- data/rbi/openai/models/responses/responses_client_event.rbi +118 -9
- 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/service_tier_settings.rbi +67 -0
- data/rbi/openai/resources/admin/organization/projects.rbi +3 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -3
- data/rbi/openai/resources/beta/responses.rbi +15 -6
- data/rbi/openai/resources/chat/completions.rbi +2 -2
- data/rbi/openai/resources/images.rbi +98 -14
- data/rbi/openai/resources/responses.rbi +14 -3
- data/sig/openai/models/admin/organization/projects/project_optional_service_tier.rbs +23 -0
- data/sig/openai/models/admin/organization/projects/project_service_tier_settings.rbs +72 -0
- data/sig/openai/models/admin/organization/projects/service_tier_setting_retrieve_params.rbs +32 -0
- data/sig/openai/models/admin/organization/projects/service_tier_setting_update_params.rbs +91 -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 +42 -1
- 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_response_usage.rbs +40 -3
- data/sig/openai/models/beta/beta_responses_client_event.rbs +67 -10
- data/sig/openai/models/beta/beta_tool.rbs +188 -15
- data/sig/openai/models/beta/response_compact_params.rbs +58 -2
- data/sig/openai/models/beta/response_create_params.rbs +67 -10
- data/sig/openai/models/beta/session_turn_error.rbs +4 -0
- data/sig/openai/models/chat/completion_create_params.rbs +3 -3
- 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 +42 -1
- data/sig/openai/models/responses/response_compact_params.rbs +60 -2
- data/sig/openai/models/responses/response_create_params.rbs +67 -10
- 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/response_usage.rbs +40 -3
- data/sig/openai/models/responses/responses_client_event.rbs +67 -10
- 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/service_tier_settings.rbs +25 -0
- data/sig/openai/resources/admin/organization/projects.rbs +2 -0
- 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 +16 -1
|
@@ -32,11 +32,32 @@ module OpenAI
|
|
|
32
32
|
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Background::OrSymbol)) }
|
|
33
33
|
attr_accessor :background
|
|
34
34
|
|
|
35
|
+
# Computation spent planning the image, independently of rendering quality. Uses
|
|
36
|
+
# the image model's configured default when omitted. For SVG output, controls the
|
|
37
|
+
# reference image, independently of the SVG author's reasoning.
|
|
38
|
+
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Complexity::OrSymbol)) }
|
|
39
|
+
attr_accessor :complexity
|
|
40
|
+
|
|
41
|
+
# Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
|
|
42
|
+
# 9 when omitted. Only supported with output_format=gif. The requested size must
|
|
43
|
+
# satisfy the selected model's GIF size limits. GIF output does not support
|
|
44
|
+
# streaming, partial images, masks, or custom output compression. Requires access
|
|
45
|
+
# to the GIF preview for the selected model.
|
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
|
47
|
+
attr_accessor :frame_count
|
|
48
|
+
|
|
49
|
+
# Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
|
|
50
|
+
# GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
|
|
51
|
+
# per frame. Only supported with output_format=gif.
|
|
52
|
+
sig { returns(T.nilable(Integer)) }
|
|
53
|
+
attr_accessor :frame_duration_ms
|
|
54
|
+
|
|
35
55
|
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
36
56
|
# Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
37
57
|
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
38
58
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
39
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
59
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
60
|
+
# `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
|
|
40
61
|
#
|
|
41
62
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
42
63
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -60,7 +81,7 @@ module OpenAI
|
|
|
60
81
|
attr_accessor :output_compression
|
|
61
82
|
|
|
62
83
|
# The format in which the generated images are returned. This parameter is only
|
|
63
|
-
# supported for the GPT image models.
|
|
84
|
+
# supported for the GPT image models.
|
|
64
85
|
sig { returns(T.nilable(OpenAI::ImageGenerateParams::OutputFormat::OrSymbol)) }
|
|
65
86
|
attr_accessor :output_format
|
|
66
87
|
|
|
@@ -115,6 +136,18 @@ module OpenAI
|
|
|
115
136
|
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Style::OrSymbol)) }
|
|
116
137
|
attr_accessor :style
|
|
117
138
|
|
|
139
|
+
# Selects the model and reasoning effort used to author SVG output. Requires
|
|
140
|
+
# output_format=svg and access to SVG model selection. When model selection is
|
|
141
|
+
# enabled, supply svg.model. When model selection is disabled, omit this object.
|
|
142
|
+
# The top-level model selects the image model that creates the reference image.
|
|
143
|
+
# SVG generation requires n=1 and does not support streaming, partial images,
|
|
144
|
+
# prompt_rewriter, or output_compression. SVG edits are not supported.
|
|
145
|
+
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Svg)) }
|
|
146
|
+
attr_reader :svg
|
|
147
|
+
|
|
148
|
+
sig { params(svg: T.nilable(OpenAI::ImageGenerateParams::Svg::OrHash)).void }
|
|
149
|
+
attr_writer :svg
|
|
150
|
+
|
|
118
151
|
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
119
152
|
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
120
153
|
# empty.
|
|
@@ -132,6 +165,12 @@ module OpenAI
|
|
|
132
165
|
|
|
133
166
|
background: T.nilable(OpenAI::ImageGenerateParams::Background::OrSymbol),
|
|
134
167
|
|
|
168
|
+
complexity: T.nilable(OpenAI::ImageGenerateParams::Complexity::OrSymbol),
|
|
169
|
+
|
|
170
|
+
frame_count: T.nilable(Integer),
|
|
171
|
+
|
|
172
|
+
frame_duration_ms: T.nilable(Integer),
|
|
173
|
+
|
|
135
174
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
136
175
|
|
|
137
176
|
moderation: T.nilable(OpenAI::ImageGenerateParams::Moderation::OrSymbol),
|
|
@@ -154,6 +193,8 @@ module OpenAI
|
|
|
154
193
|
|
|
155
194
|
style: T.nilable(OpenAI::ImageGenerateParams::Style::OrSymbol),
|
|
156
195
|
|
|
196
|
+
svg: T.nilable(OpenAI::ImageGenerateParams::Svg::OrHash),
|
|
197
|
+
|
|
157
198
|
user: String,
|
|
158
199
|
|
|
159
200
|
request_options: OpenAI::RequestOptions::OrHash
|
|
@@ -177,11 +218,29 @@ module OpenAI
|
|
|
177
218
|
# set the output format to `png` or `webp`.
|
|
178
219
|
background: nil,
|
|
179
220
|
|
|
221
|
+
# Computation spent planning the image, independently of rendering quality. Uses
|
|
222
|
+
# the image model's configured default when omitted. For SVG output, controls the
|
|
223
|
+
# reference image, independently of the SVG author's reasoning.
|
|
224
|
+
complexity: nil,
|
|
225
|
+
|
|
226
|
+
# Number of frames for GIF output. Accepts integers from 2 through 16. Defaults to
|
|
227
|
+
# 9 when omitted. Only supported with output_format=gif. The requested size must
|
|
228
|
+
# satisfy the selected model's GIF size limits. GIF output does not support
|
|
229
|
+
# streaming, partial images, masks, or custom output compression. Requires access
|
|
230
|
+
# to the GIF preview for the selected model.
|
|
231
|
+
frame_count: nil,
|
|
232
|
+
|
|
233
|
+
# Requested delay per GIF frame, in milliseconds. Defaults to 200 when omitted.
|
|
234
|
+
# GIF output rounds to the nearest 10 ms and caps the encoded delay at 655,350 ms
|
|
235
|
+
# per frame. Only supported with output_format=gif.
|
|
236
|
+
frame_duration_ms: nil,
|
|
237
|
+
|
|
180
238
|
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
181
239
|
# Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
182
240
|
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
183
241
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
184
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
242
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
243
|
+
# `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
|
|
185
244
|
#
|
|
186
245
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
187
246
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -201,7 +260,7 @@ module OpenAI
|
|
|
201
260
|
output_compression: nil,
|
|
202
261
|
|
|
203
262
|
# The format in which the generated images are returned. This parameter is only
|
|
204
|
-
# supported for the GPT image models.
|
|
263
|
+
# supported for the GPT image models.
|
|
205
264
|
output_format: nil,
|
|
206
265
|
|
|
207
266
|
# The number of partial images to generate. This parameter is used for streaming
|
|
@@ -249,6 +308,14 @@ module OpenAI
|
|
|
249
308
|
# models; describe the desired style in the prompt instead.
|
|
250
309
|
style: nil,
|
|
251
310
|
|
|
311
|
+
# Selects the model and reasoning effort used to author SVG output. Requires
|
|
312
|
+
# output_format=svg and access to SVG model selection. When model selection is
|
|
313
|
+
# enabled, supply svg.model. When model selection is disabled, omit this object.
|
|
314
|
+
# The top-level model selects the image model that creates the reference image.
|
|
315
|
+
# SVG generation requires n=1 and does not support streaming, partial images,
|
|
316
|
+
# prompt_rewriter, or output_compression. SVG edits are not supported.
|
|
317
|
+
svg: nil,
|
|
318
|
+
|
|
252
319
|
# Deprecated: use `safety_identifier` instead. This parameter remains accepted for
|
|
253
320
|
# backward compatibility and is used when `safety_identifier` is omitted, null, or
|
|
254
321
|
# empty.
|
|
@@ -264,6 +331,9 @@ module OpenAI
|
|
|
264
331
|
{
|
|
265
332
|
prompt: String,
|
|
266
333
|
background: T.nilable(OpenAI::ImageGenerateParams::Background::OrSymbol),
|
|
334
|
+
complexity: T.nilable(OpenAI::ImageGenerateParams::Complexity::OrSymbol),
|
|
335
|
+
frame_count: T.nilable(Integer),
|
|
336
|
+
frame_duration_ms: T.nilable(Integer),
|
|
267
337
|
model: T.nilable(T.any(String, OpenAI::ImageModel::OrSymbol)),
|
|
268
338
|
moderation: T.nilable(OpenAI::ImageGenerateParams::Moderation::OrSymbol),
|
|
269
339
|
n: T.nilable(Integer),
|
|
@@ -275,6 +345,7 @@ module OpenAI
|
|
|
275
345
|
safety_identifier: T.nilable(String),
|
|
276
346
|
size: T.nilable(T.any(String, OpenAI::ImageGenerateParams::Size::OrSymbol)),
|
|
277
347
|
style: T.nilable(OpenAI::ImageGenerateParams::Style::OrSymbol),
|
|
348
|
+
svg: T.nilable(OpenAI::ImageGenerateParams::Svg),
|
|
278
349
|
user: String,
|
|
279
350
|
request_options: OpenAI::RequestOptions
|
|
280
351
|
}
|
|
@@ -307,11 +378,30 @@ module OpenAI
|
|
|
307
378
|
end
|
|
308
379
|
end
|
|
309
380
|
|
|
381
|
+
# Computation spent planning the image, independently of rendering quality. Uses
|
|
382
|
+
# the image model's configured default when omitted. For SVG output, controls the
|
|
383
|
+
# reference image, independently of the SVG author's reasoning.
|
|
384
|
+
module Complexity
|
|
385
|
+
extend OpenAI::Internal::Type::Enum
|
|
386
|
+
|
|
387
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageGenerateParams::Complexity) }
|
|
388
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
389
|
+
|
|
390
|
+
LOW = T.let(:low, OpenAI::ImageGenerateParams::Complexity::TaggedSymbol)
|
|
391
|
+
MEDIUM = T.let(:medium, OpenAI::ImageGenerateParams::Complexity::TaggedSymbol)
|
|
392
|
+
HIGH = T.let(:high, OpenAI::ImageGenerateParams::Complexity::TaggedSymbol)
|
|
393
|
+
|
|
394
|
+
sig { override.returns(T::Array[OpenAI::ImageGenerateParams::Complexity::TaggedSymbol]) }
|
|
395
|
+
def self.values
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
|
|
310
399
|
# The GPT image model to use for image generation. Specify a model explicitly.
|
|
311
400
|
# Supported models include `gpt-image-1-mini`, `gpt-image-1.5`, `gpt-image-2`,
|
|
312
401
|
# `gpt-image-2-2026-04-21`, `gpt-image-2.5-sunburst`,
|
|
313
402
|
# `gpt-image-2.5-sunburst-2026-09-08`, `gpt-image-2.5-flare`,
|
|
314
|
-
# `gpt-image-2.5-flare-2026-09-08`,
|
|
403
|
+
# `gpt-image-2.5-flare-2026-09-08`, `gpt-image-2.6-sunburst`,
|
|
404
|
+
# `gpt-image-2.6-flare`, and `chatgpt-image-latest`.
|
|
315
405
|
#
|
|
316
406
|
# `gpt-image-1` was shut down on October 23, 2026. Use `gpt-image-2.5-sunburst` or
|
|
317
407
|
# `gpt-image-2.5-flare` instead.
|
|
@@ -344,7 +434,7 @@ module OpenAI
|
|
|
344
434
|
end
|
|
345
435
|
|
|
346
436
|
# The format in which the generated images are returned. This parameter is only
|
|
347
|
-
# supported for the GPT image models.
|
|
437
|
+
# supported for the GPT image models.
|
|
348
438
|
module OutputFormat
|
|
349
439
|
extend OpenAI::Internal::Type::Enum
|
|
350
440
|
|
|
@@ -354,6 +444,8 @@ module OpenAI
|
|
|
354
444
|
PNG = T.let(:png, OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol)
|
|
355
445
|
JPEG = T.let(:jpeg, OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol)
|
|
356
446
|
WEBP = T.let(:webp, OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol)
|
|
447
|
+
GIF = T.let(:gif, OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol)
|
|
448
|
+
SVG = T.let(:svg, OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol)
|
|
357
449
|
|
|
358
450
|
sig { override.returns(T::Array[OpenAI::ImageGenerateParams::OutputFormat::TaggedSymbol]) }
|
|
359
451
|
def self.values
|
|
@@ -455,6 +547,126 @@ module OpenAI
|
|
|
455
547
|
end
|
|
456
548
|
end
|
|
457
549
|
|
|
550
|
+
class Svg < OpenAI::Internal::Type::BaseModel
|
|
551
|
+
OrHash = T.type_alias do
|
|
552
|
+
T.any(
|
|
553
|
+
OpenAI::ImageGenerateParams::Svg,
|
|
554
|
+
OpenAI::Internal::AnyHash
|
|
555
|
+
)
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
# Model used to author the SVG. Required when SVG model selection is enabled.
|
|
559
|
+
sig { returns(String) }
|
|
560
|
+
attr_accessor :model
|
|
561
|
+
|
|
562
|
+
# Reasoning settings for the SVG author, independent of image complexity. Omitted
|
|
563
|
+
# or null effort uses the author model's default. Supported efforts depend on the
|
|
564
|
+
# selected author model.
|
|
565
|
+
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning)) }
|
|
566
|
+
attr_reader :reasoning
|
|
567
|
+
|
|
568
|
+
sig { params(reasoning: T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning::OrHash)).void }
|
|
569
|
+
attr_writer :reasoning
|
|
570
|
+
|
|
571
|
+
# Selects the model and reasoning effort used to author SVG output. Requires
|
|
572
|
+
# output_format=svg and access to SVG model selection. When model selection is
|
|
573
|
+
# enabled, supply svg.model. When model selection is disabled, omit this object.
|
|
574
|
+
# The top-level model selects the image model that creates the reference image.
|
|
575
|
+
# SVG generation requires n=1 and does not support streaming, partial images,
|
|
576
|
+
# prompt_rewriter, or output_compression. SVG edits are not supported.
|
|
577
|
+
sig do
|
|
578
|
+
params(
|
|
579
|
+
|
|
580
|
+
model: String,
|
|
581
|
+
|
|
582
|
+
reasoning: T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning::OrHash)
|
|
583
|
+
)
|
|
584
|
+
.returns(T.attached_class)
|
|
585
|
+
end
|
|
586
|
+
def self.new(
|
|
587
|
+
|
|
588
|
+
# Model used to author the SVG. Required when SVG model selection is enabled.
|
|
589
|
+
model:,
|
|
590
|
+
|
|
591
|
+
# Reasoning settings for the SVG author, independent of image complexity. Omitted
|
|
592
|
+
# or null effort uses the author model's default. Supported efforts depend on the
|
|
593
|
+
# selected author model.
|
|
594
|
+
|
|
595
|
+
reasoning: nil
|
|
596
|
+
)
|
|
597
|
+
end
|
|
598
|
+
|
|
599
|
+
sig do
|
|
600
|
+
override.returns(
|
|
601
|
+
{model: String, reasoning: T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning)}
|
|
602
|
+
)
|
|
603
|
+
end
|
|
604
|
+
def to_hash
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
class Reasoning < OpenAI::Internal::Type::BaseModel
|
|
608
|
+
OrHash = T.type_alias do
|
|
609
|
+
T.any(
|
|
610
|
+
OpenAI::ImageGenerateParams::Svg::Reasoning,
|
|
611
|
+
OpenAI::Internal::AnyHash
|
|
612
|
+
)
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
# Controls how much effort the SVG author spends on reasoning. Uses the author
|
|
616
|
+
# model's default when omitted or null.
|
|
617
|
+
sig { returns(T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::OrSymbol)) }
|
|
618
|
+
attr_accessor :effort
|
|
619
|
+
|
|
620
|
+
# Reasoning settings for the SVG author, independent of image complexity. Omitted
|
|
621
|
+
# or null effort uses the author model's default. Supported efforts depend on the
|
|
622
|
+
# selected author model.
|
|
623
|
+
sig do
|
|
624
|
+
params(
|
|
625
|
+
|
|
626
|
+
effort: T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::OrSymbol)
|
|
627
|
+
)
|
|
628
|
+
.returns(T.attached_class)
|
|
629
|
+
end
|
|
630
|
+
def self.new(
|
|
631
|
+
|
|
632
|
+
# Controls how much effort the SVG author spends on reasoning. Uses the author
|
|
633
|
+
# model's default when omitted or null.
|
|
634
|
+
|
|
635
|
+
effort: nil
|
|
636
|
+
)
|
|
637
|
+
end
|
|
638
|
+
|
|
639
|
+
sig do
|
|
640
|
+
override.returns(
|
|
641
|
+
{effort: T.nilable(OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::OrSymbol)}
|
|
642
|
+
)
|
|
643
|
+
end
|
|
644
|
+
def to_hash
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
# Controls how much effort the SVG author spends on reasoning. Uses the author
|
|
648
|
+
# model's default when omitted or null.
|
|
649
|
+
module Effort
|
|
650
|
+
extend OpenAI::Internal::Type::Enum
|
|
651
|
+
|
|
652
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort) }
|
|
653
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
654
|
+
|
|
655
|
+
NONE = T.let(:none, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
656
|
+
MINIMAL = T.let(:minimal, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
657
|
+
LOW = T.let(:low, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
658
|
+
MEDIUM = T.let(:medium, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
659
|
+
HIGH = T.let(:high, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
660
|
+
XHIGH = T.let(:xhigh, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
661
|
+
MAX = T.let(:max, OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol)
|
|
662
|
+
|
|
663
|
+
sig { override.returns(T::Array[OpenAI::ImageGenerateParams::Svg::Reasoning::Effort::TaggedSymbol]) }
|
|
664
|
+
def self.values
|
|
665
|
+
end
|
|
666
|
+
end
|
|
667
|
+
end
|
|
668
|
+
end
|
|
669
|
+
|
|
458
670
|
end
|
|
459
671
|
|
|
460
672
|
end
|
|
@@ -16,6 +16,8 @@ module OpenAI
|
|
|
16
16
|
GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let(:"gpt-image-2.5-sunburst-2026-09-08", OpenAI::ImageModel::TaggedSymbol)
|
|
17
17
|
GPT_IMAGE_2_5_FLARE = T.let(:"gpt-image-2.5-flare", OpenAI::ImageModel::TaggedSymbol)
|
|
18
18
|
GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let(:"gpt-image-2.5-flare-2026-09-08", OpenAI::ImageModel::TaggedSymbol)
|
|
19
|
+
GPT_IMAGE_2_6_SUNBURST = T.let(:"gpt-image-2.6-sunburst", OpenAI::ImageModel::TaggedSymbol)
|
|
20
|
+
GPT_IMAGE_2_6_FLARE = T.let(:"gpt-image-2.6-flare", OpenAI::ImageModel::TaggedSymbol)
|
|
19
21
|
GPT_IMAGE_1 = T.let(:"gpt-image-1", OpenAI::ImageModel::TaggedSymbol)
|
|
20
22
|
GPT_IMAGE_1_MINI = T.let(:"gpt-image-1-mini", OpenAI::ImageModel::TaggedSymbol)
|
|
21
23
|
CHATGPT_IMAGE_LATEST = T.let(:"chatgpt-image-latest", OpenAI::ImageModel::TaggedSymbol)
|
|
@@ -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
|