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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +1166 -3
  6. data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
  7. data/lib/openai/models/decision.rb +313 -0
  8. data/lib/openai/models/decision_create_params.rb +233 -0
  9. data/lib/openai/models/decision_input_image.rb +53 -0
  10. data/lib/openai/models/decision_input_message.rb +60 -0
  11. data/lib/openai/models/decision_input_part.rb +20 -0
  12. data/lib/openai/models/decision_input_text.rb +21 -0
  13. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
  14. data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
  15. data/lib/openai/models.rb +12 -0
  16. data/lib/openai/resources/decisions.rb +59 -0
  17. data/lib/openai/version.rb +1 -1
  18. data/lib/openai.rb +9 -0
  19. data/rbi/openai/client.rbi +3 -0
  20. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
  21. data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
  22. data/rbi/openai/models/decision.rbi +586 -0
  23. data/rbi/openai/models/decision_create_params.rbi +435 -0
  24. data/rbi/openai/models/decision_input_image.rbi +81 -0
  25. data/rbi/openai/models/decision_input_message.rbi +96 -0
  26. data/rbi/openai/models/decision_input_part.rbi +24 -0
  27. data/rbi/openai/models/decision_input_text.rbi +49 -0
  28. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
  29. data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
  30. data/rbi/openai/models.rbi +12 -0
  31. data/rbi/openai/resources/decisions.rbi +57 -0
  32. data/sig/openai/client.rbs +2 -0
  33. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
  34. data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
  35. data/sig/openai/models/decision.rbs +296 -0
  36. data/sig/openai/models/decision_create_params.rbs +227 -0
  37. data/sig/openai/models/decision_input_image.rbs +51 -0
  38. data/sig/openai/models/decision_input_message.rbs +57 -0
  39. data/sig/openai/models/decision_input_part.rbs +12 -0
  40. data/sig/openai/models/decision_input_text.rbs +15 -0
  41. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
  42. data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
  43. data/sig/openai/models.rbs +12 -0
  44. data/sig/openai/resources/decisions.rbs +15 -0
  45. metadata +28 -1
@@ -7,8 +7,11 @@ module OpenAI
7
7
  # @!attribute tools
8
8
  # The loaded tool definitions returned by the tool search output.
9
9
  #
10
- # @return [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::ComputerUsePreviewTool, OpenAI::Models::Responses::Tool::Mcp, OpenAI::Models::Responses::Tool::CodeInterpreter, OpenAI::Models::Responses::Tool::ProgrammaticToolCalling, OpenAI::Models::Responses::Tool::ImageGeneration, OpenAI::Models::Responses::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::NamespaceTool, OpenAI::Models::Responses::ToolSearchTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>]
11
- required :tools, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Responses::Tool] }
10
+ # @return [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::ComputerUsePreviewTool, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::ToolSearchOutputNamespaceTool, OpenAI::Models::Responses::ToolSearchTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>]
11
+ required(
12
+ :tools,
13
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool] }
14
+ )
12
15
 
13
16
  # @!attribute type
14
17
  # The item type. Always `tool_search_output`.
@@ -47,7 +50,7 @@ module OpenAI
47
50
  )
48
51
 
49
52
  # @!method initialize(tools:, id: nil, call_id: nil, execution: nil, status: nil, type: :tool_search_output)
50
- # @param tools [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::ComputerUsePreviewTool, OpenAI::Models::Responses::Tool::Mcp, OpenAI::Models::Responses::Tool::CodeInterpreter, OpenAI::Models::Responses::Tool::ProgrammaticToolCalling, OpenAI::Models::Responses::Tool::ImageGeneration, OpenAI::Models::Responses::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::NamespaceTool, OpenAI::Models::Responses::ToolSearchTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>]
53
+ # @param tools [Array<OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::ComputerUsePreviewTool, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::ToolSearchOutputNamespaceTool, OpenAI::Models::Responses::ToolSearchTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool>]
51
54
  # The loaded tool definitions returned by the tool search output.
52
55
  #
53
56
  # @param id [String, nil]
@@ -65,6 +68,1166 @@ module OpenAI
65
68
  # @param type [Symbol, :tool_search_output]
66
69
  # The item type. Always `tool_search_output`.
67
70
 
71
+ # A tool definition returned by a tool search output.
72
+ module Tool
73
+ extend OpenAI::Internal::Type::Union
74
+
75
+ # Defines a function in your own code the model can choose to call. Learn more about [function calling](https://developers.openai.com/api/docs/guides/function-calling).
76
+ variant -> { OpenAI::Responses::FunctionTool }
77
+
78
+ # A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://developers.openai.com/api/docs/guides/tools-file-search).
79
+ variant -> { OpenAI::Responses::FileSearchTool }
80
+
81
+ # A tool that controls a virtual computer. Learn more about the [computer tool](https://developers.openai.com/api/docs/guides/tools-computer-use).
82
+ variant -> { OpenAI::Responses::ComputerTool }
83
+
84
+ # A tool that controls a virtual computer. Learn more about the [computer tool](https://developers.openai.com/api/docs/guides/tools-computer-use).
85
+ variant -> { OpenAI::Responses::ComputerUsePreviewTool }
86
+
87
+ # Give the model access to additional tools via remote Model Context Protocol
88
+ # (MCP) servers. [Learn more about MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).
89
+ variant -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp }
90
+
91
+ # A tool that runs Python code to help generate a response to a prompt.
92
+ variant -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter }
93
+
94
+ variant -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling }
95
+
96
+ # A tool that generates images using the GPT image models.
97
+ variant -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration }
98
+
99
+ # A tool that allows the model to execute shell commands in a local environment.
100
+ variant -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::LocalShell }
101
+
102
+ # A tool that allows the model to execute shell commands.
103
+ variant -> { OpenAI::Responses::FunctionShellTool }
104
+
105
+ # A custom tool that processes input using a specified format. Learn more about [custom tools](https://developers.openai.com/api/docs/guides/function-calling#custom-tools)
106
+ variant -> { OpenAI::Responses::CustomTool }
107
+
108
+ # Groups function/custom tools under a shared namespace.
109
+ variant -> { OpenAI::Responses::ToolSearchOutputNamespaceTool }
110
+
111
+ # Hosted or BYOT tool search configuration for deferred tools.
112
+ variant -> { OpenAI::Responses::ToolSearchTool }
113
+
114
+ # Allows the assistant to create, delete, or update files using unified diffs.
115
+ variant -> { OpenAI::Responses::ApplyPatchTool }
116
+
117
+ # Search the Internet for sources related to the prompt. Learn more about the
118
+ # [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search).
119
+ variant -> { OpenAI::Responses::WebSearchTool }
120
+
121
+ # This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://developers.openai.com/api/docs/guides/tools-web-search).
122
+ variant -> { OpenAI::Responses::WebSearchPreviewTool }
123
+
124
+ class Mcp < OpenAI::Internal::Type::BaseModel
125
+ # @!attribute server_label
126
+ # A label for this MCP server, used to identify it in tool calls.
127
+ #
128
+ # @return [String]
129
+ required :server_label, String
130
+
131
+ # @!attribute type
132
+ # The type of the MCP tool. Always `mcp`.
133
+ #
134
+ # @return [Symbol, :mcp]
135
+ required :type, const: :mcp
136
+
137
+ # @!attribute allowed_callers
138
+ # The tool invocation context(s).
139
+ #
140
+ # @return [Array<Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller>, nil]
141
+ optional(
142
+ :allowed_callers,
143
+ -> {
144
+ OpenAI::Internal::Type::ArrayOf[
145
+ enum: OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller
146
+ ]
147
+ },
148
+ nil?: true
149
+ )
150
+
151
+ # @!attribute allowed_tools
152
+ # List of allowed tool names or a filter object.
153
+ #
154
+ # @return [Array<String>, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter, nil]
155
+ optional(
156
+ :allowed_tools,
157
+ union: -> {
158
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools
159
+ },
160
+ nil?: true
161
+ )
162
+
163
+ # @!attribute authorization
164
+ # An OAuth access token that can be used with a remote MCP server, either with a
165
+ # custom MCP server URL or a service connector. Your application must handle the
166
+ # OAuth authorization flow and provide the token here.
167
+ #
168
+ # @return [String, nil]
169
+ optional :authorization, String
170
+
171
+ # @!attribute connector_id
172
+ # @deprecated
173
+ #
174
+ # Identifier for service connectors, like those available in ChatGPT. One of
175
+ # `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
176
+ # service connectors
177
+ # [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
178
+ #
179
+ # This field is deprecated for models released after September 1, 2026. Use
180
+ # `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
181
+ # through a Secure MCP Tunnel.
182
+ #
183
+ # Currently supported `connector_id` values are:
184
+ #
185
+ # - Dropbox: `connector_dropbox`
186
+ # - Gmail: `connector_gmail`
187
+ # - Google Calendar: `connector_googlecalendar`
188
+ # - Google Drive: `connector_googledrive`
189
+ # - Microsoft Teams: `connector_microsoftteams`
190
+ # - Outlook Calendar: `connector_outlookcalendar`
191
+ # - Outlook Email: `connector_outlookemail`
192
+ # - SharePoint: `connector_sharepoint`
193
+ #
194
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID, nil]
195
+ optional(
196
+ :connector_id,
197
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID }
198
+ )
199
+
200
+ # @!attribute defer_loading
201
+ # Whether this MCP tool is deferred and discovered via tool search.
202
+ #
203
+ # @return [Boolean, nil]
204
+ optional :defer_loading, OpenAI::Internal::Type::Boolean
205
+
206
+ # @!attribute headers
207
+ # Optional HTTP headers to send to the MCP server. Use for authentication or other
208
+ # purposes.
209
+ #
210
+ # @return [Hash{Symbol=>String}, nil]
211
+ optional :headers, OpenAI::Internal::Type::HashOf[String], nil?: true
212
+
213
+ # @!attribute require_approval
214
+ # Specify which of the MCP server's tools require approval.
215
+ #
216
+ # @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil]
217
+ optional(
218
+ :require_approval,
219
+ union: -> {
220
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval
221
+ },
222
+ nil?: true
223
+ )
224
+
225
+ # @!attribute server_description
226
+ # Optional description of the MCP server, used to provide more context.
227
+ #
228
+ # @return [String, nil]
229
+ optional :server_description, String
230
+
231
+ # @!attribute server_url
232
+ # The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id`
233
+ # must be provided.
234
+ #
235
+ # @return [String, nil]
236
+ optional :server_url, String
237
+
238
+ # @!attribute tunnel_id
239
+ # The Secure MCP Tunnel ID to use instead of a direct server URL. One of
240
+ # `server_url`, `connector_id`, or `tunnel_id` must be provided.
241
+ #
242
+ # @return [String, nil]
243
+ optional :tunnel_id, String
244
+
245
+ # @!method initialize(server_label:, allowed_callers: nil, allowed_tools: nil, authorization: nil, connector_id: nil, defer_loading: nil, headers: nil, require_approval: nil, server_description: nil, server_url: nil, tunnel_id: nil, type: :mcp)
246
+ # Give the model access to additional tools via remote Model Context Protocol
247
+ # (MCP) servers.
248
+ # [Learn more about MCP](https://developers.openai.com/api/docs/guides/tools-connectors-mcp).
249
+ #
250
+ # @param server_label [String]
251
+ # A label for this MCP server, used to identify it in tool calls.
252
+ #
253
+ # @param allowed_callers [Array<Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedCaller>, nil]
254
+ # The tool invocation context(s).
255
+ #
256
+ # @param allowed_tools [Array<String>, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter, nil]
257
+ # List of allowed tool names or a filter object.
258
+ #
259
+ # @param authorization [String]
260
+ # An OAuth access token that can be used with a remote MCP server, either with a
261
+ # custom MCP server URL or a service connector. Your application must handle the
262
+ # OAuth authorization flow and provide the token here.
263
+ #
264
+ # @param connector_id [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::ConnectorID]
265
+ # Identifier for service connectors, like those available in ChatGPT. One of
266
+ # `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
267
+ # service connectors
268
+ # [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
269
+ #
270
+ # This field is deprecated for models released after September 1, 2026. Use
271
+ # `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
272
+ # through a Secure MCP Tunnel.
273
+ #
274
+ # Currently supported `connector_id` values are:
275
+ #
276
+ # - Dropbox: `connector_dropbox`
277
+ # - Gmail: `connector_gmail`
278
+ # - Google Calendar: `connector_googlecalendar`
279
+ # - Google Drive: `connector_googledrive`
280
+ # - Microsoft Teams: `connector_microsoftteams`
281
+ # - Outlook Calendar: `connector_outlookcalendar`
282
+ # - Outlook Email: `connector_outlookemail`
283
+ # - SharePoint: `connector_sharepoint`
284
+ #
285
+ # @param defer_loading [Boolean]
286
+ # Whether this MCP tool is deferred and discovered via tool search.
287
+ #
288
+ # @param headers [Hash{Symbol=>String}, nil]
289
+ # Optional HTTP headers to send to the MCP server. Use for authentication or other
290
+ # purposes.
291
+ #
292
+ # @param require_approval [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil]
293
+ # Specify which of the MCP server's tools require approval.
294
+ #
295
+ # @param server_description [String]
296
+ # Optional description of the MCP server, used to provide more context.
297
+ #
298
+ # @param server_url [String]
299
+ # The URL for the MCP server. One of `server_url`, `connector_id`, or `tunnel_id`
300
+ # must be provided.
301
+ #
302
+ # @param tunnel_id [String]
303
+ # The Secure MCP Tunnel ID to use instead of a direct server URL. One of
304
+ # `server_url`, `connector_id`, or `tunnel_id` must be provided.
305
+ #
306
+ # @param type [Symbol, :mcp]
307
+ # The type of the MCP tool. Always `mcp`.
308
+ module AllowedCaller
309
+ extend OpenAI::Internal::Type::Enum
310
+
311
+ DIRECT = :direct
312
+ PROGRAMMATIC = :programmatic
313
+
314
+ # @!method self.values
315
+ # @return [Array<Symbol>]
316
+ end
317
+
318
+ # List of allowed tool names or a filter object.
319
+ #
320
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp#allowed_tools
321
+ module AllowedTools
322
+ extend OpenAI::Internal::Type::Union
323
+
324
+ # A string array of allowed tool names
325
+ variant(
326
+ -> {
327
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::StringArray
328
+ }
329
+ )
330
+
331
+ # A filter object to specify which tools are allowed.
332
+ variant(
333
+ -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter }
334
+ )
335
+
336
+ class McpToolFilter < OpenAI::Internal::Type::BaseModel
337
+ # @!attribute read_only
338
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
339
+ # is
340
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
341
+ # it will match this filter.
342
+ #
343
+ # @return [Boolean, nil]
344
+ optional :read_only, OpenAI::Internal::Type::Boolean
345
+
346
+ # @!attribute tool_names
347
+ # List of allowed tool names.
348
+ #
349
+ # @return [Array<String>, nil]
350
+ optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
351
+
352
+ # @!method initialize(read_only: nil, tool_names: nil)
353
+ # A filter object to specify which tools are allowed.
354
+ #
355
+ # @param read_only [Boolean]
356
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
357
+ # is
358
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
359
+ # it will match this filter.
360
+ #
361
+ # @param tool_names [Array<String>]
362
+ # List of allowed tool names.
363
+ end
364
+
365
+ # @!method self.variants
366
+ # @return [Array(Array<String>, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::AllowedTools::McpToolFilter)]
367
+
368
+ # @type [OpenAI::Internal::Type::Converter]
369
+ StringArray = OpenAI::Internal::Type::ArrayOf[String]
370
+ end
371
+
372
+ # @deprecated
373
+ #
374
+ # Identifier for service connectors, like those available in ChatGPT. One of
375
+ # `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more about
376
+ # service connectors
377
+ # [here](https://developers.openai.com/api/docs/guides/tools-connectors-mcp#connectors).
378
+ #
379
+ # This field is deprecated for models released after September 1, 2026. Use
380
+ # `server_url` to connect to a remote MCP server, or `tunnel_id` to connect
381
+ # through a Secure MCP Tunnel.
382
+ #
383
+ # Currently supported `connector_id` values are:
384
+ #
385
+ # - Dropbox: `connector_dropbox`
386
+ # - Gmail: `connector_gmail`
387
+ # - Google Calendar: `connector_googlecalendar`
388
+ # - Google Drive: `connector_googledrive`
389
+ # - Microsoft Teams: `connector_microsoftteams`
390
+ # - Outlook Calendar: `connector_outlookcalendar`
391
+ # - Outlook Email: `connector_outlookemail`
392
+ # - SharePoint: `connector_sharepoint`
393
+ #
394
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp#connector_id
395
+ module ConnectorID
396
+ extend OpenAI::Internal::Type::Enum
397
+
398
+ CONNECTOR_DROPBOX = :connector_dropbox
399
+ CONNECTOR_GMAIL = :connector_gmail
400
+ CONNECTOR_GOOGLECALENDAR = :connector_googlecalendar
401
+ CONNECTOR_GOOGLEDRIVE = :connector_googledrive
402
+ CONNECTOR_MICROSOFTTEAMS = :connector_microsoftteams
403
+ CONNECTOR_OUTLOOKCALENDAR = :connector_outlookcalendar
404
+ CONNECTOR_OUTLOOKEMAIL = :connector_outlookemail
405
+ CONNECTOR_SHAREPOINT = :connector_sharepoint
406
+
407
+ # @!method self.values
408
+ # @return [Array<Symbol>]
409
+ end
410
+
411
+ # Specify which of the MCP server's tools require approval.
412
+ #
413
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp#require_approval
414
+ module RequireApproval
415
+ extend OpenAI::Internal::Type::Union
416
+
417
+ # Specify which of the MCP server's tools require approval. Can be
418
+ # `always`, `never`, or a filter object associated with tools
419
+ # that require approval.
420
+ variant(
421
+ -> {
422
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter
423
+ }
424
+ )
425
+
426
+ # Specify a single approval policy for all tools. One of `always` or
427
+ # `never`. When set to `always`, all tools will require approval. When
428
+ # set to `never`, all tools will not require approval.
429
+ variant(
430
+ enum: -> {
431
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting
432
+ }
433
+ )
434
+
435
+ class McpToolApprovalFilter < OpenAI::Internal::Type::BaseModel
436
+ # @!attribute always
437
+ # A filter object to specify which tools are allowed.
438
+ #
439
+ # @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always, nil]
440
+ optional(
441
+ :always,
442
+ -> {
443
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always
444
+ }
445
+ )
446
+
447
+ # @!attribute never
448
+ # A filter object to specify which tools are allowed.
449
+ #
450
+ # @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never, nil]
451
+ optional(
452
+ :never,
453
+ -> {
454
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never
455
+ }
456
+ )
457
+
458
+ # @!method initialize(always: nil, never: nil)
459
+ # Specify which of the MCP server's tools require approval. Can be `always`,
460
+ # `never`, or a filter object associated with tools that require approval.
461
+ #
462
+ # @param always [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Always]
463
+ # A filter object to specify which tools are allowed.
464
+ #
465
+ # @param never [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter::Never]
466
+ # A filter object to specify which tools are allowed.
467
+
468
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter#always
469
+ class Always < OpenAI::Internal::Type::BaseModel
470
+ # @!attribute read_only
471
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
472
+ # is
473
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
474
+ # it will match this filter.
475
+ #
476
+ # @return [Boolean, nil]
477
+ optional :read_only, OpenAI::Internal::Type::Boolean
478
+
479
+ # @!attribute tool_names
480
+ # List of allowed tool names.
481
+ #
482
+ # @return [Array<String>, nil]
483
+ optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
484
+
485
+ # @!method initialize(read_only: nil, tool_names: nil)
486
+ # A filter object to specify which tools are allowed.
487
+ #
488
+ # @param read_only [Boolean]
489
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
490
+ # is
491
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
492
+ # it will match this filter.
493
+ #
494
+ # @param tool_names [Array<String>]
495
+ # List of allowed tool names.
496
+ end
497
+
498
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter#never
499
+ class Never < OpenAI::Internal::Type::BaseModel
500
+ # @!attribute read_only
501
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
502
+ # is
503
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
504
+ # it will match this filter.
505
+ #
506
+ # @return [Boolean, nil]
507
+ optional :read_only, OpenAI::Internal::Type::Boolean
508
+
509
+ # @!attribute tool_names
510
+ # List of allowed tool names.
511
+ #
512
+ # @return [Array<String>, nil]
513
+ optional :tool_names, OpenAI::Internal::Type::ArrayOf[String]
514
+
515
+ # @!method initialize(read_only: nil, tool_names: nil)
516
+ # A filter object to specify which tools are allowed.
517
+ #
518
+ # @param read_only [Boolean]
519
+ # Indicates whether or not a tool modifies data or is read-only. If an MCP server
520
+ # is
521
+ # [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),
522
+ # it will match this filter.
523
+ #
524
+ # @param tool_names [Array<String>]
525
+ # List of allowed tool names.
526
+ end
527
+ end
528
+
529
+ # Specify a single approval policy for all tools. One of `always` or `never`. When
530
+ # set to `always`, all tools will require approval. When set to `never`, all tools
531
+ # will not require approval.
532
+ module McpToolApprovalSetting
533
+ extend OpenAI::Internal::Type::Enum
534
+
535
+ ALWAYS = :always
536
+ NEVER = :never
537
+
538
+ # @!method self.values
539
+ # @return [Array<Symbol>]
540
+ end
541
+
542
+ # @!method self.variants
543
+ # @return [Array(OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp::RequireApproval::McpToolApprovalSetting)]
544
+ end
545
+ end
546
+
547
+ class CodeInterpreter < OpenAI::Internal::Type::BaseModel
548
+ # @!attribute container
549
+ # The code interpreter container. Can be a container ID or an object that
550
+ # specifies uploaded file IDs to make available to your code, along with an
551
+ # optional `memory_limit` setting.
552
+ #
553
+ # @return [String, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto]
554
+ required(
555
+ :container,
556
+ union: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container }
557
+ )
558
+
559
+ # @!attribute type
560
+ # The type of the code interpreter tool. Always `code_interpreter`.
561
+ #
562
+ # @return [Symbol, :code_interpreter]
563
+ required :type, const: :code_interpreter
564
+
565
+ # @!attribute allowed_callers
566
+ # The tool invocation context(s).
567
+ #
568
+ # @return [Array<Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller>, nil]
569
+ optional(
570
+ :allowed_callers,
571
+ -> {
572
+ OpenAI::Internal::Type::ArrayOf[
573
+ enum: OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller
574
+ ]
575
+ },
576
+ nil?: true
577
+ )
578
+
579
+ # @!method initialize(container:, allowed_callers: nil, type: :code_interpreter)
580
+ # A tool that runs Python code to help generate a response to a prompt.
581
+ #
582
+ # @param container [String, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto]
583
+ # The code interpreter container. Can be a container ID or an object that
584
+ # specifies uploaded file IDs to make available to your code, along with an
585
+ # optional `memory_limit` setting.
586
+ #
587
+ # @param allowed_callers [Array<Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::AllowedCaller>, nil]
588
+ # The tool invocation context(s).
589
+ #
590
+ # @param type [Symbol, :code_interpreter]
591
+ # The type of the code interpreter tool. Always `code_interpreter`.
592
+
593
+ # The code interpreter container. Can be a container ID or an object that
594
+ # specifies uploaded file IDs to make available to your code, along with an
595
+ # optional `memory_limit` setting.
596
+ #
597
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter#container
598
+ module Container
599
+ extend OpenAI::Internal::Type::Union
600
+
601
+ # The container ID.
602
+ variant String
603
+
604
+ # Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.
605
+ variant(
606
+ -> {
607
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto
608
+ }
609
+ )
610
+
611
+ class CodeInterpreterToolAuto < OpenAI::Internal::Type::BaseModel
612
+ # @!attribute type
613
+ # Always `auto`.
614
+ #
615
+ # @return [Symbol, :auto]
616
+ required :type, const: :auto
617
+
618
+ # @!attribute file_ids
619
+ # An optional list of uploaded files to make available to your code.
620
+ #
621
+ # @return [Array<String>, nil]
622
+ optional :file_ids, OpenAI::Internal::Type::ArrayOf[String]
623
+
624
+ # @!attribute memory_limit
625
+ # The memory limit for the code interpreter container.
626
+ #
627
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit, nil]
628
+ optional(
629
+ :memory_limit,
630
+ enum: -> {
631
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit
632
+ },
633
+ nil?: true
634
+ )
635
+
636
+ # @!attribute network_policy
637
+ # Network access policy for the container.
638
+ #
639
+ # @return [OpenAI::Models::Responses::ContainerNetworkPolicyDisabled, OpenAI::Models::Responses::ContainerNetworkPolicyAllowlist, nil]
640
+ optional(
641
+ :network_policy,
642
+ union: -> {
643
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::NetworkPolicy
644
+ }
645
+ )
646
+
647
+ # @!method initialize(file_ids: nil, memory_limit: nil, network_policy: nil, type: :auto)
648
+ # Configuration for a code interpreter container. Optionally specify the IDs of
649
+ # the files to run the code on.
650
+ #
651
+ # @param file_ids [Array<String>]
652
+ # An optional list of uploaded files to make available to your code.
653
+ #
654
+ # @param memory_limit [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto::MemoryLimit, nil]
655
+ # The memory limit for the code interpreter container.
656
+ #
657
+ # @param network_policy [OpenAI::Models::Responses::ContainerNetworkPolicyDisabled, OpenAI::Models::Responses::ContainerNetworkPolicyAllowlist]
658
+ # Network access policy for the container.
659
+ #
660
+ # @param type [Symbol, :auto]
661
+ # Always `auto`.
662
+
663
+ # The memory limit for the code interpreter container.
664
+ #
665
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto#memory_limit
666
+ module MemoryLimit
667
+ extend OpenAI::Internal::Type::Enum
668
+
669
+ MEMORY_LIMIT_1G = :"1g"
670
+ MEMORY_LIMIT_4G = :"4g"
671
+ MEMORY_LIMIT_16G = :"16g"
672
+ MEMORY_LIMIT_64G = :"64g"
673
+
674
+ # @!method self.values
675
+ # @return [Array<Symbol>]
676
+ end
677
+
678
+ # Network access policy for the container.
679
+ #
680
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto#network_policy
681
+ module NetworkPolicy
682
+ extend OpenAI::Internal::Type::Union
683
+
684
+ discriminator :type
685
+
686
+ variant :disabled, -> { OpenAI::Responses::ContainerNetworkPolicyDisabled }
687
+
688
+ variant :allowlist, -> { OpenAI::Responses::ContainerNetworkPolicyAllowlist }
689
+
690
+ # @!method self.variants
691
+ # @return [Array(OpenAI::Models::Responses::ContainerNetworkPolicyDisabled, OpenAI::Models::Responses::ContainerNetworkPolicyAllowlist)]
692
+ end
693
+ end
694
+
695
+ # @!method self.variants
696
+ # @return [Array(String, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter::Container::CodeInterpreterToolAuto)]
697
+ end
698
+
699
+ module AllowedCaller
700
+ extend OpenAI::Internal::Type::Enum
701
+
702
+ DIRECT = :direct
703
+ PROGRAMMATIC = :programmatic
704
+
705
+ # @!method self.values
706
+ # @return [Array<Symbol>]
707
+ end
708
+ end
709
+
710
+ class ProgrammaticToolCalling < OpenAI::Internal::Type::BaseModel
711
+ # @!attribute type
712
+ # The type of the tool. Always `programmatic_tool_calling`.
713
+ #
714
+ # @return [Symbol, :programmatic_tool_calling]
715
+ required :type, const: :programmatic_tool_calling
716
+
717
+ # @!method initialize(type: :programmatic_tool_calling)
718
+ # @param type [Symbol, :programmatic_tool_calling]
719
+ # The type of the tool. Always `programmatic_tool_calling`.
720
+ end
721
+
722
+ class ImageGeneration < OpenAI::Internal::Type::BaseModel
723
+ # @!attribute type
724
+ # The type of the image generation tool. Always `image_generation`.
725
+ #
726
+ # @return [Symbol, :image_generation]
727
+ required :type, const: :image_generation
728
+
729
+ # @!attribute action
730
+ # Whether to generate a new image or edit an existing image. Default: `auto`.
731
+ #
732
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action, nil]
733
+ optional(
734
+ :action,
735
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action }
736
+ )
737
+
738
+ # @!attribute background
739
+ # Allows to set transparency for the background of the generated image(s). Must be
740
+ # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
741
+ # the model will automatically determine the best background for the image.
742
+ #
743
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
744
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
745
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
746
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
747
+ # set the output format to `png` or `webp`.
748
+ #
749
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background, nil]
750
+ optional(
751
+ :background,
752
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background }
753
+ )
754
+
755
+ # @!attribute input_fidelity
756
+ # Control how much effort the model will exert to match the style and features,
757
+ # especially facial features, of input images. Supports `high` and `low` on
758
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
759
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
760
+ #
761
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
762
+ optional(
763
+ :input_fidelity,
764
+ enum: -> {
765
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity
766
+ },
767
+ nil?: true
768
+ )
769
+
770
+ # @!attribute input_image_mask
771
+ # Optional mask for inpainting. Contains `image_url` (string, optional) and
772
+ # `file_id` (string, optional).
773
+ #
774
+ # @return [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask, nil]
775
+ optional(
776
+ :input_image_mask,
777
+ -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask }
778
+ )
779
+
780
+ # @!attribute model
781
+ # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
782
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
783
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
784
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
785
+ # `chatgpt-image-latest`. Default: `gpt-image-1`.
786
+ #
787
+ # @return [String, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model, nil]
788
+ optional(
789
+ :model,
790
+ union: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model }
791
+ )
792
+
793
+ # @!attribute moderation
794
+ # Moderation level for the generated image. Default: `auto`.
795
+ #
796
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation, nil]
797
+ optional(
798
+ :moderation,
799
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation }
800
+ )
801
+
802
+ # @!attribute output_compression
803
+ # Compression level for the output image. Default: 100.
804
+ #
805
+ # @return [Integer, nil]
806
+ optional :output_compression, Integer
807
+
808
+ # @!attribute output_format
809
+ # The output format of the generated image. One of `png`, `webp`, or `jpeg`.
810
+ # Default: `png`.
811
+ #
812
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat, nil]
813
+ optional(
814
+ :output_format,
815
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat }
816
+ )
817
+
818
+ # @!attribute partial_images
819
+ # Number of partial images to generate in streaming mode, from 0 (default value)
820
+ # to 3.
821
+ #
822
+ # @return [Integer, nil]
823
+ optional :partial_images, Integer
824
+
825
+ # @!attribute quality
826
+ # The quality of the generated image. The GPT image models support `low`,
827
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
828
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
829
+ # `auto`.
830
+ #
831
+ # @return [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality, nil]
832
+ optional(
833
+ :quality,
834
+ enum: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality }
835
+ )
836
+
837
+ # @!attribute size
838
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
839
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
840
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
841
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
842
+ # Width and height must both be divisible by 16 and the requested aspect ratio
843
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
844
+ # the maximum supported resolution is `3840x2160`. The requested size must also
845
+ # satisfy the model's current pixel and edge limits. The standard sizes
846
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
847
+ # `auto` is supported for models that allow automatic sizing.
848
+ #
849
+ # @return [String, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size, nil]
850
+ optional(
851
+ :size,
852
+ union: -> { OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size }
853
+ )
854
+
855
+ # @!method initialize(action: nil, background: nil, input_fidelity: nil, input_image_mask: nil, model: nil, moderation: nil, output_compression: nil, output_format: nil, partial_images: nil, quality: nil, size: nil, type: :image_generation)
856
+ # A tool that generates images using the GPT image models.
857
+ #
858
+ # @param action [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Action]
859
+ # Whether to generate a new image or edit an existing image. Default: `auto`.
860
+ #
861
+ # @param background [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Background]
862
+ # Allows to set transparency for the background of the generated image(s). Must be
863
+ # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
864
+ # the model will automatically determine the best background for the image.
865
+ #
866
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
867
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
868
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
869
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
870
+ # set the output format to `png` or `webp`.
871
+ #
872
+ # @param input_fidelity [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputFidelity, nil]
873
+ # Control how much effort the model will exert to match the style and features,
874
+ # especially facial features, of input images. Supports `high` and `low` on
875
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
876
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
877
+ #
878
+ # @param input_image_mask [OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::InputImageMask]
879
+ # Optional mask for inpainting. Contains `image_url` (string, optional) and
880
+ # `file_id` (string, optional).
881
+ #
882
+ # @param model [String, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model]
883
+ # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
884
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
885
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
886
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
887
+ # `chatgpt-image-latest`. Default: `gpt-image-1`.
888
+ #
889
+ # @param moderation [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Moderation]
890
+ # Moderation level for the generated image. Default: `auto`.
891
+ #
892
+ # @param output_compression [Integer]
893
+ # Compression level for the output image. Default: 100.
894
+ #
895
+ # @param output_format [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::OutputFormat]
896
+ # The output format of the generated image. One of `png`, `webp`, or `jpeg`.
897
+ # Default: `png`.
898
+ #
899
+ # @param partial_images [Integer]
900
+ # Number of partial images to generate in streaming mode, from 0 (default value)
901
+ # to 3.
902
+ #
903
+ # @param quality [Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Quality]
904
+ # The quality of the generated image. The GPT image models support `low`,
905
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
906
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
907
+ # `auto`.
908
+ #
909
+ # @param size [String, Symbol, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size]
910
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
911
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
912
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
913
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
914
+ # Width and height must both be divisible by 16 and the requested aspect ratio
915
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
916
+ # the maximum supported resolution is `3840x2160`. The requested size must also
917
+ # satisfy the model's current pixel and edge limits. The standard sizes
918
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
919
+ # `auto` is supported for models that allow automatic sizing.
920
+ #
921
+ # @param type [Symbol, :image_generation]
922
+ # The type of the image generation tool. Always `image_generation`.
923
+
924
+ # Whether to generate a new image or edit an existing image. Default: `auto`.
925
+ #
926
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#action
927
+ module Action
928
+ extend OpenAI::Internal::Type::Enum
929
+
930
+ GENERATE = :generate
931
+ EDIT = :edit
932
+ AUTO = :auto
933
+
934
+ # @!method self.values
935
+ # @return [Array<Symbol>]
936
+ end
937
+
938
+ # Allows to set transparency for the background of the generated image(s). Must be
939
+ # one of `transparent`, `opaque`, or `auto` (default value). When `auto` is used,
940
+ # the model will automatically determine the best background for the image.
941
+ #
942
+ # `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`, including their `2026-09-08`
943
+ # snapshots, support `opaque` and `transparent` backgrounds. Transparent
944
+ # backgrounds are available for supported GPT Image models. For `gpt-image-2` and
945
+ # `gpt-image-2-2026-04-21`, this support is in preview. When using `transparent`,
946
+ # set the output format to `png` or `webp`.
947
+ #
948
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#background
949
+ module Background
950
+ extend OpenAI::Internal::Type::Enum
951
+
952
+ TRANSPARENT = :transparent
953
+ OPAQUE = :opaque
954
+ AUTO = :auto
955
+
956
+ # @!method self.values
957
+ # @return [Array<Symbol>]
958
+ end
959
+
960
+ # Control how much effort the model will exert to match the style and features,
961
+ # especially facial features, of input images. Supports `high` and `low` on
962
+ # `gpt-image-1` and `gpt-image-1.5`; `gpt-image-1-mini` supports only `low`. For
963
+ # `gpt-image-2`, omit this parameter. Defaults to `low` on supported models.
964
+ #
965
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#input_fidelity
966
+ module InputFidelity
967
+ extend OpenAI::Internal::Type::Enum
968
+
969
+ HIGH = :high
970
+ LOW = :low
971
+
972
+ # @!method self.values
973
+ # @return [Array<Symbol>]
974
+ end
975
+
976
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#input_image_mask
977
+ class InputImageMask < OpenAI::Internal::Type::BaseModel
978
+ # @!attribute file_id
979
+ # File ID for the mask image.
980
+ #
981
+ # @return [String, nil]
982
+ optional :file_id, String
983
+
984
+ # @!attribute image_url
985
+ # Base64-encoded mask image.
986
+ #
987
+ # @return [String, nil]
988
+ optional :image_url, String
989
+
990
+ # @!method initialize(file_id: nil, image_url: nil)
991
+ # Optional mask for inpainting. Contains `image_url` (string, optional) and
992
+ # `file_id` (string, optional).
993
+ #
994
+ # @param file_id [String]
995
+ # File ID for the mask image.
996
+ #
997
+ # @param image_url [String]
998
+ # Base64-encoded mask image.
999
+ end
1000
+
1001
+ # The image generation model to use. One of `gpt-image-1`, `gpt-image-1-mini`,
1002
+ # `gpt-image-1.5`, `gpt-image-2`, `gpt-image-2-2026-04-21`,
1003
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1004
+ # `gpt-image-2.5-flare`, `gpt-image-2.5-flare-2026-09-08`, or
1005
+ # `chatgpt-image-latest`. Default: `gpt-image-1`.
1006
+ #
1007
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#model
1008
+ module Model
1009
+ extend OpenAI::Internal::Type::Union
1010
+
1011
+ variant String
1012
+
1013
+ variant(
1014
+ const: -> {
1015
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_1
1016
+ }
1017
+ )
1018
+
1019
+ variant(
1020
+ const: -> {
1021
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_1_MINI
1022
+ }
1023
+ )
1024
+
1025
+ variant(
1026
+ const: -> {
1027
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2
1028
+ }
1029
+ )
1030
+
1031
+ variant(
1032
+ const: -> {
1033
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_2026_04_21
1034
+ }
1035
+ )
1036
+
1037
+ variant(
1038
+ const: -> {
1039
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST
1040
+ }
1041
+ )
1042
+
1043
+ variant(
1044
+ const: -> {
1045
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_SUNBURST_2026_09_08
1046
+ }
1047
+ )
1048
+
1049
+ variant(
1050
+ const: -> {
1051
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE
1052
+ }
1053
+ )
1054
+
1055
+ variant(
1056
+ const: -> {
1057
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_2_5_FLARE_2026_09_08
1058
+ }
1059
+ )
1060
+
1061
+ variant(
1062
+ const: -> {
1063
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::GPT_IMAGE_1_5
1064
+ }
1065
+ )
1066
+
1067
+ variant(
1068
+ const: -> {
1069
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::CHATGPT_IMAGE_LATEST
1070
+ }
1071
+ )
1072
+
1073
+ # @!method self.variants
1074
+ # @return [Array(String, Symbol)]
1075
+
1076
+ define_sorbet_constant!(:Variants) do
1077
+ T.type_alias {
1078
+ T.any(
1079
+ String,
1080
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Model::TaggedSymbol
1081
+ )
1082
+ }
1083
+ end
1084
+
1085
+ # @!group
1086
+
1087
+ GPT_IMAGE_1 = :"gpt-image-1"
1088
+ GPT_IMAGE_1_MINI = :"gpt-image-1-mini"
1089
+ GPT_IMAGE_2 = :"gpt-image-2"
1090
+ GPT_IMAGE_2_2026_04_21 = :"gpt-image-2-2026-04-21"
1091
+ GPT_IMAGE_2_5_SUNBURST = :"gpt-image-2.5-sunburst"
1092
+ GPT_IMAGE_2_5_SUNBURST_2026_09_08 = :"gpt-image-2.5-sunburst-2026-09-08"
1093
+ GPT_IMAGE_2_5_FLARE = :"gpt-image-2.5-flare"
1094
+ GPT_IMAGE_2_5_FLARE_2026_09_08 = :"gpt-image-2.5-flare-2026-09-08"
1095
+ GPT_IMAGE_1_5 = :"gpt-image-1.5"
1096
+ CHATGPT_IMAGE_LATEST = :"chatgpt-image-latest"
1097
+
1098
+ # @!endgroup
1099
+ end
1100
+
1101
+ # Moderation level for the generated image. Default: `auto`.
1102
+ #
1103
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#moderation
1104
+ module Moderation
1105
+ extend OpenAI::Internal::Type::Enum
1106
+
1107
+ AUTO = :auto
1108
+ LOW = :low
1109
+
1110
+ # @!method self.values
1111
+ # @return [Array<Symbol>]
1112
+ end
1113
+
1114
+ # The output format of the generated image. One of `png`, `webp`, or `jpeg`.
1115
+ # Default: `png`.
1116
+ #
1117
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#output_format
1118
+ module OutputFormat
1119
+ extend OpenAI::Internal::Type::Enum
1120
+
1121
+ PNG = :png
1122
+ WEBP = :webp
1123
+ JPEG = :jpeg
1124
+
1125
+ # @!method self.values
1126
+ # @return [Array<Symbol>]
1127
+ end
1128
+
1129
+ # The quality of the generated image. The GPT image models support `low`,
1130
+ # `medium`, and `high`. `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare`,
1131
+ # including their `2026-09-08` snapshots, also support `xhigh` and `max`. Default:
1132
+ # `auto`.
1133
+ #
1134
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#quality
1135
+ module Quality
1136
+ extend OpenAI::Internal::Type::Enum
1137
+
1138
+ LOW = :low
1139
+ MEDIUM = :medium
1140
+ HIGH = :high
1141
+ XHIGH = :xhigh
1142
+ MAX = :max
1143
+ AUTO = :auto
1144
+
1145
+ # @!method self.values
1146
+ # @return [Array<Symbol>]
1147
+ end
1148
+
1149
+ # The size of the generated images. For `gpt-image-2`, `gpt-image-2-2026-04-21`,
1150
+ # `gpt-image-2.5-sunburst`, `gpt-image-2.5-sunburst-2026-09-08`,
1151
+ # `gpt-image-2.5-flare`, and `gpt-image-2.5-flare-2026-09-08`, arbitrary
1152
+ # resolutions are supported as `WIDTHxHEIGHT` strings, for example `1536x864`.
1153
+ # Width and height must both be divisible by 16 and the requested aspect ratio
1154
+ # must be between 1:3 and 3:1. Resolutions above `2560x1440` are experimental, and
1155
+ # the maximum supported resolution is `3840x2160`. The requested size must also
1156
+ # satisfy the model's current pixel and edge limits. The standard sizes
1157
+ # `1024x1024`, `1536x1024`, and `1024x1536` are supported by the GPT image models;
1158
+ # `auto` is supported for models that allow automatic sizing.
1159
+ #
1160
+ # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration#size
1161
+ module Size
1162
+ extend OpenAI::Internal::Type::Union
1163
+
1164
+ variant String
1165
+
1166
+ variant(
1167
+ const: -> {
1168
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::SIZE_1024X1024
1169
+ }
1170
+ )
1171
+
1172
+ variant(
1173
+ const: -> {
1174
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::SIZE_1024X1536
1175
+ }
1176
+ )
1177
+
1178
+ variant(
1179
+ const: -> {
1180
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::SIZE_1536X1024
1181
+ }
1182
+ )
1183
+
1184
+ variant(
1185
+ const: -> {
1186
+ OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::AUTO
1187
+ }
1188
+ )
1189
+
1190
+ # @!method self.variants
1191
+ # @return [Array(String, Symbol)]
1192
+
1193
+ define_sorbet_constant!(:Variants) do
1194
+ T.type_alias {
1195
+ T.any(
1196
+ String,
1197
+ OpenAI::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration::Size::TaggedSymbol
1198
+ )
1199
+ }
1200
+ end
1201
+
1202
+ # @!group
1203
+
1204
+ SIZE_1024X1024 = :"1024x1024"
1205
+ SIZE_1024X1536 = :"1024x1536"
1206
+ SIZE_1536X1024 = :"1536x1024"
1207
+ AUTO = :auto
1208
+
1209
+ # @!endgroup
1210
+ end
1211
+ end
1212
+
1213
+ class LocalShell < OpenAI::Internal::Type::BaseModel
1214
+ # @!attribute type
1215
+ # The type of the local shell tool. Always `local_shell`.
1216
+ #
1217
+ # @return [Symbol, :local_shell]
1218
+ required :type, const: :local_shell
1219
+
1220
+ # @!method initialize(type: :local_shell)
1221
+ # A tool that allows the model to execute shell commands in a local environment.
1222
+ #
1223
+ # @param type [Symbol, :local_shell]
1224
+ # The type of the local shell tool. Always `local_shell`.
1225
+ end
1226
+
1227
+ # @!method self.variants
1228
+ # @return [Array(OpenAI::Models::Responses::FunctionTool, OpenAI::Models::Responses::FileSearchTool, OpenAI::Models::Responses::ComputerTool, OpenAI::Models::Responses::ComputerUsePreviewTool, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::Mcp, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::CodeInterpreter, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ProgrammaticToolCalling, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::ImageGeneration, OpenAI::Models::Responses::ResponseToolSearchOutputItemParam::Tool::LocalShell, OpenAI::Models::Responses::FunctionShellTool, OpenAI::Models::Responses::CustomTool, OpenAI::Models::Responses::ToolSearchOutputNamespaceTool, OpenAI::Models::Responses::ToolSearchTool, OpenAI::Models::Responses::ApplyPatchTool, OpenAI::Models::Responses::WebSearchTool, OpenAI::Models::Responses::WebSearchPreviewTool)]
1229
+ end
1230
+
68
1231
  # Whether tool search was executed by the server or by the client.
69
1232
  #
70
1233
  # @see OpenAI::Models::Responses::ResponseToolSearchOutputItemParam#execution