openai 0.96.0 → 0.98.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 (176) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/README.md +76 -1
  4. data/lib/openai/helpers/agents/session_stream.rb +60 -3
  5. data/lib/openai/helpers/beta/agents/artifacts.rb +72 -0
  6. data/lib/openai/helpers/beta/agents/creation_stream.rb +69 -0
  7. data/lib/openai/helpers/beta/agents/files.rb +236 -0
  8. data/lib/openai/helpers/beta/agents/function_tool.rb +65 -0
  9. data/lib/openai/helpers/beta/agents/model_adapter.rb +27 -0
  10. data/lib/openai/helpers/beta/agents/result.rb +170 -0
  11. data/lib/openai/helpers/beta/agents/typed_output.rb +191 -0
  12. data/lib/openai/helpers/live/websocket.rb +7 -1
  13. data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +1 -1
  14. data/lib/openai/helpers/responses_websocket/connection.rb +7 -1
  15. data/lib/openai/helpers/responses_websocket/session.rb +5 -1
  16. data/lib/openai/helpers/responses_websocket/transports/async_websocket.rb +12 -2
  17. data/lib/openai/internal/transport/base_client.rb +18 -0
  18. data/lib/openai/internal/type/array_of.rb +1 -1
  19. data/lib/openai/internal/type/base_model.rb +6 -3
  20. data/lib/openai/internal/type/converter.rb +50 -3
  21. data/lib/openai/internal/type/hash_of.rb +1 -1
  22. data/lib/openai/internal/type/union.rb +6 -6
  23. data/lib/openai/models/beta/agent.rb +2 -2
  24. data/lib/openai/models/beta/agent_browser_authentication_cancel_param.rb +23 -0
  25. data/lib/openai/models/beta/agent_browser_authentication_submit_param.rb +70 -0
  26. data/lib/openai/models/beta/agent_browser_origin_access_param.rb +45 -0
  27. data/lib/openai/models/beta/agent_create_params.rb +2 -2
  28. data/lib/openai/models/beta/agent_output_item.rb +276 -1
  29. data/lib/openai/models/beta/agent_session.rb +251 -5
  30. data/lib/openai/models/beta/agent_session_input_param.rb +64 -1
  31. data/lib/openai/models/beta/agent_session_item.rb +391 -1
  32. data/lib/openai/models/beta/agent_session_turn_item_added_event.rb +2 -2
  33. data/lib/openai/models/beta/agent_session_turn_item_done_event.rb +2 -2
  34. data/lib/openai/models/beta/agent_tool.rb +27 -1
  35. data/lib/openai/models/beta/agent_tool_param.rb +27 -1
  36. data/lib/openai/models/beta/agent_update_params.rb +2 -2
  37. data/lib/openai/models/beta/agents/environments/environment_template.rb +26 -2
  38. data/lib/openai/models/beta/agents/environments/template_create_params.rb +48 -3
  39. data/lib/openai/models/beta/agents/environments/template_update_params.rb +45 -3
  40. data/lib/openai/models/beta/agents/session_create_params.rb +2 -2
  41. data/lib/openai/models/beta/agents/sessions/event_create_params.rb +2 -2
  42. data/lib/openai/models/beta/agents/sessions/session_trace.rb +64 -0
  43. data/lib/openai/models/beta/agents/sessions/trace_list_params.rb +68 -0
  44. data/lib/openai/models/beta/agents/vaults/credential.rb +8 -4
  45. data/lib/openai/models/beta/beta_response_output_text.rb +2 -2
  46. data/lib/openai/models/beta/beta_response_output_text_annotation_added_event.rb +2 -2
  47. data/lib/openai/models/beta/environment.rb +58 -2
  48. data/lib/openai/models/beta/environment_param.rb +66 -3
  49. data/lib/openai/models/beta/persisted_agent_tool.rb +27 -1
  50. data/lib/openai/models/beta/persisted_agent_tool_param.rb +27 -1
  51. data/lib/openai/models/beta/session_turn_error.rb +3 -0
  52. data/lib/openai/models/chat/chat_completion_content_part_image.rb +1 -0
  53. data/lib/openai/models/live/fork_server_event.rb +14 -3
  54. data/lib/openai/models/live/server_event.rb +14 -3
  55. data/lib/openai/models/realtime/translations/client_secret_create_params.rb +28 -0
  56. data/lib/openai/models/responses/response_output_text.rb +2 -2
  57. data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +2 -2
  58. data/lib/openai/resources/beta/agents/environments/files.rb +31 -0
  59. data/lib/openai/resources/beta/agents/environments/templates.rb +9 -2
  60. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -0
  61. data/lib/openai/resources/beta/agents/sessions/events.rb +7 -6
  62. data/lib/openai/resources/beta/agents/sessions/items.rb +1 -1
  63. data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +1 -1
  64. data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +1 -1
  65. data/lib/openai/resources/beta/agents/sessions/traces.rb +58 -0
  66. data/lib/openai/resources/beta/agents/sessions.rb +18 -5
  67. data/lib/openai/resources/beta/agents.rb +2 -2
  68. data/lib/openai/resources/evals/runs.rb +1 -1
  69. data/lib/openai/resources/realtime/translations/client_secrets.rb +58 -0
  70. data/lib/openai/resources/realtime/translations.rb +20 -0
  71. data/lib/openai/resources/realtime.rb +4 -0
  72. data/lib/openai/version.rb +1 -1
  73. data/lib/openai.rb +12 -1
  74. data/rbi/openai/helpers/agents.rbi +20 -1
  75. data/rbi/openai/helpers/beta/agents/artifacts.rbi +29 -0
  76. data/rbi/openai/helpers/beta/agents/files.rbi +65 -0
  77. data/rbi/openai/helpers/beta/agents/function_tool.rbi +40 -0
  78. data/rbi/openai/helpers/beta/agents/model_adapter.rbi +22 -0
  79. data/rbi/openai/helpers/beta/agents.rbi +146 -0
  80. data/rbi/openai/internal/transport/base_client.rbi +12 -0
  81. data/rbi/openai/internal/type/base_model.rbi +2 -2
  82. data/rbi/openai/internal/type/converter.rbi +21 -3
  83. data/rbi/openai/internal/type/union.rbi +6 -2
  84. data/rbi/openai/models/beta/agent.rbi +2 -1
  85. data/rbi/openai/models/beta/agent_browser_authentication_cancel_param.rbi +53 -0
  86. data/rbi/openai/models/beta/agent_browser_authentication_submit_param.rbi +125 -0
  87. data/rbi/openai/models/beta/agent_browser_origin_access_param.rbi +76 -0
  88. data/rbi/openai/models/beta/agent_create_params.rbi +6 -3
  89. data/rbi/openai/models/beta/agent_output_item.rbi +422 -0
  90. data/rbi/openai/models/beta/agent_session.rbi +373 -1
  91. data/rbi/openai/models/beta/agent_session_input_param.rbi +102 -0
  92. data/rbi/openai/models/beta/agent_session_item.rbi +614 -0
  93. data/rbi/openai/models/beta/agent_session_turn_item_added_event.rbi +3 -0
  94. data/rbi/openai/models/beta/agent_session_turn_item_done_event.rbi +2 -0
  95. data/rbi/openai/models/beta/agent_tool.rbi +49 -1
  96. data/rbi/openai/models/beta/agent_tool_param.rbi +52 -1
  97. data/rbi/openai/models/beta/agent_update_params.rbi +6 -3
  98. data/rbi/openai/models/beta/agents/environments/environment_template.rbi +53 -2
  99. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +74 -4
  100. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +71 -4
  101. data/rbi/openai/models/beta/agents/session_create_params.rbi +6 -3
  102. data/rbi/openai/models/beta/agents/sessions/event_create_params.rbi +3 -0
  103. data/rbi/openai/models/beta/agents/sessions/session_trace.rbi +97 -0
  104. data/rbi/openai/models/beta/agents/sessions/trace_list_params.rbi +121 -0
  105. data/rbi/openai/models/beta/agents/vaults/credential.rbi +5 -5
  106. data/rbi/openai/models/beta/beta_response_output_text.rbi +2 -2
  107. data/rbi/openai/models/beta/beta_response_output_text_annotation_added_event.rbi +2 -2
  108. data/rbi/openai/models/beta/environment.rbi +82 -2
  109. data/rbi/openai/models/beta/environment_param.rbi +103 -4
  110. data/rbi/openai/models/beta/persisted_agent_tool.rbi +49 -1
  111. data/rbi/openai/models/beta/persisted_agent_tool_param.rbi +52 -1
  112. data/rbi/openai/models/beta/session_turn_error.rbi +3 -0
  113. data/rbi/openai/models/chat/chat_completion_content_part_image.rbi +1 -0
  114. data/rbi/openai/models/live/fork_server_event.rbi +14 -2
  115. data/rbi/openai/models/live/server_event.rbi +14 -2
  116. data/rbi/openai/models/realtime/translations/client_secret_create_params.rbi +68 -0
  117. data/rbi/openai/models/responses/response_output_text.rbi +2 -2
  118. data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +2 -2
  119. data/rbi/openai/resources/beta/agents/environments/files.rbi +31 -0
  120. data/rbi/openai/resources/beta/agents/environments/templates.rbi +7 -0
  121. data/rbi/openai/resources/beta/agents/sessions/artifacts.rbi +8 -0
  122. data/rbi/openai/resources/beta/agents/sessions/events.rbi +7 -5
  123. data/rbi/openai/resources/beta/agents/sessions/traces.rbi +54 -0
  124. data/rbi/openai/resources/beta/agents/sessions.rbi +6 -1
  125. data/rbi/openai/resources/beta/agents.rbi +4 -2
  126. data/rbi/openai/resources/realtime/translations/client_secrets.rbi +54 -0
  127. data/rbi/openai/resources/realtime/translations.rbi +22 -0
  128. data/rbi/openai/resources/realtime.rbi +3 -0
  129. data/sig/openai/helpers/agents.rbs +7 -0
  130. data/sig/openai/helpers/beta/agents/artifacts.rbs +20 -0
  131. data/sig/openai/helpers/beta/agents/files.rbs +41 -0
  132. data/sig/openai/helpers/beta/agents/function_tool.rbs +24 -0
  133. data/sig/openai/helpers/beta/agents/model_adapter.rbs +16 -0
  134. data/sig/openai/helpers/beta/agents.rbs +71 -0
  135. data/sig/openai/helpers/structured_output.rbs +12 -0
  136. data/sig/openai/internal/transport/base_client.rbs +8 -0
  137. data/sig/openai/internal/type/base_model.rbs +3 -1
  138. data/sig/openai/internal/type/converter.rbs +16 -2
  139. data/sig/openai/internal/type/union.rbs +2 -1
  140. data/sig/openai/models/beta/agent_browser_authentication_cancel_param.rbs +21 -0
  141. data/sig/openai/models/beta/agent_browser_authentication_submit_param.rbs +63 -0
  142. data/sig/openai/models/beta/agent_browser_origin_access_param.rbs +47 -0
  143. data/sig/openai/models/beta/agent_output_item.rbs +254 -0
  144. data/sig/openai/models/beta/agent_session.rbs +215 -1
  145. data/sig/openai/models/beta/agent_session_input_param.rbs +51 -1
  146. data/sig/openai/models/beta/agent_session_item.rbs +362 -0
  147. data/sig/openai/models/beta/agent_tool.rbs +22 -0
  148. data/sig/openai/models/beta/agent_tool_param.rbs +25 -0
  149. data/sig/openai/models/beta/agents/environments/environment_template.rbs +29 -3
  150. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +39 -4
  151. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +37 -4
  152. data/sig/openai/models/beta/agents/sessions/session_trace.rbs +65 -0
  153. data/sig/openai/models/beta/agents/sessions/trace_list_params.rbs +81 -0
  154. data/sig/openai/models/beta/agents/vaults/credential.rbs +5 -5
  155. data/sig/openai/models/beta/beta_response_output_text.rbs +2 -2
  156. data/sig/openai/models/beta/beta_response_output_text_annotation_added_event.rbs +2 -2
  157. data/sig/openai/models/beta/environment.rbs +51 -3
  158. data/sig/openai/models/beta/environment_param.rbs +64 -4
  159. data/sig/openai/models/beta/persisted_agent_tool.rbs +22 -0
  160. data/sig/openai/models/beta/persisted_agent_tool_param.rbs +25 -0
  161. data/sig/openai/models/beta/session_turn_error.rbs +4 -0
  162. data/sig/openai/models/chat/chat_completion_content_part_image.rbs +2 -1
  163. data/sig/openai/models/live/fork_server_event.rbs +17 -2
  164. data/sig/openai/models/live/server_event.rbs +17 -2
  165. data/sig/openai/models/realtime/translations/client_secret_create_params.rbs +39 -0
  166. data/sig/openai/models/responses/response_output_text.rbs +2 -2
  167. data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +2 -2
  168. data/sig/openai/resources/beta/agents/environments/files.rbs +17 -0
  169. data/sig/openai/resources/beta/agents/environments/templates.rbs +2 -0
  170. data/sig/openai/resources/beta/agents/sessions/artifacts.rbs +4 -0
  171. data/sig/openai/resources/beta/agents/sessions/traces.rbs +21 -0
  172. data/sig/openai/resources/beta/agents/sessions.rbs +4 -1
  173. data/sig/openai/resources/realtime/translations/client_secrets.rbs +17 -0
  174. data/sig/openai/resources/realtime/translations.rbs +11 -0
  175. data/sig/openai/resources/realtime.rbs +2 -0
  176. metadata +46 -1
@@ -213,12 +213,226 @@ module OpenAI
213
213
  end
214
214
 
215
215
  type required_action =
216
- OpenAI::Beta::AgentSession::RequiredAction::FunctionCall
216
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest
217
+ | OpenAI::Beta::AgentSession::RequiredAction::FunctionCall
217
218
  | OpenAI::Beta::AgentSession::RequiredAction::EnvironmentConnection
218
219
 
219
220
  module RequiredAction
220
221
  extend OpenAI::Internal::Type::Union
221
222
 
223
+ type computer_use_approval_request =
224
+ {
225
+ request: OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::request,
226
+ request_id: String,
227
+ turn_id: String,
228
+ ?type: :computer_use_approval_request
229
+ }
230
+
231
+ class ComputerUseApprovalRequest < OpenAI::Internal::Type::BaseModel
232
+ # The information needed to render the request.
233
+ attr_accessor request: OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::request
234
+
235
+ # The registered request ID to echo when responding.
236
+ attr_accessor request_id: String
237
+
238
+ # The turn that requested approval.
239
+ attr_accessor turn_id: String
240
+
241
+ # The type of the object. Always `computer_use_approval_request`.
242
+ attr_accessor type: :computer_use_approval_request
243
+
244
+ # @param request
245
+ # The information needed to render the request.
246
+ # @param request_id
247
+ # The registered request ID to echo when responding.
248
+ # @param turn_id
249
+ # The turn that requested approval.
250
+ # @param type
251
+ # The type of the object. Always `computer_use_approval_request`.
252
+ def initialize: (
253
+ request: OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::request,
254
+ request_id: String,
255
+ turn_id: String,
256
+ ?type: :computer_use_approval_request
257
+ ) -> void
258
+
259
+ def to_hash: -> {
260
+ request: OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::request,
261
+ request_id: String,
262
+ turn_id: String,
263
+ ?type: :computer_use_approval_request
264
+ }
265
+
266
+ type request =
267
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication
268
+ | OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserOriginAccess
269
+
270
+ module Request
271
+ extend OpenAI::Internal::Type::Union
272
+
273
+ type browser_authentication =
274
+ {
275
+ credential_origin: String?,
276
+ fields: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field],
277
+ options: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option],
278
+ reason: String?,
279
+ ?type: :browser_authentication
280
+ }
281
+
282
+ class BrowserAuthentication < OpenAI::Internal::Type::BaseModel
283
+ # The registered form or frame origin where values will be entered.
284
+ attr_accessor credential_origin: String?
285
+
286
+ # Controls to render. All submitted values are sensitive.
287
+ attr_accessor fields: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field]
288
+
289
+ # Sign-in methods. Empty for a plain form.
290
+ attr_accessor options: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option]
291
+
292
+ # Why the agent needs the user to sign in.
293
+ attr_accessor reason: String?
294
+
295
+ # The type of the object. Always `browser_authentication`.
296
+ attr_accessor type: :browser_authentication
297
+
298
+ # @param credential_origin
299
+ # The registered form or frame origin where values will be entered.
300
+ # @param fields
301
+ # Controls to render. All submitted values are sensitive.
302
+ # @param options
303
+ # Sign-in methods. Empty for a plain form.
304
+ # @param reason
305
+ # Why the agent needs the user to sign in.
306
+ # @param type
307
+ # The type of the object. Always `browser_authentication`.
308
+ def initialize: (
309
+ credential_origin: String?,
310
+ fields: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field],
311
+ options: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option],
312
+ reason: String?,
313
+ ?type: :browser_authentication
314
+ ) -> void
315
+
316
+ def to_hash: -> {
317
+ credential_origin: String?,
318
+ fields: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field],
319
+ options: ::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option],
320
+ reason: String?,
321
+ ?type: :browser_authentication
322
+ }
323
+
324
+ type field =
325
+ { id: String, label: String, required: bool, type: String }
326
+
327
+ class Field < OpenAI::Internal::Type::BaseModel
328
+ # The field ID to submit as field_id in a fields entry.
329
+ attr_accessor id: String
330
+
331
+ # The label to display beside the control.
332
+ attr_accessor label: String
333
+
334
+ # Whether this control requires a nonempty value.
335
+ attr_accessor required: bool
336
+
337
+ # The rendering type, such as email, password, or text.
338
+ attr_accessor type: String
339
+
340
+ # @param id
341
+ # The field ID to submit as field_id in a fields entry.
342
+ # @param label
343
+ # The label to display beside the control.
344
+ # @param required
345
+ # Whether this control requires a nonempty value.
346
+ # @param type
347
+ # The rendering type, such as email, password, or text.
348
+ def initialize: (
349
+ id: String,
350
+ label: String,
351
+ required: bool,
352
+ type: String
353
+ ) -> void
354
+
355
+ def to_hash: -> {
356
+ id: String,
357
+ label: String,
358
+ required: bool,
359
+ type: String
360
+ }
361
+ end
362
+
363
+ type option =
364
+ { id: String, field_ids: ::Array[String], label: String }
365
+
366
+ class Option < OpenAI::Internal::Type::BaseModel
367
+ # The option ID to submit as selected_option.
368
+ attr_accessor id: String
369
+
370
+ # IDs from the registered fields that this method accepts.
371
+ attr_accessor field_ids: ::Array[String]
372
+
373
+ # The method label to display.
374
+ attr_accessor label: String
375
+
376
+ # @param id
377
+ # The option ID to submit as selected_option.
378
+ # @param field_ids
379
+ # IDs from the registered fields that this method accepts.
380
+ # @param label
381
+ # The method label to display.
382
+ def initialize: (
383
+ id: String,
384
+ field_ids: ::Array[String],
385
+ label: String
386
+ ) -> void
387
+
388
+ def to_hash: -> {
389
+ id: String,
390
+ field_ids: ::Array[String],
391
+ label: String
392
+ }
393
+ end
394
+ end
395
+
396
+ type browser_origin_access =
397
+ {
398
+ origin: String,
399
+ reason: String?,
400
+ ?type: :browser_origin_access
401
+ }
402
+
403
+ class BrowserOriginAccess < OpenAI::Internal::Type::BaseModel
404
+ # The origin the browser needs permission to access.
405
+ attr_accessor origin: String
406
+
407
+ # The browser's explanation for this request, or null when unavailable.
408
+ attr_accessor reason: String?
409
+
410
+ # The type of the object. Always `browser_origin_access`.
411
+ attr_accessor type: :browser_origin_access
412
+
413
+ # @param origin
414
+ # The origin the browser needs permission to access.
415
+ # @param reason
416
+ # The browser's explanation for this request, or null when unavailable.
417
+ # @param type
418
+ # The type of the object. Always `browser_origin_access`.
419
+ def initialize: (
420
+ origin: String,
421
+ reason: String?,
422
+ ?type: :browser_origin_access
423
+ ) -> void
424
+
425
+ def to_hash: -> {
426
+ origin: String,
427
+ reason: String?,
428
+ ?type: :browser_origin_access
429
+ }
430
+ end
431
+
432
+ def self?.variants: -> ::Array[OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::request]
433
+ end
434
+ end
435
+
222
436
  type function_call =
223
437
  {
224
438
  arguments: top,
@@ -2,13 +2,63 @@ module OpenAI
2
2
  module Models
3
3
  module Beta
4
4
  type agent_session_input_param =
5
- OpenAI::Beta::AgentSessionInputParam::AgentSessionInputMessage
5
+ OpenAI::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult
6
+ | OpenAI::Beta::AgentSessionInputParam::AgentSessionInputMessage
6
7
  | OpenAI::Beta::AgentSessionInputParam::AgentSessionInputCancel
7
8
  | OpenAI::Beta::AgentSessionInputParam::AgentSessionInputToolResult
8
9
 
9
10
  module AgentSessionInputParam
10
11
  extend OpenAI::Internal::Type::Union
11
12
 
13
+ type agent_session_input_computer_use_approval_request_result =
14
+ {
15
+ request_id: String,
16
+ response: OpenAI::Models::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::response,
17
+ ?type: :"agent.session.input.computer_use_approval_request_result"
18
+ }
19
+
20
+ class AgentSessionInputComputerUseApprovalRequestResult < OpenAI::Internal::Type::BaseModel
21
+ # The registered request ID from the required action.
22
+ attr_accessor request_id: String
23
+
24
+ # The response for this request type.
25
+ attr_accessor response: OpenAI::Models::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::response
26
+
27
+ # The type of the object. Always
28
+ # `agent.session.input.computer_use_approval_request_result`.
29
+ attr_accessor type: :"agent.session.input.computer_use_approval_request_result"
30
+
31
+ # @param request_id
32
+ # The registered request ID from the required action.
33
+ # @param response
34
+ # The response for this request type.
35
+ # @param type
36
+ # The type of the object. Always
37
+ # `agent.session.input.computer_use_approval_request_result`.
38
+ def initialize: (
39
+ request_id: String,
40
+ response: OpenAI::Models::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::response,
41
+ ?type: :"agent.session.input.computer_use_approval_request_result"
42
+ ) -> void
43
+
44
+ def to_hash: -> {
45
+ request_id: String,
46
+ response: OpenAI::Models::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::response,
47
+ ?type: :"agent.session.input.computer_use_approval_request_result"
48
+ }
49
+
50
+ type response =
51
+ OpenAI::Beta::AgentBrowserAuthenticationSubmitParam
52
+ | OpenAI::Beta::AgentBrowserAuthenticationCancelParam
53
+ | OpenAI::Beta::AgentBrowserOriginAccessParam
54
+
55
+ module Response
56
+ extend OpenAI::Internal::Type::Union
57
+
58
+ def self?.variants: -> ::Array[OpenAI::Models::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::response]
59
+ end
60
+ end
61
+
12
62
  type agent_session_input_message =
13
63
  {
14
64
  input: ::Array[OpenAI::Beta::AgentSessionInputMessageParam],
@@ -8,6 +8,9 @@ module OpenAI
8
8
  | OpenAI::Beta::AgentSessionItem::FunctionCallOutput
9
9
  | OpenAI::Beta::AgentSessionItem::AgentMessage
10
10
  | OpenAI::Beta::AgentMcpCallItem
11
+ | OpenAI::Beta::AgentSessionItem::ComputerUseCall
12
+ | OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest
13
+ | OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequestResult
11
14
  | OpenAI::Beta::AgentWebSearchCallItem
12
15
  | OpenAI::Beta::AgentCommandExecutionItem
13
16
  | OpenAI::Beta::AgentCreateSubagentCallItem
@@ -148,6 +151,365 @@ module OpenAI
148
151
  }
149
152
  end
150
153
 
154
+ type computer_use_call =
155
+ {
156
+ id: String,
157
+ output: OpenAI::Beta::AgentSessionItem::ComputerUseCall::Output?,
158
+ status: OpenAI::Models::Beta::agent_function_call_status,
159
+ title: String?,
160
+ turn_id: String,
161
+ ?type: :computer_use_call
162
+ }
163
+
164
+ class ComputerUseCall < OpenAI::Internal::Type::BaseModel
165
+ # The ID of the activity item.
166
+ attr_accessor id: String
167
+
168
+ # The last screenshot emitted by the model. Null when screenshot inclusion is
169
+ # disabled or the call emitted no screenshot.
170
+ attr_accessor output: OpenAI::Beta::AgentSessionItem::ComputerUseCall::Output?
171
+
172
+ # The execution status of the activity.
173
+ attr_accessor status: OpenAI::Models::Beta::agent_function_call_status
174
+
175
+ # A model-generated description of the activity, when available.
176
+ attr_accessor title: String?
177
+
178
+ # The ID of the turn that contains this item.
179
+ attr_accessor turn_id: String
180
+
181
+ # The item type. Always `computer_use_call`.
182
+ attr_accessor type: :computer_use_call
183
+
184
+ # @param id
185
+ # The ID of the activity item.
186
+ # @param output
187
+ # The last screenshot emitted by the model. Null when screenshot inclusion is
188
+ # disabled or the call emitted no screenshot.
189
+ # @param status
190
+ # The execution status of the activity.
191
+ # @param title
192
+ # A model-generated description of the activity, when available.
193
+ # @param turn_id
194
+ # The ID of the turn that contains this item.
195
+ # @param type
196
+ # The item type. Always `computer_use_call`.
197
+ def initialize: (
198
+ id: String,
199
+ output: OpenAI::Beta::AgentSessionItem::ComputerUseCall::Output?,
200
+ status: OpenAI::Models::Beta::agent_function_call_status,
201
+ title: String?,
202
+ turn_id: String,
203
+ ?type: :computer_use_call
204
+ ) -> void
205
+
206
+ def to_hash: -> {
207
+ id: String,
208
+ output: OpenAI::Beta::AgentSessionItem::ComputerUseCall::Output?,
209
+ status: OpenAI::Models::Beta::agent_function_call_status,
210
+ title: String?,
211
+ turn_id: String,
212
+ ?type: :computer_use_call
213
+ }
214
+
215
+ type output = { image_url: String, ?type: :computer_screenshot }
216
+
217
+ class Output < OpenAI::Internal::Type::BaseModel
218
+ # The complete JPEG image as a base64 data URL.
219
+ attr_accessor image_url: String
220
+
221
+ # The content type. Always `computer_screenshot`.
222
+ attr_accessor type: :computer_screenshot
223
+
224
+ # @param image_url
225
+ # The complete JPEG image as a base64 data URL.
226
+ # @param type
227
+ # The content type. Always `computer_screenshot`.
228
+ def initialize: (
229
+ image_url: String,
230
+ ?type: :computer_screenshot
231
+ ) -> void
232
+
233
+ def to_hash: -> { image_url: String, ?type: :computer_screenshot }
234
+ end
235
+ end
236
+
237
+ type computer_use_approval_request =
238
+ {
239
+ id: String,
240
+ request: OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request,
241
+ request_id: String,
242
+ turn_id: String,
243
+ ?type: :computer_use_approval_request
244
+ }
245
+
246
+ class ComputerUseApprovalRequest < OpenAI::Internal::Type::BaseModel
247
+ # The stable history item ID.
248
+ attr_accessor id: String
249
+
250
+ # A registered form awaiting the application's response.
251
+ attr_accessor request: OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request
252
+
253
+ attr_accessor request_id: String
254
+
255
+ attr_accessor turn_id: String
256
+
257
+ # The item type. Always computer_use_approval_request.
258
+ attr_accessor type: :computer_use_approval_request
259
+
260
+ # @param id
261
+ # The stable history item ID.
262
+ # @param request
263
+ # A registered form awaiting the application's response.
264
+ # @param type
265
+ # The item type. Always computer_use_approval_request.
266
+ def initialize: (
267
+ id: String,
268
+ request: OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request,
269
+ request_id: String,
270
+ turn_id: String,
271
+ ?type: :computer_use_approval_request
272
+ ) -> void
273
+
274
+ def to_hash: -> {
275
+ id: String,
276
+ request: OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request,
277
+ request_id: String,
278
+ turn_id: String,
279
+ ?type: :computer_use_approval_request
280
+ }
281
+
282
+ type request =
283
+ {
284
+ credential_origin: String?,
285
+ fields: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Field],
286
+ options: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Option],
287
+ reason: String?,
288
+ ?type: :browser_authentication
289
+ }
290
+
291
+ class Request < OpenAI::Internal::Type::BaseModel
292
+ # The registered form or frame origin where values will be entered.
293
+ attr_accessor credential_origin: String?
294
+
295
+ # Controls to render. All submitted values are sensitive.
296
+ attr_accessor fields: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Field]
297
+
298
+ # Sign-in methods. Empty for a plain form.
299
+ attr_accessor options: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Option]
300
+
301
+ # Why the agent needs the user to sign in.
302
+ attr_accessor reason: String?
303
+
304
+ # The type of the object. Always `browser_authentication`.
305
+ attr_accessor type: :browser_authentication
306
+
307
+ # @param credential_origin
308
+ # The registered form or frame origin where values will be entered.
309
+ # @param fields
310
+ # Controls to render. All submitted values are sensitive.
311
+ # @param options
312
+ # Sign-in methods. Empty for a plain form.
313
+ # @param reason
314
+ # Why the agent needs the user to sign in.
315
+ # @param type
316
+ # The type of the object. Always `browser_authentication`.
317
+ def initialize: (
318
+ credential_origin: String?,
319
+ fields: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Field],
320
+ options: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Option],
321
+ reason: String?,
322
+ ?type: :browser_authentication
323
+ ) -> void
324
+
325
+ def to_hash: -> {
326
+ credential_origin: String?,
327
+ fields: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Field],
328
+ options: ::Array[OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequest::Request::Option],
329
+ reason: String?,
330
+ ?type: :browser_authentication
331
+ }
332
+
333
+ type field =
334
+ { id: String, label: String, required: bool, type: String }
335
+
336
+ class Field < OpenAI::Internal::Type::BaseModel
337
+ # The field ID to submit as field_id in a fields entry.
338
+ attr_accessor id: String
339
+
340
+ # The label to display beside the control.
341
+ attr_accessor label: String
342
+
343
+ # Whether this control requires a nonempty value.
344
+ attr_accessor required: bool
345
+
346
+ # The rendering type, such as email, password, or text.
347
+ attr_accessor type: String
348
+
349
+ # @param id
350
+ # The field ID to submit as field_id in a fields entry.
351
+ # @param label
352
+ # The label to display beside the control.
353
+ # @param required
354
+ # Whether this control requires a nonempty value.
355
+ # @param type
356
+ # The rendering type, such as email, password, or text.
357
+ def initialize: (
358
+ id: String,
359
+ label: String,
360
+ required: bool,
361
+ type: String
362
+ ) -> void
363
+
364
+ def to_hash: -> {
365
+ id: String,
366
+ label: String,
367
+ required: bool,
368
+ type: String
369
+ }
370
+ end
371
+
372
+ type option =
373
+ { id: String, field_ids: ::Array[String], label: String }
374
+
375
+ class Option < OpenAI::Internal::Type::BaseModel
376
+ # The option ID to submit as selected_option.
377
+ attr_accessor id: String
378
+
379
+ # IDs from the registered fields that this method accepts.
380
+ attr_accessor field_ids: ::Array[String]
381
+
382
+ # The method label to display.
383
+ attr_accessor label: String
384
+
385
+ # @param id
386
+ # The option ID to submit as selected_option.
387
+ # @param field_ids
388
+ # IDs from the registered fields that this method accepts.
389
+ # @param label
390
+ # The method label to display.
391
+ def initialize: (
392
+ id: String,
393
+ field_ids: ::Array[String],
394
+ label: String
395
+ ) -> void
396
+
397
+ def to_hash: -> {
398
+ id: String,
399
+ field_ids: ::Array[String],
400
+ label: String
401
+ }
402
+ end
403
+ end
404
+ end
405
+
406
+ type computer_use_approval_request_result =
407
+ {
408
+ id: String,
409
+ request_id: String,
410
+ response: OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::response,
411
+ turn_id: String,
412
+ ?type: :computer_use_approval_request_result
413
+ }
414
+
415
+ class ComputerUseApprovalRequestResult < OpenAI::Internal::Type::BaseModel
416
+ # The stable history item ID.
417
+ attr_accessor id: String
418
+
419
+ # The registered request answered by this item.
420
+ attr_accessor request_id: String
421
+
422
+ # The admitted response, without submitted credential values.
423
+ attr_accessor response: OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::response
424
+
425
+ # The ID of the turn that contains this item.
426
+ attr_accessor turn_id: String
427
+
428
+ attr_accessor type: :computer_use_approval_request_result
429
+
430
+ # @param id
431
+ # The stable history item ID.
432
+ # @param request_id
433
+ # The registered request answered by this item.
434
+ # @param response
435
+ # The admitted response, without submitted credential values.
436
+ # @param turn_id
437
+ # The ID of the turn that contains this item.
438
+ def initialize: (
439
+ id: String,
440
+ request_id: String,
441
+ response: OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::response,
442
+ turn_id: String,
443
+ ?type: :computer_use_approval_request_result
444
+ ) -> void
445
+
446
+ def to_hash: -> {
447
+ id: String,
448
+ request_id: String,
449
+ response: OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::response,
450
+ turn_id: String,
451
+ ?type: :computer_use_approval_request_result
452
+ }
453
+
454
+ type response =
455
+ OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::Response::Submit
456
+ | OpenAI::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::Response::Cancel
457
+
458
+ module Response
459
+ extend OpenAI::Internal::Type::Union
460
+
461
+ type submit =
462
+ {
463
+ ?action: :submit,
464
+ selected_option: String?,
465
+ ?type: :browser_authentication
466
+ }
467
+
468
+ class Submit < OpenAI::Internal::Type::BaseModel
469
+ attr_accessor action: :submit
470
+
471
+ # The chosen sign-in method, or null when no options were offered.
472
+ attr_accessor selected_option: String?
473
+
474
+ attr_accessor type: :browser_authentication
475
+
476
+ # @param selected_option
477
+ # The chosen sign-in method, or null when no options were offered.
478
+ def initialize: (
479
+ selected_option: String?,
480
+ ?action: :submit,
481
+ ?type: :browser_authentication
482
+ ) -> void
483
+
484
+ def to_hash: -> {
485
+ ?action: :submit,
486
+ selected_option: String?,
487
+ ?type: :browser_authentication
488
+ }
489
+ end
490
+
491
+ type cancel = { ?action: :cancel, ?type: :browser_authentication }
492
+
493
+ class Cancel < OpenAI::Internal::Type::BaseModel
494
+ attr_accessor action: :cancel
495
+
496
+ attr_accessor type: :browser_authentication
497
+
498
+ def initialize: (
499
+ ?action: :cancel,
500
+ ?type: :browser_authentication
501
+ ) -> void
502
+
503
+ def to_hash: -> {
504
+ ?action: :cancel,
505
+ ?type: :browser_authentication
506
+ }
507
+ end
508
+
509
+ def self?.variants: -> ::Array[OpenAI::Models::Beta::AgentSessionItem::ComputerUseApprovalRequestResult::response]
510
+ end
511
+ end
512
+
151
513
  def self?.variants: -> ::Array[OpenAI::Models::Beta::agent_session_item]
152
514
  end
153
515
  end