openai 0.96.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/beta/agent.rb +2 -2
  5. data/lib/openai/models/beta/agent_browser_authentication_cancel_param.rb +23 -0
  6. data/lib/openai/models/beta/agent_browser_authentication_submit_param.rb +70 -0
  7. data/lib/openai/models/beta/agent_browser_origin_access_param.rb +45 -0
  8. data/lib/openai/models/beta/agent_create_params.rb +2 -2
  9. data/lib/openai/models/beta/agent_output_item.rb +276 -1
  10. data/lib/openai/models/beta/agent_session.rb +251 -5
  11. data/lib/openai/models/beta/agent_session_input_param.rb +64 -1
  12. data/lib/openai/models/beta/agent_session_item.rb +391 -1
  13. data/lib/openai/models/beta/agent_session_turn_item_added_event.rb +2 -2
  14. data/lib/openai/models/beta/agent_session_turn_item_done_event.rb +2 -2
  15. data/lib/openai/models/beta/agent_tool.rb +27 -1
  16. data/lib/openai/models/beta/agent_tool_param.rb +27 -1
  17. data/lib/openai/models/beta/agent_update_params.rb +2 -2
  18. data/lib/openai/models/beta/agents/environments/environment_template.rb +26 -2
  19. data/lib/openai/models/beta/agents/environments/template_create_params.rb +48 -3
  20. data/lib/openai/models/beta/agents/environments/template_update_params.rb +45 -3
  21. data/lib/openai/models/beta/agents/session_create_params.rb +2 -2
  22. data/lib/openai/models/beta/agents/sessions/event_create_params.rb +2 -2
  23. data/lib/openai/models/beta/environment.rb +26 -2
  24. data/lib/openai/models/beta/environment_param.rb +43 -3
  25. data/lib/openai/models/beta/persisted_agent_tool.rb +27 -1
  26. data/lib/openai/models/beta/persisted_agent_tool_param.rb +27 -1
  27. data/lib/openai/resources/beta/agents/environments/templates.rb +9 -2
  28. data/lib/openai/resources/beta/agents/sessions/events.rb +1 -1
  29. data/lib/openai/resources/beta/agents/sessions/items.rb +1 -1
  30. data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +1 -1
  31. data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +1 -1
  32. data/lib/openai/resources/beta/agents.rb +2 -2
  33. data/lib/openai/version.rb +1 -1
  34. data/lib/openai.rb +3 -0
  35. data/rbi/openai/models/beta/agent.rbi +2 -1
  36. data/rbi/openai/models/beta/agent_browser_authentication_cancel_param.rbi +53 -0
  37. data/rbi/openai/models/beta/agent_browser_authentication_submit_param.rbi +125 -0
  38. data/rbi/openai/models/beta/agent_browser_origin_access_param.rbi +76 -0
  39. data/rbi/openai/models/beta/agent_create_params.rbi +6 -3
  40. data/rbi/openai/models/beta/agent_output_item.rbi +422 -0
  41. data/rbi/openai/models/beta/agent_session.rbi +373 -1
  42. data/rbi/openai/models/beta/agent_session_input_param.rbi +102 -0
  43. data/rbi/openai/models/beta/agent_session_item.rbi +614 -0
  44. data/rbi/openai/models/beta/agent_session_turn_item_added_event.rbi +3 -0
  45. data/rbi/openai/models/beta/agent_session_turn_item_done_event.rbi +2 -0
  46. data/rbi/openai/models/beta/agent_tool.rbi +49 -1
  47. data/rbi/openai/models/beta/agent_tool_param.rbi +52 -1
  48. data/rbi/openai/models/beta/agent_update_params.rbi +6 -3
  49. data/rbi/openai/models/beta/agents/environments/environment_template.rbi +53 -2
  50. data/rbi/openai/models/beta/agents/environments/template_create_params.rbi +74 -4
  51. data/rbi/openai/models/beta/agents/environments/template_update_params.rbi +71 -4
  52. data/rbi/openai/models/beta/agents/session_create_params.rbi +6 -3
  53. data/rbi/openai/models/beta/agents/sessions/event_create_params.rbi +3 -0
  54. data/rbi/openai/models/beta/environment.rbi +53 -2
  55. data/rbi/openai/models/beta/environment_param.rbi +72 -4
  56. data/rbi/openai/models/beta/persisted_agent_tool.rbi +49 -1
  57. data/rbi/openai/models/beta/persisted_agent_tool_param.rbi +52 -1
  58. data/rbi/openai/resources/beta/agents/environments/templates.rbi +7 -0
  59. data/rbi/openai/resources/beta/agents/sessions/events.rbi +1 -0
  60. data/rbi/openai/resources/beta/agents.rbi +4 -2
  61. data/sig/openai/models/beta/agent_browser_authentication_cancel_param.rbs +21 -0
  62. data/sig/openai/models/beta/agent_browser_authentication_submit_param.rbs +63 -0
  63. data/sig/openai/models/beta/agent_browser_origin_access_param.rbs +47 -0
  64. data/sig/openai/models/beta/agent_output_item.rbs +254 -0
  65. data/sig/openai/models/beta/agent_session.rbs +215 -1
  66. data/sig/openai/models/beta/agent_session_input_param.rbs +51 -1
  67. data/sig/openai/models/beta/agent_session_item.rbs +362 -0
  68. data/sig/openai/models/beta/agent_tool.rbs +22 -0
  69. data/sig/openai/models/beta/agent_tool_param.rbs +25 -0
  70. data/sig/openai/models/beta/agents/environments/environment_template.rbs +29 -3
  71. data/sig/openai/models/beta/agents/environments/template_create_params.rbs +39 -4
  72. data/sig/openai/models/beta/agents/environments/template_update_params.rbs +37 -4
  73. data/sig/openai/models/beta/environment.rbs +29 -3
  74. data/sig/openai/models/beta/environment_param.rbs +39 -4
  75. data/sig/openai/models/beta/persisted_agent_tool.rbs +22 -0
  76. data/sig/openai/models/beta/persisted_agent_tool_param.rbs +25 -0
  77. data/sig/openai/resources/beta/agents/environments/templates.rbs +2 -0
  78. metadata +10 -1
@@ -93,6 +93,7 @@ module OpenAI
93
93
 
94
94
  required_actions: T::Array[
95
95
  T.any(
96
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::OrHash,
96
97
  OpenAI::Beta::AgentSession::RequiredAction::FunctionCall::OrHash,
97
98
  OpenAI::Beta::AgentSession::RequiredAction::EnvironmentConnection::OrHash
98
99
  )
@@ -250,7 +251,8 @@ module OpenAI
250
251
  OpenAI::Beta::AgentTool::Function::OrHash,
251
252
  OpenAI::Beta::AgentTool::ProgrammaticToolCalling::OrHash,
252
253
  OpenAI::Beta::AgentTool::Mcp::OrHash,
253
- OpenAI::Beta::AgentTool::WebSearch::OrHash
254
+ OpenAI::Beta::AgentTool::WebSearch::OrHash,
255
+ OpenAI::Beta::AgentTool::ComputerUse::OrHash
254
256
  )
255
257
  ]
256
258
  )
@@ -333,11 +335,381 @@ module OpenAI
333
335
 
334
336
  Variants = T.type_alias {
335
337
  T.any(
338
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest,
336
339
  OpenAI::Beta::AgentSession::RequiredAction::FunctionCall,
337
340
  OpenAI::Beta::AgentSession::RequiredAction::EnvironmentConnection
338
341
  )
339
342
  }
340
343
 
344
+ class ComputerUseApprovalRequest < OpenAI::Internal::Type::BaseModel
345
+ OrHash = T.type_alias do
346
+ T.any(
347
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest,
348
+ OpenAI::Internal::AnyHash
349
+ )
350
+ end
351
+
352
+ # The information needed to render the request.
353
+ sig { returns(OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::Variants) }
354
+ attr_accessor :request
355
+
356
+ # The registered request ID to echo when responding.
357
+ sig { returns(String) }
358
+ attr_accessor :request_id
359
+
360
+ # The turn that requested approval.
361
+ sig { returns(String) }
362
+ attr_accessor :turn_id
363
+
364
+ # The type of the object. Always `computer_use_approval_request`.
365
+ sig { returns(Symbol) }
366
+ attr_accessor :type
367
+
368
+ # Respond to a computer-use request.
369
+ sig do
370
+ params(
371
+
372
+ request: T.any(
373
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::OrHash,
374
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserOriginAccess::OrHash
375
+ ),
376
+
377
+ request_id: String,
378
+
379
+ turn_id: String,
380
+
381
+ type: Symbol
382
+ )
383
+ .returns(T.attached_class)
384
+ end
385
+ def self.new(
386
+
387
+ # The information needed to render the request.
388
+ request:,
389
+
390
+ # The registered request ID to echo when responding.
391
+ request_id:,
392
+
393
+ # The turn that requested approval.
394
+ turn_id:,
395
+
396
+ # The type of the object. Always `computer_use_approval_request`.
397
+
398
+ type: :computer_use_approval_request
399
+ )
400
+ end
401
+
402
+ sig do
403
+ override.returns(
404
+ {
405
+ request: OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::Variants,
406
+ request_id: String,
407
+ turn_id: String,
408
+ type: Symbol
409
+ }
410
+ )
411
+ end
412
+ def to_hash
413
+ end
414
+
415
+ # The information needed to render the request.
416
+ module Request
417
+ extend OpenAI::Internal::Type::Union
418
+
419
+ Variants = T.type_alias {
420
+ T.any(
421
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication,
422
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserOriginAccess
423
+ )
424
+ }
425
+
426
+ class BrowserAuthentication < OpenAI::Internal::Type::BaseModel
427
+ OrHash = T.type_alias do
428
+ T.any(
429
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication,
430
+ OpenAI::Internal::AnyHash
431
+ )
432
+ end
433
+
434
+ # The registered form or frame origin where values will be entered.
435
+ sig { returns(T.nilable(String)) }
436
+ attr_accessor :credential_origin
437
+
438
+ # Controls to render. All submitted values are sensitive.
439
+ sig {
440
+ returns(
441
+ T::Array[
442
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field
443
+ ]
444
+ )
445
+ }
446
+ attr_accessor :fields
447
+
448
+ # Sign-in methods. Empty for a plain form.
449
+ sig {
450
+ returns(
451
+ T::Array[
452
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option
453
+ ]
454
+ )
455
+ }
456
+ attr_accessor :options
457
+
458
+ # Why the agent needs the user to sign in.
459
+ sig { returns(T.nilable(String)) }
460
+ attr_accessor :reason
461
+
462
+ # The type of the object. Always `browser_authentication`.
463
+ sig { returns(Symbol) }
464
+ attr_accessor :type
465
+
466
+ # A registered form awaiting the application's response.
467
+ sig do
468
+ params(
469
+
470
+ credential_origin: T.nilable(String),
471
+
472
+ fields: T::Array[
473
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field::OrHash
474
+ ],
475
+
476
+ options: T::Array[
477
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option::OrHash
478
+ ],
479
+
480
+ reason: T.nilable(String),
481
+
482
+ type: Symbol
483
+ )
484
+ .returns(T.attached_class)
485
+ end
486
+ def self.new(
487
+
488
+ # The registered form or frame origin where values will be entered.
489
+ credential_origin:,
490
+
491
+ # Controls to render. All submitted values are sensitive.
492
+ fields:,
493
+
494
+ # Sign-in methods. Empty for a plain form.
495
+ options:,
496
+
497
+ # Why the agent needs the user to sign in.
498
+ reason:,
499
+
500
+ # The type of the object. Always `browser_authentication`.
501
+
502
+ type: :browser_authentication
503
+ )
504
+ end
505
+
506
+ sig do
507
+ override.returns(
508
+ {
509
+ credential_origin: T.nilable(String),
510
+ fields: T::Array[
511
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field
512
+ ],
513
+ options: T::Array[
514
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option
515
+ ],
516
+ reason: T.nilable(String),
517
+ type: Symbol
518
+ }
519
+ )
520
+ end
521
+ def to_hash
522
+ end
523
+
524
+ class Field < OpenAI::Internal::Type::BaseModel
525
+ OrHash = T.type_alias do
526
+ T.any(
527
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Field,
528
+ OpenAI::Internal::AnyHash
529
+ )
530
+ end
531
+
532
+ # The field ID to submit as field_id in a fields entry.
533
+ sig { returns(String) }
534
+ attr_accessor :id
535
+
536
+ # The label to display beside the control.
537
+ sig { returns(String) }
538
+ attr_accessor :label
539
+
540
+ # Whether this control requires a nonempty value.
541
+ sig { returns(T::Boolean) }
542
+ attr_accessor :required
543
+
544
+ # The rendering type, such as email, password, or text.
545
+ sig { returns(String) }
546
+ attr_accessor :type
547
+
548
+ # A control in a registered browser-login form.
549
+ sig do
550
+ params(
551
+
552
+ id: String,
553
+
554
+ label: String,
555
+
556
+ required: T::Boolean,
557
+
558
+ type: String
559
+ )
560
+ .returns(T.attached_class)
561
+ end
562
+ def self.new(
563
+
564
+ # The field ID to submit as field_id in a fields entry.
565
+ id:,
566
+
567
+ # The label to display beside the control.
568
+ label:,
569
+
570
+ # Whether this control requires a nonempty value.
571
+ required:,
572
+
573
+ # The rendering type, such as email, password, or text.
574
+
575
+ type:
576
+ )
577
+ end
578
+
579
+ sig do
580
+ override.returns(
581
+ {id: String, label: String, required: T::Boolean, type: String}
582
+ )
583
+ end
584
+ def to_hash
585
+ end
586
+
587
+ end
588
+
589
+ class Option < OpenAI::Internal::Type::BaseModel
590
+ OrHash = T.type_alias do
591
+ T.any(
592
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserAuthentication::Option,
593
+ OpenAI::Internal::AnyHash
594
+ )
595
+ end
596
+
597
+ # The option ID to submit as selected_option.
598
+ sig { returns(String) }
599
+ attr_accessor :id
600
+
601
+ # IDs from the registered fields that this method accepts.
602
+ sig { returns(T::Array[String]) }
603
+ attr_accessor :field_ids
604
+
605
+ # The method label to display.
606
+ sig { returns(String) }
607
+ attr_accessor :label
608
+
609
+ # A sign-in method and the fields that belong to it.
610
+ sig do
611
+ params(
612
+
613
+ id: String,
614
+
615
+ field_ids: T::Array[String],
616
+
617
+ label: String
618
+ )
619
+ .returns(T.attached_class)
620
+ end
621
+ def self.new(
622
+
623
+ # The option ID to submit as selected_option.
624
+ id:,
625
+
626
+ # IDs from the registered fields that this method accepts.
627
+ field_ids:,
628
+
629
+ # The method label to display.
630
+
631
+ label:
632
+ )
633
+ end
634
+
635
+ sig do
636
+ override.returns(
637
+ {id: String, field_ids: T::Array[String], label: String}
638
+ )
639
+ end
640
+ def to_hash
641
+ end
642
+
643
+ end
644
+ end
645
+
646
+ class BrowserOriginAccess < OpenAI::Internal::Type::BaseModel
647
+ OrHash = T.type_alias do
648
+ T.any(
649
+ OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::BrowserOriginAccess,
650
+ OpenAI::Internal::AnyHash
651
+ )
652
+ end
653
+
654
+ # The origin the browser needs permission to access.
655
+ sig { returns(String) }
656
+ attr_accessor :origin
657
+
658
+ # The browser's explanation for this request, or null when unavailable.
659
+ sig { returns(T.nilable(String)) }
660
+ attr_accessor :reason
661
+
662
+ # The type of the object. Always `browser_origin_access`.
663
+ sig { returns(Symbol) }
664
+ attr_accessor :type
665
+
666
+ # A browser origin awaiting the application's approval decision.
667
+ sig do
668
+ params(
669
+
670
+ origin: String,
671
+
672
+ reason: T.nilable(String),
673
+
674
+ type: Symbol
675
+ )
676
+ .returns(T.attached_class)
677
+ end
678
+ def self.new(
679
+
680
+ # The origin the browser needs permission to access.
681
+ origin:,
682
+
683
+ # The browser's explanation for this request, or null when unavailable.
684
+ reason:,
685
+
686
+ # The type of the object. Always `browser_origin_access`.
687
+
688
+ type: :browser_origin_access
689
+ )
690
+ end
691
+
692
+ sig do
693
+ override.returns(
694
+ {origin: String, reason: T.nilable(String), type: Symbol}
695
+ )
696
+ end
697
+ def to_hash
698
+ end
699
+
700
+ end
701
+
702
+ sig {
703
+ override.returns(
704
+ T::Array[OpenAI::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest::Request::Variants]
705
+ )
706
+ }
707
+ def self.variants
708
+ end
709
+
710
+ end
711
+ end
712
+
341
713
  class FunctionCall < OpenAI::Internal::Type::BaseModel
342
714
  OrHash = T.type_alias do
343
715
  T.any(
@@ -11,12 +11,114 @@ module OpenAI
11
11
 
12
12
  Variants = T.type_alias do
13
13
  T.any(
14
+ OpenAI::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult,
14
15
  OpenAI::Beta::AgentSessionInputParam::AgentSessionInputMessage,
15
16
  OpenAI::Beta::AgentSessionInputParam::AgentSessionInputCancel,
16
17
  OpenAI::Beta::AgentSessionInputParam::AgentSessionInputToolResult
17
18
  )
18
19
  end
19
20
 
21
+ class AgentSessionInputComputerUseApprovalRequestResult < OpenAI::Internal::Type::BaseModel
22
+ OrHash = T.type_alias do
23
+ T.any(
24
+ OpenAI::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult,
25
+ OpenAI::Internal::AnyHash
26
+ )
27
+ end
28
+
29
+ # The registered request ID from the required action.
30
+ sig { returns(String) }
31
+ attr_accessor :request_id
32
+
33
+ # The response for this request type.
34
+ sig {
35
+ returns(
36
+ T.any(
37
+ OpenAI::Beta::AgentBrowserAuthenticationSubmitParam,
38
+ OpenAI::Beta::AgentBrowserAuthenticationCancelParam,
39
+ OpenAI::Beta::AgentBrowserOriginAccessParam
40
+ )
41
+ )
42
+ }
43
+ attr_accessor :response
44
+
45
+ # The type of the object. Always
46
+ # `agent.session.input.computer_use_approval_request_result`.
47
+ sig { returns(Symbol) }
48
+ attr_accessor :type
49
+
50
+ # Responds to a pending Computer Use approval request.
51
+ sig do
52
+ params(
53
+
54
+ request_id: String,
55
+
56
+ response: T.any(
57
+ OpenAI::Beta::AgentBrowserAuthenticationSubmitParam::OrHash,
58
+ OpenAI::Beta::AgentBrowserAuthenticationCancelParam::OrHash,
59
+ OpenAI::Beta::AgentBrowserOriginAccessParam::OrHash
60
+ ),
61
+
62
+ type: Symbol
63
+ )
64
+ .returns(T.attached_class)
65
+ end
66
+ def self.new(
67
+
68
+ # The registered request ID from the required action.
69
+ request_id:,
70
+
71
+ # The response for this request type.
72
+ response:,
73
+
74
+ # The type of the object. Always
75
+ # `agent.session.input.computer_use_approval_request_result`.
76
+
77
+ type: :"agent.session.input.computer_use_approval_request_result"
78
+ )
79
+ end
80
+
81
+ sig do
82
+ override.returns(
83
+ {
84
+ request_id: String,
85
+ response: T.any(
86
+ OpenAI::Beta::AgentBrowserAuthenticationSubmitParam,
87
+ OpenAI::Beta::AgentBrowserAuthenticationCancelParam,
88
+ OpenAI::Beta::AgentBrowserOriginAccessParam
89
+ ),
90
+ type: Symbol
91
+ }
92
+ )
93
+ end
94
+ def to_hash
95
+ end
96
+
97
+ # The response for this request type.
98
+ module Response
99
+ extend OpenAI::Internal::Type::Union
100
+
101
+ Variants = T.type_alias {
102
+ T.any(
103
+ OpenAI::Beta::AgentBrowserAuthenticationSubmitParam,
104
+ OpenAI::Beta::AgentBrowserAuthenticationCancelParam,
105
+ OpenAI::Beta::AgentBrowserOriginAccessParam
106
+ )
107
+ }
108
+
109
+ sig {
110
+ override.returns(
111
+ T::Array[
112
+ OpenAI::Beta::AgentSessionInputParam::AgentSessionInputComputerUseApprovalRequestResult::Response::Variants
113
+ ]
114
+ )
115
+ }
116
+ def self.variants
117
+ end
118
+
119
+ end
120
+ end
121
+
20
122
  class AgentSessionInputMessage < OpenAI::Internal::Type::BaseModel
21
123
  OrHash = T.type_alias do
22
124
  T.any(