openai 0.95.0 → 0.97.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 (197) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -0
  3. data/README.md +5 -2
  4. data/docs/architecture/security-model.md +2 -2
  5. data/examples/audio/record_and_play.rb +1 -1
  6. data/lib/openai/helpers/live/transcript_grouper.rb +264 -0
  7. data/lib/openai/helpers/live/transcript_grouping.rb +309 -0
  8. data/lib/openai/helpers/live/websocket.rb +454 -0
  9. data/lib/openai/helpers/realtime/translation.rb +440 -0
  10. data/lib/openai/helpers/realtime.rb +1 -0
  11. data/lib/openai/helpers/responses_websocket/incremental.rb +246 -0
  12. data/lib/openai/helpers/responses_websocket/transports/async_websocket.rb +183 -0
  13. data/lib/openai/helpers/responses_websocket.rb +1 -0
  14. data/lib/openai/helpers/streaming/response_stream.rb +19 -11
  15. data/lib/openai/helpers/structured_output/chat_completion_parser.rb +0 -2
  16. data/lib/openai/helpers/structured_output/response_parser.rb +1 -2
  17. data/lib/openai/helpers/structured_output/union_of.rb +0 -2
  18. data/lib/openai/helpers/websocket/async_websocket_transport.rb +11 -6
  19. data/lib/openai/helpers/websocket/connection_manager.rb +9 -0
  20. data/lib/openai/internal/read_io_adapter.rb +0 -2
  21. data/lib/openai/internal/stream.rb +0 -2
  22. data/lib/openai/internal/type/base_model.rb +4 -6
  23. data/lib/openai/internal/type/converter.rb +5 -3
  24. data/lib/openai/internal/type/enum.rb +0 -2
  25. data/lib/openai/internal/type/union.rb +0 -6
  26. data/lib/openai/internal/type/unknown.rb +34 -6
  27. data/lib/openai/internal/util.rb +0 -4
  28. data/lib/openai/models/audio/speech_create_params.rb +9 -0
  29. data/lib/openai/models/audio/transcription_create_response.rb +4 -1
  30. data/lib/openai/models/audio/translation_create_response.rb +4 -1
  31. data/lib/openai/models/beta/agent.rb +3 -2
  32. data/lib/openai/models/beta/agent_browser_authentication_cancel_param.rb +23 -0
  33. data/lib/openai/models/beta/agent_browser_authentication_submit_param.rb +70 -0
  34. data/lib/openai/models/beta/agent_browser_origin_access_param.rb +45 -0
  35. data/lib/openai/models/beta/agent_create_params.rb +5 -2
  36. data/lib/openai/models/beta/agent_output_item.rb +276 -1
  37. data/lib/openai/models/beta/agent_session.rb +252 -5
  38. data/lib/openai/models/beta/agent_session_input_param.rb +64 -1
  39. data/lib/openai/models/beta/agent_session_item.rb +391 -1
  40. data/lib/openai/models/beta/agent_session_turn_item_added_event.rb +2 -2
  41. data/lib/openai/models/beta/agent_session_turn_item_done_event.rb +2 -2
  42. data/lib/openai/models/beta/agent_tool.rb +27 -1
  43. data/lib/openai/models/beta/agent_tool_param.rb +27 -1
  44. data/lib/openai/models/beta/agent_update_params.rb +5 -2
  45. data/lib/openai/models/beta/agents/environments/environment_template.rb +26 -2
  46. data/lib/openai/models/beta/agents/environments/template_create_params.rb +51 -6
  47. data/lib/openai/models/beta/agents/environments/template_update_params.rb +51 -9
  48. data/lib/openai/models/beta/agents/session_create_params.rb +5 -2
  49. data/lib/openai/models/beta/agents/session_update_params.rb +3 -0
  50. data/lib/openai/models/beta/agents/sessions/event_create_params.rb +2 -2
  51. data/lib/openai/models/beta/agents/vaults/credential.rb +10 -1
  52. data/lib/openai/models/beta/agents/vaults/credential_create_params.rb +12 -1
  53. data/lib/openai/models/beta/agents/vaults/credential_update_params.rb +14 -3
  54. data/lib/openai/models/beta/beta_response.rb +38 -1
  55. data/lib/openai/models/beta/beta_responses_client_event.rb +73 -1
  56. data/lib/openai/models/beta/beta_web_search_preview_tool.rb +9 -3
  57. data/lib/openai/models/beta/beta_web_search_tool.rb +9 -3
  58. data/lib/openai/models/beta/environment.rb +26 -2
  59. data/lib/openai/models/beta/environment_param.rb +46 -6
  60. data/lib/openai/models/beta/persisted_agent_tool.rb +27 -1
  61. data/lib/openai/models/beta/persisted_agent_tool_param.rb +27 -1
  62. data/lib/openai/models/beta/response_compact_params.rb +3 -0
  63. data/lib/openai/models/beta/response_create_params.rb +68 -1
  64. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  65. data/lib/openai/models/chat_model.rb +1 -0
  66. data/lib/openai/models/responses/response.rb +35 -1
  67. data/lib/openai/models/responses/response_compact_params.rb +3 -0
  68. data/lib/openai/models/responses/response_create_params.rb +65 -1
  69. data/lib/openai/models/responses/responses_client_event.rb +70 -1
  70. data/lib/openai/models/responses/web_search_preview_tool.rb +9 -3
  71. data/lib/openai/models/responses/web_search_tool.rb +9 -3
  72. data/lib/openai/net_http_client.rb +0 -2
  73. data/lib/openai/resources/audio/transcriptions.rb +5 -3
  74. data/lib/openai/resources/audio/translations.rb +1 -1
  75. data/lib/openai/resources/beta/agents/environments/templates.rb +12 -5
  76. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -1
  77. data/lib/openai/resources/beta/agents/sessions/items.rb +1 -1
  78. data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +1 -1
  79. data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +1 -1
  80. data/lib/openai/resources/beta/agents/vaults/credentials.rb +12 -4
  81. data/lib/openai/resources/beta/agents.rb +2 -2
  82. data/lib/openai/resources/beta/responses.rb +8 -2
  83. data/lib/openai/resources/responses.rb +8 -1
  84. data/lib/openai/version.rb +1 -1
  85. data/lib/openai.rb +4 -0
  86. data/rbi/openai/helpers/live/transcript_grouper.rbi +67 -0
  87. data/rbi/openai/helpers/live/websocket.rbi +299 -0
  88. data/rbi/openai/helpers/realtime/translation.rbi +137 -0
  89. data/rbi/openai/helpers/responses_websocket/incremental.rbi +32 -0
  90. data/rbi/openai/helpers/responses_websocket/transports/async_websocket.rbi +24 -0
  91. data/rbi/openai/helpers/streaming/response_stream.rbi +5 -0
  92. data/rbi/openai/internal/type/converter.rbi +3 -2
  93. data/rbi/openai/models/audio/speech_create_params.rbi +3 -0
  94. data/rbi/openai/models/audio/transcription_create_response.rbi +2 -1
  95. data/rbi/openai/models/audio/translation_create_response.rbi +2 -1
  96. data/rbi/openai/models/beta/agent.rbi +3 -1
  97. data/rbi/openai/models/beta/agent_browser_authentication_cancel_param.rbi +53 -0
  98. data/rbi/openai/models/beta/agent_browser_authentication_submit_param.rbi +125 -0
  99. data/rbi/openai/models/beta/agent_browser_origin_access_param.rbi +76 -0
  100. data/rbi/openai/models/beta/agent_create_params.rbi +9 -3
  101. data/rbi/openai/models/beta/agent_output_item.rbi +422 -0
  102. data/rbi/openai/models/beta/agent_session.rbi +374 -1
  103. data/rbi/openai/models/beta/agent_session_input_param.rbi +102 -0
  104. data/rbi/openai/models/beta/agent_session_item.rbi +614 -0
  105. data/rbi/openai/models/beta/agent_session_turn_item_added_event.rbi +3 -0
  106. data/rbi/openai/models/beta/agent_session_turn_item_done_event.rbi +2 -0
  107. data/rbi/openai/models/beta/agent_tool.rbi +49 -1
  108. data/rbi/openai/models/beta/agent_tool_param.rbi +52 -1
  109. data/rbi/openai/models/beta/agent_update_params.rbi +9 -3
  110. data/rbi/openai/models/beta/agents/environments/environment_template.rbi +53 -2
  111. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +77 -7
  112. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +77 -10
  113. data/rbi/openai/models/beta/agents/session_create_params.rbi +9 -3
  114. data/rbi/openai/models/beta/agents/session_update_params.rbi +3 -0
  115. data/rbi/openai/models/beta/agents/sessions/event_create_params.rbi +3 -0
  116. data/rbi/openai/models/beta/agents/vaults/credential.rbi +10 -0
  117. data/rbi/openai/models/beta/agents/vaults/credential_create_params.rbi +15 -0
  118. data/rbi/openai/models/beta/agents/vaults/credential_update_params.rbi +35 -6
  119. data/rbi/openai/models/beta/beta_response.rbi +64 -0
  120. data/rbi/openai/models/beta/beta_responses_client_event.rbi +128 -0
  121. data/rbi/openai/models/beta/beta_web_search_preview_tool.rbi +9 -3
  122. data/rbi/openai/models/beta/beta_web_search_tool.rbi +9 -3
  123. data/rbi/openai/models/beta/environment.rbi +53 -2
  124. data/rbi/openai/models/beta/environment_param.rbi +75 -7
  125. data/rbi/openai/models/beta/persisted_agent_tool.rbi +49 -1
  126. data/rbi/openai/models/beta/persisted_agent_tool_param.rbi +52 -1
  127. data/rbi/openai/models/beta/response_compact_params.rbi +1 -0
  128. data/rbi/openai/models/beta/response_create_params.rbi +100 -0
  129. data/rbi/openai/models/beta/session_turn_error.rbi +6 -0
  130. data/rbi/openai/models/chat_model.rbi +1 -0
  131. data/rbi/openai/models/responses/response.rbi +63 -0
  132. data/rbi/openai/models/responses/response_compact_params.rbi +1 -0
  133. data/rbi/openai/models/responses/response_create_params.rbi +106 -0
  134. data/rbi/openai/models/responses/responses_client_event.rbi +125 -0
  135. data/rbi/openai/models/responses/web_search_preview_tool.rbi +9 -3
  136. data/rbi/openai/models/responses/web_search_tool.rbi +9 -3
  137. data/rbi/openai/resources/audio/transcriptions.rbi +4 -2
  138. data/rbi/openai/resources/beta/agents/environments/templates.rbi +10 -3
  139. data/rbi/openai/resources/beta/agents/sessions/events.rbi +1 -0
  140. data/rbi/openai/resources/beta/agents/vaults/credentials.rbi +11 -3
  141. data/rbi/openai/resources/beta/agents.rbi +4 -2
  142. data/rbi/openai/resources/beta/responses.rbi +6 -0
  143. data/rbi/openai/resources/responses.rbi +11 -0
  144. data/responses-websocket.md +55 -0
  145. data/sig/openai/helpers/live/transcript_grouper.rbs +42 -0
  146. data/sig/openai/helpers/live/websocket.rbs +152 -0
  147. data/sig/openai/helpers/realtime/translation.rbs +81 -0
  148. data/sig/openai/helpers/responses_websocket/incremental.rbs +14 -0
  149. data/sig/openai/helpers/responses_websocket/transports/async_websocket.rbs +21 -0
  150. data/sig/openai/helpers/streaming/response_stream.rbs +9 -0
  151. data/sig/openai/internal/type/converter.rbs +3 -1
  152. data/sig/openai/models/audio/speech_create_params.rbs +6 -0
  153. data/sig/openai/models/audio/transcription_create_response.rbs +1 -0
  154. data/sig/openai/models/audio/translation_create_response.rbs +3 -1
  155. data/sig/openai/models/beta/agent.rbs +3 -1
  156. data/sig/openai/models/beta/agent_browser_authentication_cancel_param.rbs +21 -0
  157. data/sig/openai/models/beta/agent_browser_authentication_submit_param.rbs +63 -0
  158. data/sig/openai/models/beta/agent_browser_origin_access_param.rbs +47 -0
  159. data/sig/openai/models/beta/agent_create_params.rbs +5 -1
  160. data/sig/openai/models/beta/agent_output_item.rbs +254 -0
  161. data/sig/openai/models/beta/agent_session.rbs +218 -2
  162. data/sig/openai/models/beta/agent_session_input_param.rbs +51 -1
  163. data/sig/openai/models/beta/agent_session_item.rbs +362 -0
  164. data/sig/openai/models/beta/agent_tool.rbs +22 -0
  165. data/sig/openai/models/beta/agent_tool_param.rbs +25 -0
  166. data/sig/openai/models/beta/agent_update_params.rbs +5 -1
  167. data/sig/openai/models/beta/agents/environments/environment_template.rbs +29 -3
  168. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +41 -6
  169. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +41 -8
  170. data/sig/openai/models/beta/agents/session_create_params.rbs +5 -1
  171. data/sig/openai/models/beta/agents/session_update_params.rbs +5 -1
  172. data/sig/openai/models/beta/agents/vaults/credential.rbs +8 -0
  173. data/sig/openai/models/beta/agents/vaults/credential_create_params.rbs +14 -0
  174. data/sig/openai/models/beta/agents/vaults/credential_update_params.rbs +23 -4
  175. data/sig/openai/models/beta/beta_response.rbs +37 -0
  176. data/sig/openai/models/beta/beta_responses_client_event.rbs +79 -0
  177. data/sig/openai/models/beta/beta_web_search_preview_tool.rbs +6 -2
  178. data/sig/openai/models/beta/beta_web_search_tool.rbs +6 -2
  179. data/sig/openai/models/beta/environment.rbs +29 -3
  180. data/sig/openai/models/beta/environment_param.rbs +41 -6
  181. data/sig/openai/models/beta/persisted_agent_tool.rbs +22 -0
  182. data/sig/openai/models/beta/persisted_agent_tool_param.rbs +25 -0
  183. data/sig/openai/models/beta/response_compact_params.rbs +2 -0
  184. data/sig/openai/models/beta/response_create_params.rbs +79 -0
  185. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  186. data/sig/openai/models/chat_model.rbs +2 -0
  187. data/sig/openai/models/responses/response.rbs +35 -0
  188. data/sig/openai/models/responses/response_compact_params.rbs +2 -0
  189. data/sig/openai/models/responses/response_create_params.rbs +77 -0
  190. data/sig/openai/models/responses/responses_client_event.rbs +77 -0
  191. data/sig/openai/models/responses/web_search_preview_tool.rbs +6 -2
  192. data/sig/openai/models/responses/web_search_tool.rbs +6 -2
  193. data/sig/openai/resources/beta/agents/environments/templates.rbs +2 -0
  194. data/sig/openai/resources/beta/agents/vaults/credentials.rbs +3 -1
  195. data/sig/openai/resources/beta/responses.rbs +2 -0
  196. data/sig/openai/resources/responses.rbs +4 -0
  197. metadata +23 -1
@@ -82,7 +82,13 @@ module OpenAI
82
82
  # @return [Symbol, :openai_hosted]
83
83
  required :type, const: :openai_hosted
84
84
 
85
- # @!method initialize(id:, capability_directories:, files:, network:, packages:, plugins:, skills:, type: :openai_hosted)
85
+ # @!attribute desktop
86
+ # The effective desktop configuration.
87
+ #
88
+ # @return [OpenAI::Models::Beta::Environment::OpenAIHosted::Desktop, nil]
89
+ optional :desktop, -> { OpenAI::Beta::Environment::OpenAIHosted::Desktop }
90
+
91
+ # @!method initialize(id:, capability_directories:, files:, network:, packages:, plugins:, skills:, desktop: nil, type: :openai_hosted)
86
92
  # An environment hosted by OpenAI.
87
93
  #
88
94
  # @param id [String]
@@ -106,6 +112,9 @@ module OpenAI
106
112
  # @param skills [Array<OpenAI::Models::Beta::HostedSkillReference, OpenAI::Models::Beta::HostedSkill::Inline>]
107
113
  # Skills installed in the environment, excluding their archive contents.
108
114
  #
115
+ # @param desktop [OpenAI::Models::Beta::Environment::OpenAIHosted::Desktop]
116
+ # The effective desktop configuration.
117
+ #
109
118
  # @param type [Symbol, :openai_hosted]
110
119
  # The type of the object. Always `openai_hosted`.
111
120
 
@@ -144,7 +153,7 @@ module OpenAI
144
153
  # Disables network access.
145
154
  DISABLED = :disabled
146
155
 
147
- # Allows access only to configured domains.
156
+ # Applies the configured domain restrictions.
148
157
  RESTRICTED = :restricted
149
158
 
150
159
  # @!method self.values
@@ -184,6 +193,21 @@ module OpenAI
184
193
  # @param system_ [Array<String>]
185
194
  # System packages installed in the environment.
186
195
  end
196
+
197
+ # @see OpenAI::Models::Beta::Environment::OpenAIHosted#desktop
198
+ class Desktop < OpenAI::Internal::Type::BaseModel
199
+ # @!attribute enabled
200
+ # Whether the environment provisions a desktop and browser proxy.
201
+ #
202
+ # @return [Boolean]
203
+ required :enabled, OpenAI::Internal::Type::Boolean
204
+
205
+ # @!method initialize(enabled:)
206
+ # The effective desktop configuration.
207
+ #
208
+ # @param enabled [Boolean]
209
+ # Whether the environment provisions a desktop and browser proxy.
210
+ end
187
211
  end
188
212
 
189
213
  class SelfHosted < OpenAI::Internal::Type::BaseModel
@@ -46,6 +46,13 @@ module OpenAI
46
46
  # @return [Array<String>, nil]
47
47
  optional :capability_directories, OpenAI::Internal::Type::ArrayOf[String], nil?: true
48
48
 
49
+ # @!attribute desktop
50
+ # Desktop provisioning. Omission or null inherits the template setting, or
51
+ # defaults to disabled.
52
+ #
53
+ # @return [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Desktop, nil]
54
+ optional :desktop, -> { OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop }, nil?: true
55
+
49
56
  # @!attribute env
50
57
  # Environment variables made available to the agent.
51
58
  #
@@ -71,7 +78,7 @@ module OpenAI
71
78
 
72
79
  # @!attribute network
73
80
  # Network access policy for the environment. Defaults to disabled for GA requests
74
- # and enabled for alpha/beta requests.
81
+ # and enabled for beta requests.
75
82
  #
76
83
  # @return [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network, nil]
77
84
  optional :network, -> { OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network }, nil?: true
@@ -115,7 +122,7 @@ module OpenAI
115
122
  nil?: true
116
123
  )
117
124
 
118
- # @!method initialize(capability_directories: nil, env: nil, environment_template_id: nil, files: nil, network: nil, packages: nil, plugins: nil, setup_commands: nil, skills: nil, type: :openai_hosted)
125
+ # @!method initialize(capability_directories: nil, desktop: nil, env: nil, environment_template_id: nil, files: nil, network: nil, packages: nil, plugins: nil, setup_commands: nil, skills: nil, type: :openai_hosted)
119
126
  # An existing OpenAI-hosted environment or new inline/template-based hosted
120
127
  # configuration.
121
128
  #
@@ -123,6 +130,10 @@ module OpenAI
123
130
  # Directories that contain capabilities exposed to the agent. Defaults to an empty
124
131
  # list.
125
132
  #
133
+ # @param desktop [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Desktop, nil]
134
+ # Desktop provisioning. Omission or null inherits the template setting, or
135
+ # defaults to disabled.
136
+ #
126
137
  # @param env [Hash{Symbol=>String}, nil]
127
138
  # Environment variables made available to the agent.
128
139
  #
@@ -135,7 +146,7 @@ module OpenAI
135
146
  #
136
147
  # @param network [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network, nil]
137
148
  # Network access policy for the environment. Defaults to disabled for GA requests
138
- # and enabled for alpha/beta requests.
149
+ # and enabled for beta requests.
139
150
  #
140
151
  # @param packages [OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Packages, nil]
141
152
  # Packages to install in the environment. Defaults to empty package lists.
@@ -153,6 +164,22 @@ module OpenAI
153
164
  # @param type [Symbol, :openai_hosted]
154
165
  # The type of the object. Always `openai_hosted`.
155
166
 
167
+ # @see OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted#desktop
168
+ class Desktop < OpenAI::Internal::Type::BaseModel
169
+ # @!attribute enabled
170
+ # Whether to provision the desktop and its browser proxy.
171
+ #
172
+ # @return [Boolean]
173
+ required :enabled, OpenAI::Internal::Type::Boolean
174
+
175
+ # @!method initialize(enabled:)
176
+ # Desktop provisioning. Omission or null inherits the template setting, or
177
+ # defaults to disabled.
178
+ #
179
+ # @param enabled [Boolean]
180
+ # Whether to provision the desktop and its browser proxy.
181
+ end
182
+
156
183
  # @see OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted#network
157
184
  class Network < OpenAI::Internal::Type::BaseModel
158
185
  # @!attribute access
@@ -167,15 +194,28 @@ module OpenAI
167
194
  # @return [Array<String>, nil]
168
195
  optional :allowed_domains, OpenAI::Internal::Type::ArrayOf[String], nil?: true
169
196
 
170
- # @!method initialize(access:, allowed_domains: nil)
197
+ # @!attribute blocked_domains
198
+ # Domains blocked for both executor and browser when access is restricted. A
199
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
200
+ # `allowed_domains`. Wildcard domains are not supported.
201
+ #
202
+ # @return [Array<String>, nil]
203
+ optional :blocked_domains, OpenAI::Internal::Type::ArrayOf[String], nil?: true
204
+
205
+ # @!method initialize(access:, allowed_domains: nil, blocked_domains: nil)
171
206
  # Network access policy for the environment. Defaults to disabled for GA requests
172
- # and enabled for alpha/beta requests.
207
+ # and enabled for beta requests.
173
208
  #
174
209
  # @param access [Symbol, OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::Network::Access]
175
210
  # The environment's network access mode.
176
211
  #
177
212
  # @param allowed_domains [Array<String>, nil]
178
213
  # Domains the environment may access when network access is restricted.
214
+ #
215
+ # @param blocked_domains [Array<String>, nil]
216
+ # Domains blocked for both executor and browser when access is restricted. A
217
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
218
+ # `allowed_domains`. Wildcard domains are not supported.
179
219
 
180
220
  # The environment's network access mode.
181
221
  #
@@ -189,7 +229,7 @@ module OpenAI
189
229
  # Disables network access.
190
230
  DISABLED = :disabled
191
231
 
192
- # Allows access only to configured domains.
232
+ # Applies the configured domain restrictions.
193
233
  RESTRICTED = :restricted
194
234
 
195
235
  # @!method self.values
@@ -24,6 +24,9 @@ module OpenAI
24
24
  # Web search.
25
25
  variant :web_search, -> { OpenAI::Beta::PersistedAgentTool::WebSearch }
26
26
 
27
+ # Browser use in an OpenAI-hosted session.
28
+ variant :computer_use, -> { OpenAI::Beta::PersistedAgentTool::ComputerUse }
29
+
27
30
  class Function < OpenAI::Internal::Type::BaseModel
28
31
  # @!attribute defer_loading
29
32
  # Whether the function is deferred and discovered through tool search.
@@ -321,8 +324,31 @@ module OpenAI
321
324
  end
322
325
  end
323
326
 
327
+ class ComputerUse < OpenAI::Internal::Type::BaseModel
328
+ # @!attribute include_screenshots
329
+ # Whether computer tool outputs include screenshots.
330
+ #
331
+ # @return [Boolean]
332
+ required :include_screenshots, OpenAI::Internal::Type::Boolean
333
+
334
+ # @!attribute type
335
+ # The type of the object. Always `computer_use`.
336
+ #
337
+ # @return [Symbol, :computer_use]
338
+ required :type, const: :computer_use
339
+
340
+ # @!method initialize(include_screenshots:, type: :computer_use)
341
+ # Browser use in an OpenAI-hosted session.
342
+ #
343
+ # @param include_screenshots [Boolean]
344
+ # Whether computer tool outputs include screenshots.
345
+ #
346
+ # @param type [Symbol, :computer_use]
347
+ # The type of the object. Always `computer_use`.
348
+ end
349
+
324
350
  # @!method self.variants
325
- # @return [Array(OpenAI::Models::Beta::PersistedAgentTool::Function, OpenAI::Models::Beta::PersistedAgentTool::ToolSearch, OpenAI::Models::Beta::PersistedAgentTool::ProgrammaticToolCalling, OpenAI::Models::Beta::PersistedAgentTool::Mcp, OpenAI::Models::Beta::PersistedAgentTool::WebSearch)]
351
+ # @return [Array(OpenAI::Models::Beta::PersistedAgentTool::Function, OpenAI::Models::Beta::PersistedAgentTool::ToolSearch, OpenAI::Models::Beta::PersistedAgentTool::ProgrammaticToolCalling, OpenAI::Models::Beta::PersistedAgentTool::Mcp, OpenAI::Models::Beta::PersistedAgentTool::WebSearch, OpenAI::Models::Beta::PersistedAgentTool::ComputerUse)]
326
352
  end
327
353
  end
328
354
  end
@@ -24,6 +24,9 @@ module OpenAI
24
24
  # Web search.
25
25
  variant :web_search, -> { OpenAI::Beta::PersistedAgentToolParam::WebSearch }
26
26
 
27
+ # Browser use in an OpenAI-hosted session.
28
+ variant :computer_use, -> { OpenAI::Beta::PersistedAgentToolParam::ComputerUse }
29
+
27
30
  class Function < OpenAI::Internal::Type::BaseModel
28
31
  # @!attribute description
29
32
  # A description of what the function does.
@@ -347,8 +350,31 @@ module OpenAI
347
350
  end
348
351
  end
349
352
 
353
+ class ComputerUse < OpenAI::Internal::Type::BaseModel
354
+ # @!attribute type
355
+ # The type of the object. Always `computer_use`.
356
+ #
357
+ # @return [Symbol, :computer_use]
358
+ required :type, const: :computer_use
359
+
360
+ # @!attribute include_screenshots
361
+ # Whether computer tool outputs include screenshots. Defaults to `false`.
362
+ #
363
+ # @return [Boolean, nil]
364
+ optional :include_screenshots, OpenAI::Internal::Type::Boolean
365
+
366
+ # @!method initialize(include_screenshots: nil, type: :computer_use)
367
+ # Browser use in an OpenAI-hosted session.
368
+ #
369
+ # @param include_screenshots [Boolean]
370
+ # Whether computer tool outputs include screenshots. Defaults to `false`.
371
+ #
372
+ # @param type [Symbol, :computer_use]
373
+ # The type of the object. Always `computer_use`.
374
+ end
375
+
350
376
  # @!method self.variants
351
- # @return [Array(OpenAI::Models::Beta::PersistedAgentToolParam::Function, OpenAI::Models::Beta::PersistedAgentToolParam::ToolSearch, OpenAI::Models::Beta::PersistedAgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::PersistedAgentToolParam::Mcp, OpenAI::Models::Beta::PersistedAgentToolParam::WebSearch)]
377
+ # @return [Array(OpenAI::Models::Beta::PersistedAgentToolParam::Function, OpenAI::Models::Beta::PersistedAgentToolParam::ToolSearch, OpenAI::Models::Beta::PersistedAgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::PersistedAgentToolParam::Mcp, OpenAI::Models::Beta::PersistedAgentToolParam::WebSearch, OpenAI::Models::Beta::PersistedAgentToolParam::ComputerUse)]
352
378
  end
353
379
  end
354
380
  end
@@ -178,6 +178,8 @@ module OpenAI
178
178
 
179
179
  variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_6_ASTRA }
180
180
 
181
+ variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_6_1_SOL }
182
+
181
183
  variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_6_SOL }
182
184
 
183
185
  variant const: -> { OpenAI::Models::Beta::ResponseCompactParams::Model::GPT_6_LUNA }
@@ -408,6 +410,7 @@ module OpenAI
408
410
  # @!group
409
411
 
410
412
  GPT_6_ASTRA = :"gpt-6-astra"
413
+ GPT_6_1_SOL = :"gpt-6.1-sol"
411
414
  GPT_6_SOL = :"gpt-6-sol"
412
415
  GPT_6_LUNA = :"gpt-6-luna"
413
416
  GPT_5_6_SOL = :"gpt-5.6-sol"
@@ -10,6 +10,12 @@ module OpenAI
10
10
  extend OpenAI::Internal::Type::RequestParameters::Converter
11
11
  include OpenAI::Internal::Type::RequestParameters
12
12
 
13
+ # @!attribute access_programs
14
+ # Domain-specific access programs to use for this request.
15
+ #
16
+ # @return [OpenAI::Models::Beta::ResponseCreateParams::AccessPrograms, nil]
17
+ optional :access_programs, -> { OpenAI::Beta::ResponseCreateParams::AccessPrograms }
18
+
13
19
  # @!attribute background
14
20
  # Whether to run the model response in the background.
15
21
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
@@ -376,7 +382,10 @@ module OpenAI
376
382
  # @return [Array<Symbol, OpenAI::Models::Beta::ResponseCreateParams::Beta>, nil]
377
383
  optional :betas, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Beta::ResponseCreateParams::Beta] }
378
384
 
379
- # @!method initialize(background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, multi_agent: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, betas: nil, request_options: {})
385
+ # @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, multi_agent: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, betas: nil, request_options: {})
386
+ # @param access_programs [OpenAI::Models::Beta::ResponseCreateParams::AccessPrograms]
387
+ # Domain-specific access programs to use for this request.
388
+ #
380
389
  # @param background [Boolean, nil]
381
390
  # Whether to run the model response in the background.
382
391
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
@@ -629,6 +638,61 @@ module OpenAI
629
638
  #
630
639
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
631
640
 
641
+ class AccessPrograms < OpenAI::Internal::Type::BaseModel
642
+ # @!attribute cyber
643
+ # The Cyber access program to use for this request. Supported values are
644
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
645
+ # the program from the model's Cyber tier and your organization and project
646
+ # access, subject to model-specific eligibility restrictions. By default, models
647
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
648
+ # authorized; otherwise they fall back to Standard unless the model requires
649
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
650
+ # Requests that require unavailable Daybreak access return 403. An implicit
651
+ # Standard fallback is represented by null in the response's access_programs
652
+ # field, rather than an explicit Standard selection.
653
+ #
654
+ # @return [Symbol, OpenAI::Models::Beta::ResponseCreateParams::AccessPrograms::Cyber, nil]
655
+ optional :cyber, enum: -> { OpenAI::Beta::ResponseCreateParams::AccessPrograms::Cyber }
656
+
657
+ # @!method initialize(cyber: nil)
658
+ # Domain-specific access programs to use for this request.
659
+ #
660
+ # @param cyber [Symbol, OpenAI::Models::Beta::ResponseCreateParams::AccessPrograms::Cyber]
661
+ # The Cyber access program to use for this request. Supported values are
662
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
663
+ # the program from the model's Cyber tier and your organization and project
664
+ # access, subject to model-specific eligibility restrictions. By default, models
665
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
666
+ # authorized; otherwise they fall back to Standard unless the model requires
667
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
668
+ # Requests that require unavailable Daybreak access return 403. An implicit
669
+ # Standard fallback is represented by null in the response's access_programs
670
+ # field, rather than an explicit Standard selection.
671
+
672
+ # The Cyber access program to use for this request. Supported values are
673
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
674
+ # the program from the model's Cyber tier and your organization and project
675
+ # access, subject to model-specific eligibility restrictions. By default, models
676
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
677
+ # authorized; otherwise they fall back to Standard unless the model requires
678
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
679
+ # Requests that require unavailable Daybreak access return 403. An implicit
680
+ # Standard fallback is represented by null in the response's access_programs
681
+ # field, rather than an explicit Standard selection.
682
+ #
683
+ # @see OpenAI::Models::Beta::ResponseCreateParams::AccessPrograms#cyber
684
+ module Cyber
685
+ extend OpenAI::Internal::Type::Enum
686
+
687
+ STANDARD = :standard
688
+ DAYBREAK_BLUE = :daybreak_blue
689
+ DAYBREAK_RED = :daybreak_red
690
+
691
+ # @!method self.values
692
+ # @return [Array<Symbol>]
693
+ end
694
+ end
695
+
632
696
  class ContextManagement < OpenAI::Internal::Type::BaseModel
633
697
  # @!attribute type
634
698
  # The context management entry type. Currently only 'compaction' is supported.
@@ -701,6 +765,8 @@ module OpenAI
701
765
 
702
766
  variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_6_ASTRA }
703
767
 
768
+ variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_6_1_SOL }
769
+
704
770
  variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_6_SOL }
705
771
 
706
772
  variant const: -> { OpenAI::Models::Beta::ResponseCreateParams::Model::GPT_6_LUNA }
@@ -929,6 +995,7 @@ module OpenAI
929
995
  # @!group
930
996
 
931
997
  GPT_6_ASTRA = :"gpt-6-astra"
998
+ GPT_6_1_SOL = :"gpt-6.1-sol"
932
999
  GPT_6_SOL = :"gpt-6-sol"
933
1000
  GPT_6_LUNA = :"gpt-6-luna"
934
1001
  GPT_5_6_SOL = :"gpt-5.6-sol"
@@ -52,6 +52,9 @@ module OpenAI
52
52
  # The request was rejected by a safety policy.
53
53
  CYBER_POLICY = :cyber_policy
54
54
 
55
+ # The request was blocked by the safety systems.
56
+ MISALIGNMENT_POLICY_VIOLATION = :misalignment_policy_violation
57
+
55
58
  # The request could not connect to the model service.
56
59
  CONNECTION_FAILED = :connection_failed
57
60
 
@@ -6,6 +6,7 @@ module OpenAI
6
6
  extend OpenAI::Internal::Type::Enum
7
7
 
8
8
  GPT_6_ASTRA = :"gpt-6-astra"
9
+ GPT_6_1_SOL = :"gpt-6.1-sol"
9
10
  GPT_6_SOL = :"gpt-6-sol"
10
11
  GPT_6_LUNA = :"gpt-6-luna"
11
12
  GPT_5_6_SOL = :"gpt-5.6-sol"
@@ -13,6 +13,11 @@ module OpenAI
13
13
  # @return [String]
14
14
  required :id, String
15
15
 
16
+ # @!attribute access_programs
17
+ #
18
+ # @return [OpenAI::Models::Responses::Response::AccessPrograms, nil]
19
+ required :access_programs, -> { OpenAI::Responses::Response::AccessPrograms }, nil?: true
20
+
16
21
  # @!attribute created_at
17
22
  # Unix timestamp (in seconds) of when this Response was created.
18
23
  #
@@ -374,10 +379,12 @@ module OpenAI
374
379
  texts.join
375
380
  end
376
381
 
377
- # @!method initialize(id:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
382
+ # @!method initialize(id:, access_programs:, created_at:, error:, incomplete_details:, instructions:, metadata:, model:, output:, parallel_tool_calls:, temperature:, tool_choice:, tools:, top_p:, background: nil, completed_at: nil, conversation: nil, max_output_tokens: nil, max_tool_calls: nil, moderation: nil, previous_response_id: nil, prompt: nil, prompt_cache_diagnostics: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, status: nil, text: nil, top_logprobs: nil, truncation: nil, usage: nil, user: nil, object: :response)
378
383
  # @param id [String]
379
384
  # Unique identifier for this Response.
380
385
  #
386
+ # @param access_programs [OpenAI::Models::Responses::Response::AccessPrograms, nil]
387
+ #
381
388
  # @param created_at [Float]
382
389
  # Unix timestamp (in seconds) of when this Response was created.
383
390
  #
@@ -608,6 +615,33 @@ module OpenAI
608
615
  # @param object [Symbol, :response]
609
616
  # The object type of this resource - always set to `response`.
610
617
 
618
+ # @see OpenAI::Models::Responses::Response#access_programs
619
+ class AccessPrograms < OpenAI::Internal::Type::BaseModel
620
+ # @!attribute cyber
621
+ # The effective Cyber access program used for this response.
622
+ #
623
+ # @return [Symbol, OpenAI::Models::Responses::Response::AccessPrograms::Cyber]
624
+ required :cyber, enum: -> { OpenAI::Responses::Response::AccessPrograms::Cyber }
625
+
626
+ # @!method initialize(cyber:)
627
+ # @param cyber [Symbol, OpenAI::Models::Responses::Response::AccessPrograms::Cyber]
628
+ # The effective Cyber access program used for this response.
629
+
630
+ # The effective Cyber access program used for this response.
631
+ #
632
+ # @see OpenAI::Models::Responses::Response::AccessPrograms#cyber
633
+ module Cyber
634
+ extend OpenAI::Internal::Type::Enum
635
+
636
+ STANDARD = :standard
637
+ DAYBREAK_BLUE = :daybreak_blue
638
+ DAYBREAK_RED = :daybreak_red
639
+
640
+ # @!method self.values
641
+ # @return [Array<Symbol>]
642
+ end
643
+ end
644
+
611
645
  # @see OpenAI::Models::Responses::Response#incomplete_details
612
646
  class IncompleteDetails < OpenAI::Internal::Type::BaseModel
613
647
  # @!attribute reason
@@ -169,6 +169,8 @@ module OpenAI
169
169
 
170
170
  variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_6_ASTRA }
171
171
 
172
+ variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_6_1_SOL }
173
+
172
174
  variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_6_SOL }
173
175
 
174
176
  variant const: -> { OpenAI::Models::Responses::ResponseCompactParams::Model::GPT_6_LUNA }
@@ -413,6 +415,7 @@ module OpenAI
413
415
  # @!group
414
416
 
415
417
  GPT_6_ASTRA = :"gpt-6-astra"
418
+ GPT_6_1_SOL = :"gpt-6.1-sol"
416
419
  GPT_6_SOL = :"gpt-6-sol"
417
420
  GPT_6_LUNA = :"gpt-6-luna"
418
421
  GPT_5_6_SOL = :"gpt-5.6-sol"
@@ -10,6 +10,12 @@ module OpenAI
10
10
  extend OpenAI::Internal::Type::RequestParameters::Converter
11
11
  include OpenAI::Internal::Type::RequestParameters
12
12
 
13
+ # @!attribute access_programs
14
+ # Domain-specific access programs to use for this request.
15
+ #
16
+ # @return [OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms, nil]
17
+ optional :access_programs, -> { OpenAI::Responses::ResponseCreateParams::AccessPrograms }
18
+
13
19
  # @!attribute background
14
20
  # Whether to run the model response in the background.
15
21
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
@@ -379,7 +385,10 @@ module OpenAI
379
385
  # @return [String, nil]
380
386
  optional :user, String
381
387
 
382
- # @!method initialize(background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, request_options: {})
388
+ # @!method initialize(access_programs: nil, background: nil, context_management: nil, conversation: nil, include: nil, input: nil, instructions: nil, max_output_tokens: nil, max_tool_calls: nil, metadata: nil, model: nil, moderation: nil, parallel_tool_calls: nil, previous_response_id: nil, prompt: nil, prompt_cache_key: nil, prompt_cache_options: nil, prompt_cache_retention: nil, reasoning: nil, safety_identifier: nil, service_tier: nil, store: nil, stream_options: nil, temperature: nil, text: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, truncation: nil, user: nil, request_options: {})
389
+ # @param access_programs [OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms]
390
+ # Domain-specific access programs to use for this request.
391
+ #
383
392
  # @param background [Boolean, nil]
384
393
  # Whether to run the model response in the background.
385
394
  # [Learn more](https://developers.openai.com/api/docs/guides/background).
@@ -627,6 +636,61 @@ module OpenAI
627
636
  #
628
637
  # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
629
638
 
639
+ class AccessPrograms < OpenAI::Internal::Type::BaseModel
640
+ # @!attribute cyber
641
+ # The Cyber access program to use for this request. Supported values are
642
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
643
+ # the program from the model's Cyber tier and your organization and project
644
+ # access, subject to model-specific eligibility restrictions. By default, models
645
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
646
+ # authorized; otherwise they fall back to Standard unless the model requires
647
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
648
+ # Requests that require unavailable Daybreak access return 403. An implicit
649
+ # Standard fallback is represented by null in the response's access_programs
650
+ # field, rather than an explicit Standard selection.
651
+ #
652
+ # @return [Symbol, OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms::Cyber, nil]
653
+ optional :cyber, enum: -> { OpenAI::Responses::ResponseCreateParams::AccessPrograms::Cyber }
654
+
655
+ # @!method initialize(cyber: nil)
656
+ # Domain-specific access programs to use for this request.
657
+ #
658
+ # @param cyber [Symbol, OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms::Cyber]
659
+ # The Cyber access program to use for this request. Supported values are
660
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
661
+ # the program from the model's Cyber tier and your organization and project
662
+ # access, subject to model-specific eligibility restrictions. By default, models
663
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
664
+ # authorized; otherwise they fall back to Standard unless the model requires
665
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
666
+ # Requests that require unavailable Daybreak access return 403. An implicit
667
+ # Standard fallback is represented by null in the response's access_programs
668
+ # field, rather than an explicit Standard selection.
669
+
670
+ # The Cyber access program to use for this request. Supported values are
671
+ # `standard`, `daybreak_blue`, and `daybreak_red`. If omitted, the API resolves
672
+ # the program from the model's Cyber tier and your organization and project
673
+ # access, subject to model-specific eligibility restrictions. By default, models
674
+ # without a Cyber tier use Standard. Blue-tier models use Daybreak Blue when
675
+ # authorized; otherwise they fall back to Standard unless the model requires
676
+ # Daybreak access. Red-tier models use Daybreak Red and require authorization.
677
+ # Requests that require unavailable Daybreak access return 403. An implicit
678
+ # Standard fallback is represented by null in the response's access_programs
679
+ # field, rather than an explicit Standard selection.
680
+ #
681
+ # @see OpenAI::Models::Responses::ResponseCreateParams::AccessPrograms#cyber
682
+ module Cyber
683
+ extend OpenAI::Internal::Type::Enum
684
+
685
+ STANDARD = :standard
686
+ DAYBREAK_BLUE = :daybreak_blue
687
+ DAYBREAK_RED = :daybreak_red
688
+
689
+ # @!method self.values
690
+ # @return [Array<Symbol>]
691
+ end
692
+ end
693
+
630
694
  class ContextManagement < OpenAI::Internal::Type::BaseModel
631
695
  # @!attribute type
632
696
  # The context management entry type. Currently only 'compaction' is supported.