openai 0.100.0 → 0.101.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 +7 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
- data/lib/openai/models/decision.rb +313 -0
- data/lib/openai/models/decision_create_params.rb +233 -0
- data/lib/openai/models/decision_input_image.rb +53 -0
- data/lib/openai/models/decision_input_message.rb +60 -0
- data/lib/openai/models/decision_input_part.rb +20 -0
- data/lib/openai/models/decision_input_text.rb +21 -0
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
- data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
- data/lib/openai/models.rb +12 -0
- data/lib/openai/resources/decisions.rb +59 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +9 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
- data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models/decision.rbi +586 -0
- data/rbi/openai/models/decision_create_params.rbi +435 -0
- data/rbi/openai/models/decision_input_image.rbi +81 -0
- data/rbi/openai/models/decision_input_message.rbi +96 -0
- data/rbi/openai/models/decision_input_part.rbi +24 -0
- data/rbi/openai/models/decision_input_text.rbi +49 -0
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
- data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
- data/rbi/openai/models.rbi +12 -0
- data/rbi/openai/resources/decisions.rbi +57 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
- data/sig/openai/models/decision.rbs +296 -0
- data/sig/openai/models/decision_create_params.rbs +227 -0
- data/sig/openai/models/decision_input_image.rbs +51 -0
- data/sig/openai/models/decision_input_message.rbs +57 -0
- data/sig/openai/models/decision_input_part.rbs +12 -0
- data/sig/openai/models/decision_input_text.rbs +15 -0
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
- data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
- data/sig/openai/models.rbs +12 -0
- data/sig/openai/resources/decisions.rbs +15 -0
- metadata +28 -1
|
@@ -25,14 +25,14 @@ module OpenAI
|
|
|
25
25
|
OpenAI::Beta::BetaFileSearchTool,
|
|
26
26
|
OpenAI::Beta::BetaComputerTool,
|
|
27
27
|
OpenAI::Beta::BetaComputerUsePreviewTool,
|
|
28
|
-
OpenAI::Beta::
|
|
29
|
-
OpenAI::Beta::
|
|
30
|
-
OpenAI::Beta::
|
|
31
|
-
OpenAI::Beta::
|
|
32
|
-
OpenAI::Beta::
|
|
28
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp,
|
|
29
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter,
|
|
30
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling,
|
|
31
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration,
|
|
32
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::LocalShell,
|
|
33
33
|
OpenAI::Beta::BetaFunctionShellTool,
|
|
34
34
|
OpenAI::Beta::BetaCustomTool,
|
|
35
|
-
OpenAI::Beta::
|
|
35
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool,
|
|
36
36
|
OpenAI::Beta::BetaToolSearchTool,
|
|
37
37
|
OpenAI::Beta::BetaApplyPatchTool,
|
|
38
38
|
OpenAI::Beta::BetaWebSearchTool,
|
|
@@ -82,14 +82,14 @@ module OpenAI
|
|
|
82
82
|
OpenAI::Beta::BetaFileSearchTool::OrHash,
|
|
83
83
|
OpenAI::Beta::BetaComputerTool::OrHash,
|
|
84
84
|
OpenAI::Beta::BetaComputerUsePreviewTool::OrHash,
|
|
85
|
-
OpenAI::Beta::
|
|
86
|
-
OpenAI::Beta::
|
|
87
|
-
OpenAI::Beta::
|
|
88
|
-
OpenAI::Beta::
|
|
89
|
-
OpenAI::Beta::
|
|
85
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::OrHash,
|
|
86
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::OrHash,
|
|
87
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling::OrHash,
|
|
88
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OrHash,
|
|
89
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::LocalShell::OrHash,
|
|
90
90
|
OpenAI::Beta::BetaFunctionShellTool::OrHash,
|
|
91
91
|
OpenAI::Beta::BetaCustomTool::OrHash,
|
|
92
|
-
OpenAI::Beta::
|
|
92
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool::OrHash,
|
|
93
93
|
OpenAI::Beta::BetaToolSearchTool::OrHash,
|
|
94
94
|
OpenAI::Beta::BetaApplyPatchTool::OrHash,
|
|
95
95
|
OpenAI::Beta::BetaWebSearchTool::OrHash,
|
|
@@ -146,14 +146,14 @@ module OpenAI
|
|
|
146
146
|
OpenAI::Beta::BetaFileSearchTool,
|
|
147
147
|
OpenAI::Beta::BetaComputerTool,
|
|
148
148
|
OpenAI::Beta::BetaComputerUsePreviewTool,
|
|
149
|
-
OpenAI::Beta::
|
|
150
|
-
OpenAI::Beta::
|
|
151
|
-
OpenAI::Beta::
|
|
152
|
-
OpenAI::Beta::
|
|
153
|
-
OpenAI::Beta::
|
|
149
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp,
|
|
150
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter,
|
|
151
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling,
|
|
152
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration,
|
|
153
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::LocalShell,
|
|
154
154
|
OpenAI::Beta::BetaFunctionShellTool,
|
|
155
155
|
OpenAI::Beta::BetaCustomTool,
|
|
156
|
-
OpenAI::Beta::
|
|
156
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool,
|
|
157
157
|
OpenAI::Beta::BetaToolSearchTool,
|
|
158
158
|
OpenAI::Beta::BetaApplyPatchTool,
|
|
159
159
|
OpenAI::Beta::BetaWebSearchTool,
|
|
@@ -172,6 +172,1881 @@ module OpenAI
|
|
|
172
172
|
def to_hash
|
|
173
173
|
end
|
|
174
174
|
|
|
175
|
+
# A tool definition returned by a tool search output.
|
|
176
|
+
module Tool
|
|
177
|
+
extend OpenAI::Internal::Type::Union
|
|
178
|
+
|
|
179
|
+
Variants = T.type_alias {
|
|
180
|
+
T.any(
|
|
181
|
+
OpenAI::Beta::BetaFunctionTool,
|
|
182
|
+
OpenAI::Beta::BetaFileSearchTool,
|
|
183
|
+
OpenAI::Beta::BetaComputerTool,
|
|
184
|
+
OpenAI::Beta::BetaComputerUsePreviewTool,
|
|
185
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp,
|
|
186
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter,
|
|
187
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling,
|
|
188
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration,
|
|
189
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::LocalShell,
|
|
190
|
+
OpenAI::Beta::BetaFunctionShellTool,
|
|
191
|
+
OpenAI::Beta::BetaCustomTool,
|
|
192
|
+
OpenAI::Beta::BetaToolSearchOutputNamespaceTool,
|
|
193
|
+
OpenAI::Beta::BetaToolSearchTool,
|
|
194
|
+
OpenAI::Beta::BetaApplyPatchTool,
|
|
195
|
+
OpenAI::Beta::BetaWebSearchTool,
|
|
196
|
+
OpenAI::Beta::BetaWebSearchPreviewTool
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
class Mcp < OpenAI::Internal::Type::BaseModel
|
|
201
|
+
OrHash = T.type_alias do
|
|
202
|
+
T.any(
|
|
203
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp,
|
|
204
|
+
OpenAI::Internal::AnyHash
|
|
205
|
+
)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# A label for this MCP server, used to identify it in tool calls.
|
|
209
|
+
sig { returns(String) }
|
|
210
|
+
attr_accessor :server_label
|
|
211
|
+
|
|
212
|
+
# The type of the MCP tool. Always `mcp`.
|
|
213
|
+
sig { returns(Symbol) }
|
|
214
|
+
attr_accessor :type
|
|
215
|
+
|
|
216
|
+
# The tool invocation context(s).
|
|
217
|
+
sig {
|
|
218
|
+
returns(
|
|
219
|
+
T.nilable(
|
|
220
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::OrSymbol]
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
attr_accessor :allowed_callers
|
|
225
|
+
|
|
226
|
+
# List of allowed tool names or a filter object.
|
|
227
|
+
sig {
|
|
228
|
+
returns(
|
|
229
|
+
T.nilable(
|
|
230
|
+
T.any(
|
|
231
|
+
T::Array[String],
|
|
232
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter
|
|
233
|
+
)
|
|
234
|
+
)
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
attr_accessor :allowed_tools
|
|
238
|
+
|
|
239
|
+
# An OAuth access token that can be used with a remote MCP server, either with a
|
|
240
|
+
# custom MCP server URL or a service connector. Your application must handle the
|
|
241
|
+
# OAuth authorization flow and provide the token here.
|
|
242
|
+
sig { returns(T.nilable(String)) }
|
|
243
|
+
attr_reader :authorization
|
|
244
|
+
|
|
245
|
+
sig { params(authorization: String).void }
|
|
246
|
+
attr_writer :authorization
|
|
247
|
+
|
|
248
|
+
# Identifier for service connectors, like those available in ChatGPT. One of
|
|
249
|
+
# `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
|
|
250
|
+
# service connectors
|
|
251
|
+
# [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
|
|
252
|
+
#
|
|
253
|
+
# This field is deprecated for models released after September 1, 2026. Use
|
|
254
|
+
# `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
|
|
255
|
+
# through a Secure MCP Tunnel.
|
|
256
|
+
#
|
|
257
|
+
# Currently supported `connector_id` values are:
|
|
258
|
+
#
|
|
259
|
+
# - Dropbox: `connector_dropbox`
|
|
260
|
+
# - Gmail: `connector_gmail`
|
|
261
|
+
# - Google Calendar: `connector_googlecalendar`
|
|
262
|
+
# - Google Drive: `connector_googledrive`
|
|
263
|
+
# - Microsoft Teams: `connector_microsoftteams`
|
|
264
|
+
# - Outlook Calendar: `connector_outlookcalendar`
|
|
265
|
+
# - Outlook Email: `connector_outlookemail`
|
|
266
|
+
# - SharePoint: `connector_sharepoint`
|
|
267
|
+
sig {
|
|
268
|
+
returns(T.nilable(OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::OrSymbol))
|
|
269
|
+
}
|
|
270
|
+
attr_reader :connector_id
|
|
271
|
+
|
|
272
|
+
sig {
|
|
273
|
+
params(
|
|
274
|
+
connector_id: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::OrSymbol
|
|
275
|
+
)
|
|
276
|
+
.void
|
|
277
|
+
}
|
|
278
|
+
attr_writer :connector_id
|
|
279
|
+
|
|
280
|
+
# Whether this MCP tool is deferred and discovered via tool search.
|
|
281
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
282
|
+
attr_reader :defer_loading
|
|
283
|
+
|
|
284
|
+
sig { params(defer_loading: T::Boolean).void }
|
|
285
|
+
attr_writer :defer_loading
|
|
286
|
+
|
|
287
|
+
# Optional HTTP headers to send to the MCP server. Use for authentication or other
|
|
288
|
+
# purposes.
|
|
289
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
290
|
+
attr_accessor :headers
|
|
291
|
+
|
|
292
|
+
# Specify which of the MCP server's tools require approval.
|
|
293
|
+
sig {
|
|
294
|
+
returns(
|
|
295
|
+
T.nilable(
|
|
296
|
+
T.any(
|
|
297
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter,
|
|
298
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::OrSymbol
|
|
299
|
+
)
|
|
300
|
+
)
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
attr_accessor :require_approval
|
|
304
|
+
|
|
305
|
+
# Optional description of the MCP server, used to provide more context.
|
|
306
|
+
sig { returns(T.nilable(String)) }
|
|
307
|
+
attr_reader :server_description
|
|
308
|
+
|
|
309
|
+
sig { params(server_description: String).void }
|
|
310
|
+
attr_writer :server_description
|
|
311
|
+
|
|
312
|
+
# The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id`
|
|
313
|
+
# must be provided.
|
|
314
|
+
sig { returns(T.nilable(String)) }
|
|
315
|
+
attr_reader :server_url
|
|
316
|
+
|
|
317
|
+
sig { params(server_url: String).void }
|
|
318
|
+
attr_writer :server_url
|
|
319
|
+
|
|
320
|
+
# The Secure MCP Tunnel ID to use instead of a direct server URL. One of
|
|
321
|
+
# `server_url`, `connector_id`, or `tunnel_id` must be provided.
|
|
322
|
+
sig { returns(T.nilable(String)) }
|
|
323
|
+
attr_reader :tunnel_id
|
|
324
|
+
|
|
325
|
+
sig { params(tunnel_id: String).void }
|
|
326
|
+
attr_writer :tunnel_id
|
|
327
|
+
|
|
328
|
+
# Give the model access to additional tools via remote Model Context Protocol
|
|
329
|
+
# (MCP) servers.
|
|
330
|
+
# [Learn more about MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).
|
|
331
|
+
sig do
|
|
332
|
+
params(
|
|
333
|
+
|
|
334
|
+
server_label: String,
|
|
335
|
+
|
|
336
|
+
allowed_callers: T.nilable(
|
|
337
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::OrSymbol]
|
|
338
|
+
),
|
|
339
|
+
|
|
340
|
+
allowed_tools: T.nilable(
|
|
341
|
+
T.any(
|
|
342
|
+
T::Array[String],
|
|
343
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter::OrHash
|
|
344
|
+
)
|
|
345
|
+
),
|
|
346
|
+
|
|
347
|
+
authorization: String,
|
|
348
|
+
|
|
349
|
+
connector_id: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::OrSymbol,
|
|
350
|
+
|
|
351
|
+
defer_loading: T::Boolean,
|
|
352
|
+
|
|
353
|
+
headers: T.nilable(T::Hash[Symbol, String]),
|
|
354
|
+
|
|
355
|
+
require_approval: T.nilable(
|
|
356
|
+
T.any(
|
|
357
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::OrHash,
|
|
358
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::OrSymbol
|
|
359
|
+
)
|
|
360
|
+
),
|
|
361
|
+
|
|
362
|
+
server_description: String,
|
|
363
|
+
|
|
364
|
+
server_url: String,
|
|
365
|
+
|
|
366
|
+
tunnel_id: String,
|
|
367
|
+
|
|
368
|
+
type: Symbol
|
|
369
|
+
)
|
|
370
|
+
.returns(T.attached_class)
|
|
371
|
+
end
|
|
372
|
+
def self.new(
|
|
373
|
+
|
|
374
|
+
# A label for this MCP server, used to identify it in tool calls.
|
|
375
|
+
server_label:,
|
|
376
|
+
|
|
377
|
+
# The tool invocation context(s).
|
|
378
|
+
allowed_callers: nil,
|
|
379
|
+
|
|
380
|
+
# List of allowed tool names or a filter object.
|
|
381
|
+
allowed_tools: nil,
|
|
382
|
+
|
|
383
|
+
# An OAuth access token that can be used with a remote MCP server, either with a
|
|
384
|
+
# custom MCP server URL or a service connector. Your application must handle the
|
|
385
|
+
# OAuth authorization flow and provide the token here.
|
|
386
|
+
authorization: nil,
|
|
387
|
+
|
|
388
|
+
# Identifier for service connectors, like those available in ChatGPT. One of
|
|
389
|
+
# `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
|
|
390
|
+
# service connectors
|
|
391
|
+
# [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
|
|
392
|
+
#
|
|
393
|
+
# This field is deprecated for models released after September 1, 2026. Use
|
|
394
|
+
# `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
|
|
395
|
+
# through a Secure MCP Tunnel.
|
|
396
|
+
#
|
|
397
|
+
# Currently supported `connector_id` values are:
|
|
398
|
+
#
|
|
399
|
+
# - Dropbox: `connector_dropbox`
|
|
400
|
+
# - Gmail: `connector_gmail`
|
|
401
|
+
# - Google Calendar: `connector_googlecalendar`
|
|
402
|
+
# - Google Drive: `connector_googledrive`
|
|
403
|
+
# - Microsoft Teams: `connector_microsoftteams`
|
|
404
|
+
# - Outlook Calendar: `connector_outlookcalendar`
|
|
405
|
+
# - Outlook Email: `connector_outlookemail`
|
|
406
|
+
# - SharePoint: `connector_sharepoint`
|
|
407
|
+
connector_id: nil,
|
|
408
|
+
|
|
409
|
+
# Whether this MCP tool is deferred and discovered via tool search.
|
|
410
|
+
defer_loading: nil,
|
|
411
|
+
|
|
412
|
+
# Optional HTTP headers to send to the MCP server. Use for authentication or other
|
|
413
|
+
# purposes.
|
|
414
|
+
headers: nil,
|
|
415
|
+
|
|
416
|
+
# Specify which of the MCP server's tools require approval.
|
|
417
|
+
require_approval: nil,
|
|
418
|
+
|
|
419
|
+
# Optional description of the MCP server, used to provide more context.
|
|
420
|
+
server_description: nil,
|
|
421
|
+
|
|
422
|
+
# The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id`
|
|
423
|
+
# must be provided.
|
|
424
|
+
server_url: nil,
|
|
425
|
+
|
|
426
|
+
# The Secure MCP Tunnel ID to use instead of a direct server URL. One of
|
|
427
|
+
# `server_url`, `connector_id`, or `tunnel_id` must be provided.
|
|
428
|
+
tunnel_id: nil,
|
|
429
|
+
|
|
430
|
+
# The type of the MCP tool. Always `mcp`.
|
|
431
|
+
|
|
432
|
+
type: :mcp
|
|
433
|
+
)
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
sig do
|
|
437
|
+
override.returns(
|
|
438
|
+
{
|
|
439
|
+
server_label: String,
|
|
440
|
+
type: Symbol,
|
|
441
|
+
allowed_callers: T.nilable(
|
|
442
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::OrSymbol]
|
|
443
|
+
),
|
|
444
|
+
allowed_tools: T.nilable(
|
|
445
|
+
T.any(
|
|
446
|
+
T::Array[String],
|
|
447
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter
|
|
448
|
+
)
|
|
449
|
+
),
|
|
450
|
+
authorization: String,
|
|
451
|
+
connector_id: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::OrSymbol,
|
|
452
|
+
defer_loading: T::Boolean,
|
|
453
|
+
headers: T.nilable(T::Hash[Symbol, String]),
|
|
454
|
+
require_approval: T.nilable(
|
|
455
|
+
T.any(
|
|
456
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter,
|
|
457
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::OrSymbol
|
|
458
|
+
)
|
|
459
|
+
),
|
|
460
|
+
server_description: String,
|
|
461
|
+
server_url: String,
|
|
462
|
+
tunnel_id: String
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
end
|
|
466
|
+
def to_hash
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
module AllowedCaller
|
|
470
|
+
extend OpenAI::Internal::Type::Enum
|
|
471
|
+
|
|
472
|
+
TaggedSymbol = T.type_alias {
|
|
473
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller)
|
|
474
|
+
}
|
|
475
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
476
|
+
|
|
477
|
+
DIRECT = T.let(
|
|
478
|
+
:direct,
|
|
479
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::TaggedSymbol
|
|
480
|
+
)
|
|
481
|
+
PROGRAMMATIC = T.let(
|
|
482
|
+
:programmatic,
|
|
483
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::TaggedSymbol
|
|
484
|
+
)
|
|
485
|
+
|
|
486
|
+
sig {
|
|
487
|
+
override.returns(
|
|
488
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller::TaggedSymbol]
|
|
489
|
+
)
|
|
490
|
+
}
|
|
491
|
+
def self.values
|
|
492
|
+
end
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
# List of allowed tool names or a filter object.
|
|
496
|
+
module AllowedTools
|
|
497
|
+
extend OpenAI::Internal::Type::Union
|
|
498
|
+
|
|
499
|
+
Variants = T.type_alias {
|
|
500
|
+
T.any(
|
|
501
|
+
T::Array[String],
|
|
502
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
class McpToolFilter < OpenAI::Internal::Type::BaseModel
|
|
507
|
+
OrHash = T.type_alias do
|
|
508
|
+
T.any(
|
|
509
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter,
|
|
510
|
+
OpenAI::Internal::AnyHash
|
|
511
|
+
)
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
515
|
+
# is
|
|
516
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
517
|
+
# it will match this filter.
|
|
518
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
519
|
+
attr_reader :read_only
|
|
520
|
+
|
|
521
|
+
sig { params(read_only: T::Boolean).void }
|
|
522
|
+
attr_writer :read_only
|
|
523
|
+
|
|
524
|
+
# List of allowed tool names.
|
|
525
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
526
|
+
attr_reader :tool_names
|
|
527
|
+
|
|
528
|
+
sig { params(tool_names: T::Array[String]).void }
|
|
529
|
+
attr_writer :tool_names
|
|
530
|
+
|
|
531
|
+
# A filter object to specify which tools are allowed.
|
|
532
|
+
sig do
|
|
533
|
+
params(
|
|
534
|
+
|
|
535
|
+
read_only: T::Boolean,
|
|
536
|
+
|
|
537
|
+
tool_names: T::Array[String]
|
|
538
|
+
)
|
|
539
|
+
.returns(T.attached_class)
|
|
540
|
+
end
|
|
541
|
+
def self.new(
|
|
542
|
+
|
|
543
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
544
|
+
# is
|
|
545
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
546
|
+
# it will match this filter.
|
|
547
|
+
read_only: nil,
|
|
548
|
+
|
|
549
|
+
# List of allowed tool names.
|
|
550
|
+
|
|
551
|
+
tool_names: nil
|
|
552
|
+
)
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
sig do
|
|
556
|
+
override.returns(
|
|
557
|
+
{read_only: T::Boolean, tool_names: T::Array[String]}
|
|
558
|
+
)
|
|
559
|
+
end
|
|
560
|
+
def to_hash
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
sig {
|
|
566
|
+
override.returns(
|
|
567
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::Variants]
|
|
568
|
+
)
|
|
569
|
+
}
|
|
570
|
+
def self.variants
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
StringArray = T.let(
|
|
574
|
+
OpenAI::Internal::Type::ArrayOf[String],
|
|
575
|
+
OpenAI::Internal::Type::Converter
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
# Identifier for service connectors, like those available in ChatGPT. One of
|
|
581
|
+
# `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
|
|
582
|
+
# service connectors
|
|
583
|
+
# [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
|
|
584
|
+
#
|
|
585
|
+
# This field is deprecated for models released after September 1, 2026. Use
|
|
586
|
+
# `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
|
|
587
|
+
# through a Secure MCP Tunnel.
|
|
588
|
+
#
|
|
589
|
+
# Currently supported `connector_id` values are:
|
|
590
|
+
#
|
|
591
|
+
# - Dropbox: `connector_dropbox`
|
|
592
|
+
# - Gmail: `connector_gmail`
|
|
593
|
+
# - Google Calendar: `connector_googlecalendar`
|
|
594
|
+
# - Google Drive: `connector_googledrive`
|
|
595
|
+
# - Microsoft Teams: `connector_microsoftteams`
|
|
596
|
+
# - Outlook Calendar: `connector_outlookcalendar`
|
|
597
|
+
# - Outlook Email: `connector_outlookemail`
|
|
598
|
+
# - SharePoint: `connector_sharepoint`
|
|
599
|
+
module ConnectorID
|
|
600
|
+
extend OpenAI::Internal::Type::Enum
|
|
601
|
+
|
|
602
|
+
TaggedSymbol = T.type_alias {
|
|
603
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID)
|
|
604
|
+
}
|
|
605
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
606
|
+
|
|
607
|
+
CONNECTOR_DROPBOX = T.let(
|
|
608
|
+
:connector_dropbox,
|
|
609
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
610
|
+
)
|
|
611
|
+
CONNECTOR_GMAIL = T.let(
|
|
612
|
+
:connector_gmail,
|
|
613
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
614
|
+
)
|
|
615
|
+
CONNECTOR_GOOGLECALENDAR = T.let(
|
|
616
|
+
:connector_googlecalendar,
|
|
617
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
618
|
+
)
|
|
619
|
+
CONNECTOR_GOOGLEDRIVE = T.let(
|
|
620
|
+
:connector_googledrive,
|
|
621
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
622
|
+
)
|
|
623
|
+
CONNECTOR_MICROSOFTTEAMS = T.let(
|
|
624
|
+
:connector_microsoftteams,
|
|
625
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
626
|
+
)
|
|
627
|
+
CONNECTOR_OUTLOOKCALENDAR = T.let(
|
|
628
|
+
:connector_outlookcalendar,
|
|
629
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
630
|
+
)
|
|
631
|
+
CONNECTOR_OUTLOOKEMAIL = T.let(
|
|
632
|
+
:connector_outlookemail,
|
|
633
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
634
|
+
)
|
|
635
|
+
CONNECTOR_SHAREPOINT = T.let(
|
|
636
|
+
:connector_sharepoint,
|
|
637
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
sig {
|
|
641
|
+
override.returns(
|
|
642
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID::TaggedSymbol]
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
def self.values
|
|
646
|
+
end
|
|
647
|
+
end
|
|
648
|
+
|
|
649
|
+
# Specify which of the MCP server's tools require approval.
|
|
650
|
+
module RequireApproval
|
|
651
|
+
extend OpenAI::Internal::Type::Union
|
|
652
|
+
|
|
653
|
+
Variants = T.type_alias {
|
|
654
|
+
T.any(
|
|
655
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter,
|
|
656
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::TaggedSymbol
|
|
657
|
+
)
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
class McpToolApprovalFilter < OpenAI::Internal::Type::BaseModel
|
|
661
|
+
OrHash = T.type_alias do
|
|
662
|
+
T.any(
|
|
663
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter,
|
|
664
|
+
OpenAI::Internal::AnyHash
|
|
665
|
+
)
|
|
666
|
+
end
|
|
667
|
+
|
|
668
|
+
# A filter object to specify which tools are allowed.
|
|
669
|
+
sig {
|
|
670
|
+
returns(
|
|
671
|
+
T.nilable(
|
|
672
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always
|
|
673
|
+
)
|
|
674
|
+
)
|
|
675
|
+
}
|
|
676
|
+
attr_reader :always
|
|
677
|
+
|
|
678
|
+
sig {
|
|
679
|
+
params(
|
|
680
|
+
always: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always::OrHash
|
|
681
|
+
)
|
|
682
|
+
.void
|
|
683
|
+
}
|
|
684
|
+
attr_writer :always
|
|
685
|
+
|
|
686
|
+
# A filter object to specify which tools are allowed.
|
|
687
|
+
sig {
|
|
688
|
+
returns(
|
|
689
|
+
T.nilable(
|
|
690
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never
|
|
691
|
+
)
|
|
692
|
+
)
|
|
693
|
+
}
|
|
694
|
+
attr_reader :never
|
|
695
|
+
|
|
696
|
+
sig {
|
|
697
|
+
params(
|
|
698
|
+
never: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never::OrHash
|
|
699
|
+
)
|
|
700
|
+
.void
|
|
701
|
+
}
|
|
702
|
+
attr_writer :never
|
|
703
|
+
|
|
704
|
+
# Specify which of the MCP server's tools require approval. Can be `always`,
|
|
705
|
+
# `never`, or a filter object associated with tools that require approval.
|
|
706
|
+
sig do
|
|
707
|
+
params(
|
|
708
|
+
|
|
709
|
+
always: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always::OrHash,
|
|
710
|
+
|
|
711
|
+
never: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never::OrHash
|
|
712
|
+
)
|
|
713
|
+
.returns(T.attached_class)
|
|
714
|
+
end
|
|
715
|
+
def self.new(
|
|
716
|
+
|
|
717
|
+
# A filter object to specify which tools are allowed.
|
|
718
|
+
always: nil,
|
|
719
|
+
|
|
720
|
+
# A filter object to specify which tools are allowed.
|
|
721
|
+
|
|
722
|
+
never: nil
|
|
723
|
+
)
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
sig do
|
|
727
|
+
override.returns(
|
|
728
|
+
{
|
|
729
|
+
always: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always,
|
|
730
|
+
never: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never
|
|
731
|
+
}
|
|
732
|
+
)
|
|
733
|
+
end
|
|
734
|
+
def to_hash
|
|
735
|
+
end
|
|
736
|
+
|
|
737
|
+
class Always < OpenAI::Internal::Type::BaseModel
|
|
738
|
+
OrHash = T.type_alias do
|
|
739
|
+
T.any(
|
|
740
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always,
|
|
741
|
+
OpenAI::Internal::AnyHash
|
|
742
|
+
)
|
|
743
|
+
end
|
|
744
|
+
|
|
745
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
746
|
+
# is
|
|
747
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
748
|
+
# it will match this filter.
|
|
749
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
750
|
+
attr_reader :read_only
|
|
751
|
+
|
|
752
|
+
sig { params(read_only: T::Boolean).void }
|
|
753
|
+
attr_writer :read_only
|
|
754
|
+
|
|
755
|
+
# List of allowed tool names.
|
|
756
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
757
|
+
attr_reader :tool_names
|
|
758
|
+
|
|
759
|
+
sig { params(tool_names: T::Array[String]).void }
|
|
760
|
+
attr_writer :tool_names
|
|
761
|
+
|
|
762
|
+
# A filter object to specify which tools are allowed.
|
|
763
|
+
sig do
|
|
764
|
+
params(
|
|
765
|
+
|
|
766
|
+
read_only: T::Boolean,
|
|
767
|
+
|
|
768
|
+
tool_names: T::Array[String]
|
|
769
|
+
)
|
|
770
|
+
.returns(T.attached_class)
|
|
771
|
+
end
|
|
772
|
+
def self.new(
|
|
773
|
+
|
|
774
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
775
|
+
# is
|
|
776
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
777
|
+
# it will match this filter.
|
|
778
|
+
read_only: nil,
|
|
779
|
+
|
|
780
|
+
# List of allowed tool names.
|
|
781
|
+
|
|
782
|
+
tool_names: nil
|
|
783
|
+
)
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
sig do
|
|
787
|
+
override.returns(
|
|
788
|
+
{read_only: T::Boolean, tool_names: T::Array[String]}
|
|
789
|
+
)
|
|
790
|
+
end
|
|
791
|
+
def to_hash
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
class Never < OpenAI::Internal::Type::BaseModel
|
|
797
|
+
OrHash = T.type_alias do
|
|
798
|
+
T.any(
|
|
799
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never,
|
|
800
|
+
OpenAI::Internal::AnyHash
|
|
801
|
+
)
|
|
802
|
+
end
|
|
803
|
+
|
|
804
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
805
|
+
# is
|
|
806
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
807
|
+
# it will match this filter.
|
|
808
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
809
|
+
attr_reader :read_only
|
|
810
|
+
|
|
811
|
+
sig { params(read_only: T::Boolean).void }
|
|
812
|
+
attr_writer :read_only
|
|
813
|
+
|
|
814
|
+
# List of allowed tool names.
|
|
815
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
816
|
+
attr_reader :tool_names
|
|
817
|
+
|
|
818
|
+
sig { params(tool_names: T::Array[String]).void }
|
|
819
|
+
attr_writer :tool_names
|
|
820
|
+
|
|
821
|
+
# A filter object to specify which tools are allowed.
|
|
822
|
+
sig do
|
|
823
|
+
params(
|
|
824
|
+
|
|
825
|
+
read_only: T::Boolean,
|
|
826
|
+
|
|
827
|
+
tool_names: T::Array[String]
|
|
828
|
+
)
|
|
829
|
+
.returns(T.attached_class)
|
|
830
|
+
end
|
|
831
|
+
def self.new(
|
|
832
|
+
|
|
833
|
+
# Indicates whether or not a tool modifies data or is read-only. If an MCP server
|
|
834
|
+
# is
|
|
835
|
+
# [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
|
|
836
|
+
# it will match this filter.
|
|
837
|
+
read_only: nil,
|
|
838
|
+
|
|
839
|
+
# List of allowed tool names.
|
|
840
|
+
|
|
841
|
+
tool_names: nil
|
|
842
|
+
)
|
|
843
|
+
end
|
|
844
|
+
|
|
845
|
+
sig do
|
|
846
|
+
override.returns(
|
|
847
|
+
{read_only: T::Boolean, tool_names: T::Array[String]}
|
|
848
|
+
)
|
|
849
|
+
end
|
|
850
|
+
def to_hash
|
|
851
|
+
end
|
|
852
|
+
|
|
853
|
+
end
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
# Specify a single approval policy for all tools. One of `always` or `never`. When
|
|
857
|
+
# set to `always`, all tools will require approval. When set to `never`, all tools
|
|
858
|
+
# will not require approval.
|
|
859
|
+
module McpToolApprovalSetting
|
|
860
|
+
extend OpenAI::Internal::Type::Enum
|
|
861
|
+
|
|
862
|
+
TaggedSymbol = T.type_alias {
|
|
863
|
+
T.all(
|
|
864
|
+
Symbol,
|
|
865
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
869
|
+
|
|
870
|
+
ALWAYS = T.let(
|
|
871
|
+
:always,
|
|
872
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::TaggedSymbol
|
|
873
|
+
)
|
|
874
|
+
NEVER = T.let(
|
|
875
|
+
:never,
|
|
876
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::TaggedSymbol
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
sig {
|
|
880
|
+
override.returns(
|
|
881
|
+
T::Array[
|
|
882
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting::TaggedSymbol
|
|
883
|
+
]
|
|
884
|
+
)
|
|
885
|
+
}
|
|
886
|
+
def self.values
|
|
887
|
+
end
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
sig {
|
|
891
|
+
override.returns(
|
|
892
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::Variants]
|
|
893
|
+
)
|
|
894
|
+
}
|
|
895
|
+
def self.variants
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
end
|
|
899
|
+
end
|
|
900
|
+
|
|
901
|
+
class CodeInterpreter < OpenAI::Internal::Type::BaseModel
|
|
902
|
+
OrHash = T.type_alias do
|
|
903
|
+
T.any(
|
|
904
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter,
|
|
905
|
+
OpenAI::Internal::AnyHash
|
|
906
|
+
)
|
|
907
|
+
end
|
|
908
|
+
|
|
909
|
+
# The code interpreter container. Can be a container ID or an object that
|
|
910
|
+
# specifies uploaded file IDs to make available to your code, along with an
|
|
911
|
+
# optional `memory_limit` setting.
|
|
912
|
+
sig {
|
|
913
|
+
returns(
|
|
914
|
+
T.any(
|
|
915
|
+
String,
|
|
916
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto
|
|
917
|
+
)
|
|
918
|
+
)
|
|
919
|
+
}
|
|
920
|
+
attr_accessor :container
|
|
921
|
+
|
|
922
|
+
# The type of the code interpreter tool. Always `code_interpreter`.
|
|
923
|
+
sig { returns(Symbol) }
|
|
924
|
+
attr_accessor :type
|
|
925
|
+
|
|
926
|
+
# The tool invocation context(s).
|
|
927
|
+
sig {
|
|
928
|
+
returns(
|
|
929
|
+
T.nilable(
|
|
930
|
+
T::Array[
|
|
931
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::OrSymbol
|
|
932
|
+
]
|
|
933
|
+
)
|
|
934
|
+
)
|
|
935
|
+
}
|
|
936
|
+
attr_accessor :allowed_callers
|
|
937
|
+
|
|
938
|
+
# A tool that runs Python code to help generate a response to a prompt.
|
|
939
|
+
sig do
|
|
940
|
+
params(
|
|
941
|
+
|
|
942
|
+
container: T.any(
|
|
943
|
+
String,
|
|
944
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::OrHash
|
|
945
|
+
),
|
|
946
|
+
|
|
947
|
+
allowed_callers: T.nilable(
|
|
948
|
+
T::Array[
|
|
949
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::OrSymbol
|
|
950
|
+
]
|
|
951
|
+
),
|
|
952
|
+
|
|
953
|
+
type: Symbol
|
|
954
|
+
)
|
|
955
|
+
.returns(T.attached_class)
|
|
956
|
+
end
|
|
957
|
+
def self.new(
|
|
958
|
+
|
|
959
|
+
# The code interpreter container. Can be a container ID or an object that
|
|
960
|
+
# specifies uploaded file IDs to make available to your code, along with an
|
|
961
|
+
# optional `memory_limit` setting.
|
|
962
|
+
container:,
|
|
963
|
+
|
|
964
|
+
# The tool invocation context(s).
|
|
965
|
+
allowed_callers: nil,
|
|
966
|
+
|
|
967
|
+
# The type of the code interpreter tool. Always `code_interpreter`.
|
|
968
|
+
|
|
969
|
+
type: :code_interpreter
|
|
970
|
+
)
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
sig do
|
|
974
|
+
override.returns(
|
|
975
|
+
{
|
|
976
|
+
container: T.any(
|
|
977
|
+
String,
|
|
978
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto
|
|
979
|
+
),
|
|
980
|
+
type: Symbol,
|
|
981
|
+
allowed_callers: T.nilable(
|
|
982
|
+
T::Array[
|
|
983
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::OrSymbol
|
|
984
|
+
]
|
|
985
|
+
)
|
|
986
|
+
}
|
|
987
|
+
)
|
|
988
|
+
end
|
|
989
|
+
def to_hash
|
|
990
|
+
end
|
|
991
|
+
|
|
992
|
+
# The code interpreter container. Can be a container ID or an object that
|
|
993
|
+
# specifies uploaded file IDs to make available to your code, along with an
|
|
994
|
+
# optional `memory_limit` setting.
|
|
995
|
+
module Container
|
|
996
|
+
extend OpenAI::Internal::Type::Union
|
|
997
|
+
|
|
998
|
+
Variants = T.type_alias {
|
|
999
|
+
T.any(
|
|
1000
|
+
String,
|
|
1001
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto
|
|
1002
|
+
)
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
class CodeInterpreterToolAuto < OpenAI::Internal::Type::BaseModel
|
|
1006
|
+
OrHash = T.type_alias do
|
|
1007
|
+
T.any(
|
|
1008
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto,
|
|
1009
|
+
OpenAI::Internal::AnyHash
|
|
1010
|
+
)
|
|
1011
|
+
end
|
|
1012
|
+
|
|
1013
|
+
# Always `auto`.
|
|
1014
|
+
sig { returns(Symbol) }
|
|
1015
|
+
attr_accessor :type
|
|
1016
|
+
|
|
1017
|
+
# An optional list of uploaded files to make available to your code.
|
|
1018
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
1019
|
+
attr_reader :file_ids
|
|
1020
|
+
|
|
1021
|
+
sig { params(file_ids: T::Array[String]).void }
|
|
1022
|
+
attr_writer :file_ids
|
|
1023
|
+
|
|
1024
|
+
# The memory limit for the code interpreter container.
|
|
1025
|
+
sig {
|
|
1026
|
+
returns(
|
|
1027
|
+
T.nilable(
|
|
1028
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::OrSymbol
|
|
1029
|
+
)
|
|
1030
|
+
)
|
|
1031
|
+
}
|
|
1032
|
+
attr_accessor :memory_limit
|
|
1033
|
+
|
|
1034
|
+
# Network access policy for the container.
|
|
1035
|
+
sig {
|
|
1036
|
+
returns(
|
|
1037
|
+
T.nilable(
|
|
1038
|
+
T.any(
|
|
1039
|
+
OpenAI::Beta::BetaContainerNetworkPolicyDisabled,
|
|
1040
|
+
OpenAI::Beta::BetaContainerNetworkPolicyAllowlist
|
|
1041
|
+
)
|
|
1042
|
+
)
|
|
1043
|
+
)
|
|
1044
|
+
}
|
|
1045
|
+
attr_reader :network_policy
|
|
1046
|
+
|
|
1047
|
+
sig {
|
|
1048
|
+
params(
|
|
1049
|
+
network_policy: T.any(
|
|
1050
|
+
OpenAI::Beta::BetaContainerNetworkPolicyDisabled::OrHash,
|
|
1051
|
+
OpenAI::Beta::BetaContainerNetworkPolicyAllowlist::OrHash
|
|
1052
|
+
)
|
|
1053
|
+
)
|
|
1054
|
+
.void
|
|
1055
|
+
}
|
|
1056
|
+
attr_writer :network_policy
|
|
1057
|
+
|
|
1058
|
+
# Configuration for a code interpreter container. Optionally specify the IDs of
|
|
1059
|
+
# the files to run the code on.
|
|
1060
|
+
sig do
|
|
1061
|
+
params(
|
|
1062
|
+
|
|
1063
|
+
file_ids: T::Array[String],
|
|
1064
|
+
|
|
1065
|
+
memory_limit: T.nilable(
|
|
1066
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::OrSymbol
|
|
1067
|
+
),
|
|
1068
|
+
|
|
1069
|
+
network_policy: T.any(
|
|
1070
|
+
OpenAI::Beta::BetaContainerNetworkPolicyDisabled::OrHash,
|
|
1071
|
+
OpenAI::Beta::BetaContainerNetworkPolicyAllowlist::OrHash
|
|
1072
|
+
),
|
|
1073
|
+
|
|
1074
|
+
type: Symbol
|
|
1075
|
+
)
|
|
1076
|
+
.returns(T.attached_class)
|
|
1077
|
+
end
|
|
1078
|
+
def self.new(
|
|
1079
|
+
|
|
1080
|
+
# An optional list of uploaded files to make available to your code.
|
|
1081
|
+
file_ids: nil,
|
|
1082
|
+
|
|
1083
|
+
# The memory limit for the code interpreter container.
|
|
1084
|
+
memory_limit: nil,
|
|
1085
|
+
|
|
1086
|
+
# Network access policy for the container.
|
|
1087
|
+
network_policy: nil,
|
|
1088
|
+
|
|
1089
|
+
# Always `auto`.
|
|
1090
|
+
|
|
1091
|
+
type: :auto
|
|
1092
|
+
)
|
|
1093
|
+
end
|
|
1094
|
+
|
|
1095
|
+
sig do
|
|
1096
|
+
override.returns(
|
|
1097
|
+
{
|
|
1098
|
+
type: Symbol,
|
|
1099
|
+
file_ids: T::Array[String],
|
|
1100
|
+
memory_limit: T.nilable(
|
|
1101
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::OrSymbol
|
|
1102
|
+
),
|
|
1103
|
+
network_policy: T.any(
|
|
1104
|
+
OpenAI::Beta::BetaContainerNetworkPolicyDisabled,
|
|
1105
|
+
OpenAI::Beta::BetaContainerNetworkPolicyAllowlist
|
|
1106
|
+
)
|
|
1107
|
+
}
|
|
1108
|
+
)
|
|
1109
|
+
end
|
|
1110
|
+
def to_hash
|
|
1111
|
+
end
|
|
1112
|
+
|
|
1113
|
+
# The memory limit for the code interpreter container.
|
|
1114
|
+
module MemoryLimit
|
|
1115
|
+
extend OpenAI::Internal::Type::Enum
|
|
1116
|
+
|
|
1117
|
+
TaggedSymbol = T.type_alias {
|
|
1118
|
+
T.all(
|
|
1119
|
+
Symbol,
|
|
1120
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit
|
|
1121
|
+
)
|
|
1122
|
+
}
|
|
1123
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1124
|
+
|
|
1125
|
+
MEMORY_LIMIT_1G = T.let(
|
|
1126
|
+
:"1g",
|
|
1127
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::TaggedSymbol
|
|
1128
|
+
)
|
|
1129
|
+
MEMORY_LIMIT_4G = T.let(
|
|
1130
|
+
:"4g",
|
|
1131
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::TaggedSymbol
|
|
1132
|
+
)
|
|
1133
|
+
MEMORY_LIMIT_16G = T.let(
|
|
1134
|
+
:"16g",
|
|
1135
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::TaggedSymbol
|
|
1136
|
+
)
|
|
1137
|
+
MEMORY_LIMIT_64G = T.let(
|
|
1138
|
+
:"64g",
|
|
1139
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::TaggedSymbol
|
|
1140
|
+
)
|
|
1141
|
+
|
|
1142
|
+
sig {
|
|
1143
|
+
override.returns(
|
|
1144
|
+
T::Array[
|
|
1145
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit::TaggedSymbol
|
|
1146
|
+
]
|
|
1147
|
+
)
|
|
1148
|
+
}
|
|
1149
|
+
def self.values
|
|
1150
|
+
end
|
|
1151
|
+
end
|
|
1152
|
+
|
|
1153
|
+
# Network access policy for the container.
|
|
1154
|
+
module NetworkPolicy
|
|
1155
|
+
extend OpenAI::Internal::Type::Union
|
|
1156
|
+
|
|
1157
|
+
Variants = T.type_alias {
|
|
1158
|
+
T.any(
|
|
1159
|
+
OpenAI::Beta::BetaContainerNetworkPolicyDisabled,
|
|
1160
|
+
OpenAI::Beta::BetaContainerNetworkPolicyAllowlist
|
|
1161
|
+
)
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
sig {
|
|
1165
|
+
override.returns(
|
|
1166
|
+
T::Array[
|
|
1167
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::NetworkPolicy::Variants
|
|
1168
|
+
]
|
|
1169
|
+
)
|
|
1170
|
+
}
|
|
1171
|
+
def self.variants
|
|
1172
|
+
end
|
|
1173
|
+
|
|
1174
|
+
end
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
sig {
|
|
1178
|
+
override.returns(
|
|
1179
|
+
T::Array[
|
|
1180
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::Variants
|
|
1181
|
+
]
|
|
1182
|
+
)
|
|
1183
|
+
}
|
|
1184
|
+
def self.variants
|
|
1185
|
+
end
|
|
1186
|
+
|
|
1187
|
+
end
|
|
1188
|
+
|
|
1189
|
+
module AllowedCaller
|
|
1190
|
+
extend OpenAI::Internal::Type::Enum
|
|
1191
|
+
|
|
1192
|
+
TaggedSymbol = T.type_alias {
|
|
1193
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller)
|
|
1194
|
+
}
|
|
1195
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1196
|
+
|
|
1197
|
+
DIRECT = T.let(
|
|
1198
|
+
:direct,
|
|
1199
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::TaggedSymbol
|
|
1200
|
+
)
|
|
1201
|
+
PROGRAMMATIC = T.let(
|
|
1202
|
+
:programmatic,
|
|
1203
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::TaggedSymbol
|
|
1204
|
+
)
|
|
1205
|
+
|
|
1206
|
+
sig {
|
|
1207
|
+
override.returns(
|
|
1208
|
+
T::Array[
|
|
1209
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller::TaggedSymbol
|
|
1210
|
+
]
|
|
1211
|
+
)
|
|
1212
|
+
}
|
|
1213
|
+
def self.values
|
|
1214
|
+
end
|
|
1215
|
+
end
|
|
1216
|
+
end
|
|
1217
|
+
|
|
1218
|
+
class ProgrammaticToolCalling < OpenAI::Internal::Type::BaseModel
|
|
1219
|
+
OrHash = T.type_alias do
|
|
1220
|
+
T.any(
|
|
1221
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling,
|
|
1222
|
+
OpenAI::Internal::AnyHash
|
|
1223
|
+
)
|
|
1224
|
+
end
|
|
1225
|
+
|
|
1226
|
+
# The type of the tool. Always `programmatic_tool_calling`.
|
|
1227
|
+
sig { returns(Symbol) }
|
|
1228
|
+
attr_accessor :type
|
|
1229
|
+
|
|
1230
|
+
sig do
|
|
1231
|
+
params(
|
|
1232
|
+
|
|
1233
|
+
type: Symbol
|
|
1234
|
+
)
|
|
1235
|
+
.returns(T.attached_class)
|
|
1236
|
+
end
|
|
1237
|
+
def self.new(
|
|
1238
|
+
|
|
1239
|
+
# The type of the tool. Always `programmatic_tool_calling`.
|
|
1240
|
+
|
|
1241
|
+
type: :programmatic_tool_calling
|
|
1242
|
+
)
|
|
1243
|
+
end
|
|
1244
|
+
|
|
1245
|
+
sig do
|
|
1246
|
+
override.returns(
|
|
1247
|
+
{type: Symbol}
|
|
1248
|
+
)
|
|
1249
|
+
end
|
|
1250
|
+
def to_hash
|
|
1251
|
+
end
|
|
1252
|
+
|
|
1253
|
+
end
|
|
1254
|
+
|
|
1255
|
+
class ImageGeneration < OpenAI::Internal::Type::BaseModel
|
|
1256
|
+
OrHash = T.type_alias do
|
|
1257
|
+
T.any(
|
|
1258
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration,
|
|
1259
|
+
OpenAI::Internal::AnyHash
|
|
1260
|
+
)
|
|
1261
|
+
end
|
|
1262
|
+
|
|
1263
|
+
# The type of the image generation tool. Always `image_generation`.
|
|
1264
|
+
sig { returns(Symbol) }
|
|
1265
|
+
attr_accessor :type
|
|
1266
|
+
|
|
1267
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1268
|
+
sig {
|
|
1269
|
+
returns(
|
|
1270
|
+
T.nilable(OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::OrSymbol)
|
|
1271
|
+
)
|
|
1272
|
+
}
|
|
1273
|
+
attr_reader :action
|
|
1274
|
+
|
|
1275
|
+
sig {
|
|
1276
|
+
params(
|
|
1277
|
+
action: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::OrSymbol
|
|
1278
|
+
)
|
|
1279
|
+
.void
|
|
1280
|
+
}
|
|
1281
|
+
attr_writer :action
|
|
1282
|
+
|
|
1283
|
+
# Allows to set transparency for the background of the generated image(s). Must be
|
|
1284
|
+
# one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
1285
|
+
# the model will automatically determine the best background for the image.
|
|
1286
|
+
#
|
|
1287
|
+
# `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
|
|
1288
|
+
# snapshots, support `opaque` and `transparent` backgrounds. Transparent
|
|
1289
|
+
# backgrounds are available for supported GPT Image models. For `gpt-image-2` and
|
|
1290
|
+
# `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
|
|
1291
|
+
# set the output format to `png` or `webp`.
|
|
1292
|
+
sig {
|
|
1293
|
+
returns(
|
|
1294
|
+
T.nilable(
|
|
1295
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::OrSymbol
|
|
1296
|
+
)
|
|
1297
|
+
)
|
|
1298
|
+
}
|
|
1299
|
+
attr_reader :background
|
|
1300
|
+
|
|
1301
|
+
sig {
|
|
1302
|
+
params(
|
|
1303
|
+
background: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::OrSymbol
|
|
1304
|
+
)
|
|
1305
|
+
.void
|
|
1306
|
+
}
|
|
1307
|
+
attr_writer :background
|
|
1308
|
+
|
|
1309
|
+
# Control how much effort the model will exert to match the style and features,
|
|
1310
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
1311
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
1312
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
1313
|
+
sig {
|
|
1314
|
+
returns(
|
|
1315
|
+
T.nilable(
|
|
1316
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::OrSymbol
|
|
1317
|
+
)
|
|
1318
|
+
)
|
|
1319
|
+
}
|
|
1320
|
+
attr_accessor :input_fidelity
|
|
1321
|
+
|
|
1322
|
+
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
1323
|
+
# `file_id` (string, optional).
|
|
1324
|
+
sig {
|
|
1325
|
+
returns(
|
|
1326
|
+
T.nilable(OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask)
|
|
1327
|
+
)
|
|
1328
|
+
}
|
|
1329
|
+
attr_reader :input_image_mask
|
|
1330
|
+
|
|
1331
|
+
sig {
|
|
1332
|
+
params(
|
|
1333
|
+
input_image_mask: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask::OrHash
|
|
1334
|
+
)
|
|
1335
|
+
.void
|
|
1336
|
+
}
|
|
1337
|
+
attr_writer :input_image_mask
|
|
1338
|
+
|
|
1339
|
+
# The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
1340
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1341
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1342
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
1343
|
+
# `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
1344
|
+
sig {
|
|
1345
|
+
returns(
|
|
1346
|
+
T.nilable(
|
|
1347
|
+
T.any(
|
|
1348
|
+
String,
|
|
1349
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::OrSymbol
|
|
1350
|
+
)
|
|
1351
|
+
)
|
|
1352
|
+
)
|
|
1353
|
+
}
|
|
1354
|
+
attr_reader :model
|
|
1355
|
+
|
|
1356
|
+
sig {
|
|
1357
|
+
params(
|
|
1358
|
+
model: T.any(
|
|
1359
|
+
String,
|
|
1360
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::OrSymbol
|
|
1361
|
+
)
|
|
1362
|
+
)
|
|
1363
|
+
.void
|
|
1364
|
+
}
|
|
1365
|
+
attr_writer :model
|
|
1366
|
+
|
|
1367
|
+
# Moderation level for the generated image. Default: `auto`.
|
|
1368
|
+
sig {
|
|
1369
|
+
returns(
|
|
1370
|
+
T.nilable(
|
|
1371
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::OrSymbol
|
|
1372
|
+
)
|
|
1373
|
+
)
|
|
1374
|
+
}
|
|
1375
|
+
attr_reader :moderation
|
|
1376
|
+
|
|
1377
|
+
sig {
|
|
1378
|
+
params(
|
|
1379
|
+
moderation: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::OrSymbol
|
|
1380
|
+
)
|
|
1381
|
+
.void
|
|
1382
|
+
}
|
|
1383
|
+
attr_writer :moderation
|
|
1384
|
+
|
|
1385
|
+
# Compression level for the output image. Default: 100.
|
|
1386
|
+
sig { returns(T.nilable(Integer)) }
|
|
1387
|
+
attr_reader :output_compression
|
|
1388
|
+
|
|
1389
|
+
sig { params(output_compression: Integer).void }
|
|
1390
|
+
attr_writer :output_compression
|
|
1391
|
+
|
|
1392
|
+
# The output format of the generated image. One of `png`, `webp`, or `jpeg`.
|
|
1393
|
+
# Default: `png`.
|
|
1394
|
+
sig {
|
|
1395
|
+
returns(
|
|
1396
|
+
T.nilable(
|
|
1397
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::OrSymbol
|
|
1398
|
+
)
|
|
1399
|
+
)
|
|
1400
|
+
}
|
|
1401
|
+
attr_reader :output_format
|
|
1402
|
+
|
|
1403
|
+
sig {
|
|
1404
|
+
params(
|
|
1405
|
+
output_format: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::OrSymbol
|
|
1406
|
+
)
|
|
1407
|
+
.void
|
|
1408
|
+
}
|
|
1409
|
+
attr_writer :output_format
|
|
1410
|
+
|
|
1411
|
+
# Number of partial images to generate in streaming mode, from 0 (default value)
|
|
1412
|
+
# to 3.
|
|
1413
|
+
sig { returns(T.nilable(Integer)) }
|
|
1414
|
+
attr_reader :partial_images
|
|
1415
|
+
|
|
1416
|
+
sig { params(partial_images: Integer).void }
|
|
1417
|
+
attr_writer :partial_images
|
|
1418
|
+
|
|
1419
|
+
# The quality of the generated image. The GPT image models support `low`,
|
|
1420
|
+
# `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
|
|
1421
|
+
# including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
|
|
1422
|
+
# `auto`.
|
|
1423
|
+
sig {
|
|
1424
|
+
returns(
|
|
1425
|
+
T.nilable(OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::OrSymbol)
|
|
1426
|
+
)
|
|
1427
|
+
}
|
|
1428
|
+
attr_reader :quality
|
|
1429
|
+
|
|
1430
|
+
sig {
|
|
1431
|
+
params(
|
|
1432
|
+
quality: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::OrSymbol
|
|
1433
|
+
)
|
|
1434
|
+
.void
|
|
1435
|
+
}
|
|
1436
|
+
attr_writer :quality
|
|
1437
|
+
|
|
1438
|
+
# The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1439
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1440
|
+
# `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
|
|
1441
|
+
# resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
|
|
1442
|
+
# Width and height must both be divisible by 16 and the requested aspect ratio
|
|
1443
|
+
# must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
|
|
1444
|
+
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
1445
|
+
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
1446
|
+
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
1447
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
1448
|
+
sig {
|
|
1449
|
+
returns(
|
|
1450
|
+
T.nilable(
|
|
1451
|
+
T.any(
|
|
1452
|
+
String,
|
|
1453
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::OrSymbol
|
|
1454
|
+
)
|
|
1455
|
+
)
|
|
1456
|
+
)
|
|
1457
|
+
}
|
|
1458
|
+
attr_reader :size
|
|
1459
|
+
|
|
1460
|
+
sig {
|
|
1461
|
+
params(
|
|
1462
|
+
size: T.any(
|
|
1463
|
+
String,
|
|
1464
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::OrSymbol
|
|
1465
|
+
)
|
|
1466
|
+
)
|
|
1467
|
+
.void
|
|
1468
|
+
}
|
|
1469
|
+
attr_writer :size
|
|
1470
|
+
|
|
1471
|
+
# A tool that generates images using the GPT image models.
|
|
1472
|
+
sig do
|
|
1473
|
+
params(
|
|
1474
|
+
|
|
1475
|
+
action: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::OrSymbol,
|
|
1476
|
+
|
|
1477
|
+
background: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::OrSymbol,
|
|
1478
|
+
|
|
1479
|
+
input_fidelity: T.nilable(
|
|
1480
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::OrSymbol
|
|
1481
|
+
),
|
|
1482
|
+
|
|
1483
|
+
input_image_mask: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask::OrHash,
|
|
1484
|
+
|
|
1485
|
+
model: T.any(
|
|
1486
|
+
String,
|
|
1487
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::OrSymbol
|
|
1488
|
+
),
|
|
1489
|
+
|
|
1490
|
+
moderation: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::OrSymbol,
|
|
1491
|
+
|
|
1492
|
+
output_compression: Integer,
|
|
1493
|
+
|
|
1494
|
+
output_format: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::OrSymbol,
|
|
1495
|
+
|
|
1496
|
+
partial_images: Integer,
|
|
1497
|
+
|
|
1498
|
+
quality: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::OrSymbol,
|
|
1499
|
+
|
|
1500
|
+
size: T.any(
|
|
1501
|
+
String,
|
|
1502
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::OrSymbol
|
|
1503
|
+
),
|
|
1504
|
+
|
|
1505
|
+
type: Symbol
|
|
1506
|
+
)
|
|
1507
|
+
.returns(T.attached_class)
|
|
1508
|
+
end
|
|
1509
|
+
def self.new(
|
|
1510
|
+
|
|
1511
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1512
|
+
action: nil,
|
|
1513
|
+
|
|
1514
|
+
# Allows to set transparency for the background of the generated image(s). Must be
|
|
1515
|
+
# one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
1516
|
+
# the model will automatically determine the best background for the image.
|
|
1517
|
+
#
|
|
1518
|
+
# `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
|
|
1519
|
+
# snapshots, support `opaque` and `transparent` backgrounds. Transparent
|
|
1520
|
+
# backgrounds are available for supported GPT Image models. For `gpt-image-2` and
|
|
1521
|
+
# `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
|
|
1522
|
+
# set the output format to `png` or `webp`.
|
|
1523
|
+
background: nil,
|
|
1524
|
+
|
|
1525
|
+
# Control how much effort the model will exert to match the style and features,
|
|
1526
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
1527
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
1528
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
1529
|
+
input_fidelity: nil,
|
|
1530
|
+
|
|
1531
|
+
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
1532
|
+
# `file_id` (string, optional).
|
|
1533
|
+
input_image_mask: nil,
|
|
1534
|
+
|
|
1535
|
+
# The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
1536
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1537
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1538
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
1539
|
+
# `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
1540
|
+
model: nil,
|
|
1541
|
+
|
|
1542
|
+
# Moderation level for the generated image. Default: `auto`.
|
|
1543
|
+
moderation: nil,
|
|
1544
|
+
|
|
1545
|
+
# Compression level for the output image. Default: 100.
|
|
1546
|
+
output_compression: nil,
|
|
1547
|
+
|
|
1548
|
+
# The output format of the generated image. One of `png`, `webp`, or `jpeg`.
|
|
1549
|
+
# Default: `png`.
|
|
1550
|
+
output_format: nil,
|
|
1551
|
+
|
|
1552
|
+
# Number of partial images to generate in streaming mode, from 0 (default value)
|
|
1553
|
+
# to 3.
|
|
1554
|
+
partial_images: nil,
|
|
1555
|
+
|
|
1556
|
+
# The quality of the generated image. The GPT image models support `low`,
|
|
1557
|
+
# `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
|
|
1558
|
+
# including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
|
|
1559
|
+
# `auto`.
|
|
1560
|
+
quality: nil,
|
|
1561
|
+
|
|
1562
|
+
# The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1563
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1564
|
+
# `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
|
|
1565
|
+
# resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
|
|
1566
|
+
# Width and height must both be divisible by 16 and the requested aspect ratio
|
|
1567
|
+
# must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
|
|
1568
|
+
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
1569
|
+
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
1570
|
+
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
1571
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
1572
|
+
size: nil,
|
|
1573
|
+
|
|
1574
|
+
# The type of the image generation tool. Always `image_generation`.
|
|
1575
|
+
|
|
1576
|
+
type: :image_generation
|
|
1577
|
+
)
|
|
1578
|
+
end
|
|
1579
|
+
|
|
1580
|
+
sig do
|
|
1581
|
+
override.returns(
|
|
1582
|
+
{
|
|
1583
|
+
type: Symbol,
|
|
1584
|
+
action: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::OrSymbol,
|
|
1585
|
+
background: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::OrSymbol,
|
|
1586
|
+
input_fidelity: T.nilable(
|
|
1587
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::OrSymbol
|
|
1588
|
+
),
|
|
1589
|
+
input_image_mask: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask,
|
|
1590
|
+
model: T.any(
|
|
1591
|
+
String,
|
|
1592
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::OrSymbol
|
|
1593
|
+
),
|
|
1594
|
+
moderation: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::OrSymbol,
|
|
1595
|
+
output_compression: Integer,
|
|
1596
|
+
output_format: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::OrSymbol,
|
|
1597
|
+
partial_images: Integer,
|
|
1598
|
+
quality: OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::OrSymbol,
|
|
1599
|
+
size: T.any(
|
|
1600
|
+
String,
|
|
1601
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::OrSymbol
|
|
1602
|
+
)
|
|
1603
|
+
}
|
|
1604
|
+
)
|
|
1605
|
+
end
|
|
1606
|
+
def to_hash
|
|
1607
|
+
end
|
|
1608
|
+
|
|
1609
|
+
# Whether to generate a new image or edit an existing image. Default: `auto`.
|
|
1610
|
+
module Action
|
|
1611
|
+
extend OpenAI::Internal::Type::Enum
|
|
1612
|
+
|
|
1613
|
+
TaggedSymbol = T.type_alias {
|
|
1614
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action)
|
|
1615
|
+
}
|
|
1616
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1617
|
+
|
|
1618
|
+
GENERATE = T.let(
|
|
1619
|
+
:generate,
|
|
1620
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1621
|
+
)
|
|
1622
|
+
EDIT = T.let(
|
|
1623
|
+
:edit,
|
|
1624
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1625
|
+
)
|
|
1626
|
+
AUTO = T.let(
|
|
1627
|
+
:auto,
|
|
1628
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1629
|
+
)
|
|
1630
|
+
|
|
1631
|
+
sig {
|
|
1632
|
+
override.returns(
|
|
1633
|
+
T::Array[
|
|
1634
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action::TaggedSymbol
|
|
1635
|
+
]
|
|
1636
|
+
)
|
|
1637
|
+
}
|
|
1638
|
+
def self.values
|
|
1639
|
+
end
|
|
1640
|
+
end
|
|
1641
|
+
|
|
1642
|
+
# Allows to set transparency for the background of the generated image(s). Must be
|
|
1643
|
+
# one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
|
|
1644
|
+
# the model will automatically determine the best background for the image.
|
|
1645
|
+
#
|
|
1646
|
+
# `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
|
|
1647
|
+
# snapshots, support `opaque` and `transparent` backgrounds. Transparent
|
|
1648
|
+
# backgrounds are available for supported GPT Image models. For `gpt-image-2` and
|
|
1649
|
+
# `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
|
|
1650
|
+
# set the output format to `png` or `webp`.
|
|
1651
|
+
module Background
|
|
1652
|
+
extend OpenAI::Internal::Type::Enum
|
|
1653
|
+
|
|
1654
|
+
TaggedSymbol = T.type_alias {
|
|
1655
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background)
|
|
1656
|
+
}
|
|
1657
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1658
|
+
|
|
1659
|
+
TRANSPARENT = T.let(
|
|
1660
|
+
:transparent,
|
|
1661
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::TaggedSymbol
|
|
1662
|
+
)
|
|
1663
|
+
OPAQUE = T.let(
|
|
1664
|
+
:opaque,
|
|
1665
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::TaggedSymbol
|
|
1666
|
+
)
|
|
1667
|
+
AUTO = T.let(
|
|
1668
|
+
:auto,
|
|
1669
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::TaggedSymbol
|
|
1670
|
+
)
|
|
1671
|
+
|
|
1672
|
+
sig {
|
|
1673
|
+
override.returns(
|
|
1674
|
+
T::Array[
|
|
1675
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background::TaggedSymbol
|
|
1676
|
+
]
|
|
1677
|
+
)
|
|
1678
|
+
}
|
|
1679
|
+
def self.values
|
|
1680
|
+
end
|
|
1681
|
+
end
|
|
1682
|
+
|
|
1683
|
+
# Control how much effort the model will exert to match the style and features,
|
|
1684
|
+
# especially facial features, of input images. Supports `high` and `low` on
|
|
1685
|
+
# `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
|
|
1686
|
+
# `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
|
|
1687
|
+
module InputFidelity
|
|
1688
|
+
extend OpenAI::Internal::Type::Enum
|
|
1689
|
+
|
|
1690
|
+
TaggedSymbol = T.type_alias {
|
|
1691
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity)
|
|
1692
|
+
}
|
|
1693
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1694
|
+
|
|
1695
|
+
HIGH = T.let(
|
|
1696
|
+
:high,
|
|
1697
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::TaggedSymbol
|
|
1698
|
+
)
|
|
1699
|
+
LOW = T.let(
|
|
1700
|
+
:low,
|
|
1701
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::TaggedSymbol
|
|
1702
|
+
)
|
|
1703
|
+
|
|
1704
|
+
sig {
|
|
1705
|
+
override.returns(
|
|
1706
|
+
T::Array[
|
|
1707
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity::TaggedSymbol
|
|
1708
|
+
]
|
|
1709
|
+
)
|
|
1710
|
+
}
|
|
1711
|
+
def self.values
|
|
1712
|
+
end
|
|
1713
|
+
end
|
|
1714
|
+
|
|
1715
|
+
class InputImageMask < OpenAI::Internal::Type::BaseModel
|
|
1716
|
+
OrHash = T.type_alias do
|
|
1717
|
+
T.any(
|
|
1718
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask,
|
|
1719
|
+
OpenAI::Internal::AnyHash
|
|
1720
|
+
)
|
|
1721
|
+
end
|
|
1722
|
+
|
|
1723
|
+
# File ID for the mask image.
|
|
1724
|
+
sig { returns(T.nilable(String)) }
|
|
1725
|
+
attr_reader :file_id
|
|
1726
|
+
|
|
1727
|
+
sig { params(file_id: String).void }
|
|
1728
|
+
attr_writer :file_id
|
|
1729
|
+
|
|
1730
|
+
# Base64-encoded mask image.
|
|
1731
|
+
sig { returns(T.nilable(String)) }
|
|
1732
|
+
attr_reader :image_url
|
|
1733
|
+
|
|
1734
|
+
sig { params(image_url: String).void }
|
|
1735
|
+
attr_writer :image_url
|
|
1736
|
+
|
|
1737
|
+
# Optional mask for inpainting. Contains `image_url` (string, optional) and
|
|
1738
|
+
# `file_id` (string, optional).
|
|
1739
|
+
sig do
|
|
1740
|
+
params(
|
|
1741
|
+
|
|
1742
|
+
file_id: String,
|
|
1743
|
+
|
|
1744
|
+
image_url: String
|
|
1745
|
+
)
|
|
1746
|
+
.returns(T.attached_class)
|
|
1747
|
+
end
|
|
1748
|
+
def self.new(
|
|
1749
|
+
|
|
1750
|
+
# File ID for the mask image.
|
|
1751
|
+
file_id: nil,
|
|
1752
|
+
|
|
1753
|
+
# Base64-encoded mask image.
|
|
1754
|
+
|
|
1755
|
+
image_url: nil
|
|
1756
|
+
)
|
|
1757
|
+
end
|
|
1758
|
+
|
|
1759
|
+
sig do
|
|
1760
|
+
override.returns(
|
|
1761
|
+
{file_id: String, image_url: String}
|
|
1762
|
+
)
|
|
1763
|
+
end
|
|
1764
|
+
def to_hash
|
|
1765
|
+
end
|
|
1766
|
+
|
|
1767
|
+
end
|
|
1768
|
+
|
|
1769
|
+
# The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
|
|
1770
|
+
# `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1771
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1772
|
+
# `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
|
|
1773
|
+
# `chatgpt-image-latest`. Default: `gpt-image-1`.
|
|
1774
|
+
module Model
|
|
1775
|
+
extend OpenAI::Internal::Type::Union
|
|
1776
|
+
|
|
1777
|
+
Variants = T.type_alias {
|
|
1778
|
+
T.any(
|
|
1779
|
+
String,
|
|
1780
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1781
|
+
)
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
sig {
|
|
1785
|
+
override.returns(
|
|
1786
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::Variants]
|
|
1787
|
+
)
|
|
1788
|
+
}
|
|
1789
|
+
def self.variants
|
|
1790
|
+
end
|
|
1791
|
+
|
|
1792
|
+
TaggedSymbol = T.type_alias do
|
|
1793
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model)
|
|
1794
|
+
end
|
|
1795
|
+
|
|
1796
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1797
|
+
|
|
1798
|
+
GPT_IMAGE_1 = T.let(
|
|
1799
|
+
:"gpt-image-1",
|
|
1800
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1801
|
+
)
|
|
1802
|
+
GPT_IMAGE_1_MINI = T.let(
|
|
1803
|
+
:"gpt-image-1-mini",
|
|
1804
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1805
|
+
)
|
|
1806
|
+
GPT_IMAGE_2 = T.let(
|
|
1807
|
+
:"gpt-image-2",
|
|
1808
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1809
|
+
)
|
|
1810
|
+
GPT_IMAGE_2_2026_04_21 = T.let(
|
|
1811
|
+
:"gpt-image-2-2026-04-21",
|
|
1812
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1813
|
+
)
|
|
1814
|
+
GPT_IMAGE_2_5_SUNBURST = T.let(
|
|
1815
|
+
:"gpt-image-2.5-sunburst",
|
|
1816
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1817
|
+
)
|
|
1818
|
+
GPT_IMAGE_2_5_SUNBURST_2026_09_08 = T.let(
|
|
1819
|
+
:"gpt-image-2.5-sunburst-2026-09-08",
|
|
1820
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1821
|
+
)
|
|
1822
|
+
GPT_IMAGE_2_5_FLARE = T.let(
|
|
1823
|
+
:"gpt-image-2.5-flare",
|
|
1824
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1825
|
+
)
|
|
1826
|
+
GPT_IMAGE_2_5_FLARE_2026_09_08 = T.let(
|
|
1827
|
+
:"gpt-image-2.5-flare-2026-09-08",
|
|
1828
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1829
|
+
)
|
|
1830
|
+
GPT_IMAGE_1_5 = T.let(
|
|
1831
|
+
:"gpt-image-1.5",
|
|
1832
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1833
|
+
)
|
|
1834
|
+
CHATGPT_IMAGE_LATEST = T.let(
|
|
1835
|
+
:"chatgpt-image-latest",
|
|
1836
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
|
|
1837
|
+
)
|
|
1838
|
+
|
|
1839
|
+
end
|
|
1840
|
+
|
|
1841
|
+
# Moderation level for the generated image. Default: `auto`.
|
|
1842
|
+
module Moderation
|
|
1843
|
+
extend OpenAI::Internal::Type::Enum
|
|
1844
|
+
|
|
1845
|
+
TaggedSymbol = T.type_alias {
|
|
1846
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation)
|
|
1847
|
+
}
|
|
1848
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1849
|
+
|
|
1850
|
+
AUTO = T.let(
|
|
1851
|
+
:auto,
|
|
1852
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::TaggedSymbol
|
|
1853
|
+
)
|
|
1854
|
+
LOW = T.let(
|
|
1855
|
+
:low,
|
|
1856
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::TaggedSymbol
|
|
1857
|
+
)
|
|
1858
|
+
|
|
1859
|
+
sig {
|
|
1860
|
+
override.returns(
|
|
1861
|
+
T::Array[
|
|
1862
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation::TaggedSymbol
|
|
1863
|
+
]
|
|
1864
|
+
)
|
|
1865
|
+
}
|
|
1866
|
+
def self.values
|
|
1867
|
+
end
|
|
1868
|
+
end
|
|
1869
|
+
|
|
1870
|
+
# The output format of the generated image. One of `png`, `webp`, or `jpeg`.
|
|
1871
|
+
# Default: `png`.
|
|
1872
|
+
module OutputFormat
|
|
1873
|
+
extend OpenAI::Internal::Type::Enum
|
|
1874
|
+
|
|
1875
|
+
TaggedSymbol = T.type_alias {
|
|
1876
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat)
|
|
1877
|
+
}
|
|
1878
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1879
|
+
|
|
1880
|
+
PNG = T.let(
|
|
1881
|
+
:png,
|
|
1882
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::TaggedSymbol
|
|
1883
|
+
)
|
|
1884
|
+
WEBP = T.let(
|
|
1885
|
+
:webp,
|
|
1886
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::TaggedSymbol
|
|
1887
|
+
)
|
|
1888
|
+
JPEG = T.let(
|
|
1889
|
+
:jpeg,
|
|
1890
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::TaggedSymbol
|
|
1891
|
+
)
|
|
1892
|
+
|
|
1893
|
+
sig {
|
|
1894
|
+
override.returns(
|
|
1895
|
+
T::Array[
|
|
1896
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat::TaggedSymbol
|
|
1897
|
+
]
|
|
1898
|
+
)
|
|
1899
|
+
}
|
|
1900
|
+
def self.values
|
|
1901
|
+
end
|
|
1902
|
+
end
|
|
1903
|
+
|
|
1904
|
+
# The quality of the generated image. The GPT image models support `low`,
|
|
1905
|
+
# `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
|
|
1906
|
+
# including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
|
|
1907
|
+
# `auto`.
|
|
1908
|
+
module Quality
|
|
1909
|
+
extend OpenAI::Internal::Type::Enum
|
|
1910
|
+
|
|
1911
|
+
TaggedSymbol = T.type_alias {
|
|
1912
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality)
|
|
1913
|
+
}
|
|
1914
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1915
|
+
|
|
1916
|
+
LOW = T.let(
|
|
1917
|
+
:low,
|
|
1918
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1919
|
+
)
|
|
1920
|
+
MEDIUM = T.let(
|
|
1921
|
+
:medium,
|
|
1922
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1923
|
+
)
|
|
1924
|
+
HIGH = T.let(
|
|
1925
|
+
:high,
|
|
1926
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1927
|
+
)
|
|
1928
|
+
XHIGH = T.let(
|
|
1929
|
+
:xhigh,
|
|
1930
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1931
|
+
)
|
|
1932
|
+
MAX = T.let(
|
|
1933
|
+
:max,
|
|
1934
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1935
|
+
)
|
|
1936
|
+
AUTO = T.let(
|
|
1937
|
+
:auto,
|
|
1938
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1939
|
+
)
|
|
1940
|
+
|
|
1941
|
+
sig {
|
|
1942
|
+
override.returns(
|
|
1943
|
+
T::Array[
|
|
1944
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality::TaggedSymbol
|
|
1945
|
+
]
|
|
1946
|
+
)
|
|
1947
|
+
}
|
|
1948
|
+
def self.values
|
|
1949
|
+
end
|
|
1950
|
+
end
|
|
1951
|
+
|
|
1952
|
+
# The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
|
|
1953
|
+
# `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
|
|
1954
|
+
# `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
|
|
1955
|
+
# resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
|
|
1956
|
+
# Width and height must both be divisible by 16 and the requested aspect ratio
|
|
1957
|
+
# must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
|
|
1958
|
+
# the maximum supported resolution is `3840x2160`. The requested size must also
|
|
1959
|
+
# satisfy the model's current pixel and edge limits. The standard sizes
|
|
1960
|
+
# `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
|
|
1961
|
+
# `auto` is supported for models that allow automatic sizing.
|
|
1962
|
+
module Size
|
|
1963
|
+
extend OpenAI::Internal::Type::Union
|
|
1964
|
+
|
|
1965
|
+
Variants = T.type_alias {
|
|
1966
|
+
T.any(
|
|
1967
|
+
String,
|
|
1968
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
|
|
1969
|
+
)
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
sig {
|
|
1973
|
+
override.returns(
|
|
1974
|
+
T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::Variants]
|
|
1975
|
+
)
|
|
1976
|
+
}
|
|
1977
|
+
def self.variants
|
|
1978
|
+
end
|
|
1979
|
+
|
|
1980
|
+
TaggedSymbol = T.type_alias do
|
|
1981
|
+
T.all(Symbol, OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size)
|
|
1982
|
+
end
|
|
1983
|
+
|
|
1984
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1985
|
+
|
|
1986
|
+
SIZE_1024X1024 = T.let(
|
|
1987
|
+
:"1024x1024",
|
|
1988
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
|
|
1989
|
+
)
|
|
1990
|
+
SIZE_1024X1536 = T.let(
|
|
1991
|
+
:"1024x1536",
|
|
1992
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
|
|
1993
|
+
)
|
|
1994
|
+
SIZE_1536X1024 = T.let(
|
|
1995
|
+
:"1536x1024",
|
|
1996
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
|
|
1997
|
+
)
|
|
1998
|
+
AUTO = T.let(
|
|
1999
|
+
:auto,
|
|
2000
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
|
|
2001
|
+
)
|
|
2002
|
+
|
|
2003
|
+
end
|
|
2004
|
+
end
|
|
2005
|
+
|
|
2006
|
+
class LocalShell < OpenAI::Internal::Type::BaseModel
|
|
2007
|
+
OrHash = T.type_alias do
|
|
2008
|
+
T.any(
|
|
2009
|
+
OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::LocalShell,
|
|
2010
|
+
OpenAI::Internal::AnyHash
|
|
2011
|
+
)
|
|
2012
|
+
end
|
|
2013
|
+
|
|
2014
|
+
# The type of the local shell tool. Always `local_shell`.
|
|
2015
|
+
sig { returns(Symbol) }
|
|
2016
|
+
attr_accessor :type
|
|
2017
|
+
|
|
2018
|
+
# A tool that allows the model to execute shell commands in a local environment.
|
|
2019
|
+
sig do
|
|
2020
|
+
params(
|
|
2021
|
+
|
|
2022
|
+
type: Symbol
|
|
2023
|
+
)
|
|
2024
|
+
.returns(T.attached_class)
|
|
2025
|
+
end
|
|
2026
|
+
def self.new(
|
|
2027
|
+
|
|
2028
|
+
# The type of the local shell tool. Always `local_shell`.
|
|
2029
|
+
|
|
2030
|
+
type: :local_shell
|
|
2031
|
+
)
|
|
2032
|
+
end
|
|
2033
|
+
|
|
2034
|
+
sig do
|
|
2035
|
+
override.returns(
|
|
2036
|
+
{type: Symbol}
|
|
2037
|
+
)
|
|
2038
|
+
end
|
|
2039
|
+
def to_hash
|
|
2040
|
+
end
|
|
2041
|
+
|
|
2042
|
+
end
|
|
2043
|
+
|
|
2044
|
+
sig { override.returns(T::Array[OpenAI::Beta::BetaResponseToolSearchOutputItemParam::Tool::Variants]) }
|
|
2045
|
+
def self.variants
|
|
2046
|
+
end
|
|
2047
|
+
|
|
2048
|
+
end
|
|
2049
|
+
|
|
175
2050
|
class Agent < OpenAI::Internal::Type::BaseModel
|
|
176
2051
|
OrHash = T.type_alias do
|
|
177
2052
|
T.any(
|