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