openai 0.35.1 → 0.36.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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +21 -15
  4. data/lib/openai/helpers/structured_output/union_of.rb +5 -1
  5. data/lib/openai/internal/transport/pooled_net_requester.rb +6 -2
  6. data/lib/openai/internal/type/enum.rb +6 -6
  7. data/lib/openai/models/batch_create_params.rb +9 -6
  8. data/lib/openai/models/beta/assistant_create_params.rb +9 -5
  9. data/lib/openai/models/beta/assistant_update_params.rb +9 -5
  10. data/lib/openai/models/beta/threads/run_create_params.rb +10 -6
  11. data/lib/openai/models/chat/completion_create_params.rb +37 -6
  12. data/lib/openai/models/chat_model.rb +5 -0
  13. data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
  14. data/lib/openai/models/conversations/conversation_item.rb +13 -1
  15. data/lib/openai/models/conversations/conversation_item_list.rb +2 -2
  16. data/lib/openai/models/conversations/item_create_params.rb +2 -2
  17. data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +9 -5
  18. data/lib/openai/models/evals/run_cancel_response.rb +20 -12
  19. data/lib/openai/models/evals/run_create_params.rb +20 -12
  20. data/lib/openai/models/evals/run_create_response.rb +20 -12
  21. data/lib/openai/models/evals/run_list_response.rb +20 -12
  22. data/lib/openai/models/evals/run_retrieve_response.rb +20 -12
  23. data/lib/openai/models/graders/score_model_grader.rb +9 -5
  24. data/lib/openai/models/reasoning.rb +10 -6
  25. data/lib/openai/models/reasoning_effort.rb +10 -5
  26. data/lib/openai/models/responses/apply_patch_tool.rb +20 -0
  27. data/lib/openai/models/responses/function_shell_tool.rb +20 -0
  28. data/lib/openai/models/responses/input_token_count_params.rb +14 -8
  29. data/lib/openai/models/responses/response.rb +46 -11
  30. data/lib/openai/models/responses/response_apply_patch_tool_call.rb +179 -0
  31. data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +77 -0
  32. data/lib/openai/models/responses/response_create_params.rb +42 -9
  33. data/lib/openai/models/responses/response_function_shell_call_output_content.rb +88 -0
  34. data/lib/openai/models/responses/response_function_shell_tool_call.rb +109 -0
  35. data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +158 -0
  36. data/lib/openai/models/responses/response_input_item.rb +395 -1
  37. data/lib/openai/models/responses/response_item.rb +13 -1
  38. data/lib/openai/models/responses/response_item_list.rb +2 -2
  39. data/lib/openai/models/responses/response_output_item.rb +13 -1
  40. data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
  41. data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
  42. data/lib/openai/models/responses/tool.rb +7 -1
  43. data/lib/openai/models/responses/tool_choice_apply_patch.rb +20 -0
  44. data/lib/openai/models/responses/tool_choice_shell.rb +20 -0
  45. data/lib/openai/resources/chat/completions.rb +6 -2
  46. data/lib/openai/resources/conversations/items.rb +3 -3
  47. data/lib/openai/resources/conversations.rb +1 -1
  48. data/lib/openai/resources/responses/input_items.rb +1 -1
  49. data/lib/openai/resources/responses/input_tokens.rb +3 -3
  50. data/lib/openai/resources/responses.rb +12 -8
  51. data/lib/openai/version.rb +1 -1
  52. data/lib/openai.rb +10 -0
  53. data/manifest.yaml +1 -0
  54. data/rbi/openai/internal/transport/pooled_net_requester.rbi +6 -2
  55. data/rbi/openai/models/batch_create_params.rbi +17 -9
  56. data/rbi/openai/models/beta/assistant_create_params.rbi +18 -10
  57. data/rbi/openai/models/beta/assistant_update_params.rbi +18 -10
  58. data/rbi/openai/models/beta/threads/run_create_params.rbi +18 -10
  59. data/rbi/openai/models/chat/completion_create_params.rbi +82 -10
  60. data/rbi/openai/models/chat_model.rbi +7 -0
  61. data/rbi/openai/models/conversations/conversation_create_params.rbi +12 -0
  62. data/rbi/openai/models/conversations/conversation_item.rbi +4 -0
  63. data/rbi/openai/models/conversations/conversation_item_list.rbi +4 -0
  64. data/rbi/openai/models/conversations/item_create_params.rbi +12 -0
  65. data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +18 -10
  66. data/rbi/openai/models/evals/run_cancel_response.rbi +40 -20
  67. data/rbi/openai/models/evals/run_create_params.rbi +44 -20
  68. data/rbi/openai/models/evals/run_create_response.rbi +40 -20
  69. data/rbi/openai/models/evals/run_list_response.rbi +40 -20
  70. data/rbi/openai/models/evals/run_retrieve_response.rbi +40 -20
  71. data/rbi/openai/models/graders/score_model_grader.rbi +18 -10
  72. data/rbi/openai/models/reasoning.rbi +18 -10
  73. data/rbi/openai/models/reasoning_effort.rbi +10 -5
  74. data/rbi/openai/models/responses/apply_patch_tool.rbi +30 -0
  75. data/rbi/openai/models/responses/function_shell_tool.rbi +33 -0
  76. data/rbi/openai/models/responses/input_token_count_params.rbi +18 -4
  77. data/rbi/openai/models/responses/response.rbi +73 -2
  78. data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +300 -0
  79. data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +129 -0
  80. data/rbi/openai/models/responses/response_create_params.rbi +87 -5
  81. data/rbi/openai/models/responses/response_function_shell_call_output_content.rbi +157 -0
  82. data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +198 -0
  83. data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +254 -0
  84. data/rbi/openai/models/responses/response_input_item.rbi +675 -0
  85. data/rbi/openai/models/responses/response_item.rbi +4 -0
  86. data/rbi/openai/models/responses/response_item_list.rbi +4 -0
  87. data/rbi/openai/models/responses/response_output_item.rbi +4 -0
  88. data/rbi/openai/models/responses/response_output_item_added_event.rbi +4 -0
  89. data/rbi/openai/models/responses/response_output_item_done_event.rbi +4 -0
  90. data/rbi/openai/models/responses/tool.rbi +2 -0
  91. data/rbi/openai/models/responses/tool_choice_apply_patch.rbi +33 -0
  92. data/rbi/openai/models/responses/tool_choice_shell.rbi +30 -0
  93. data/rbi/openai/resources/batches.rbi +4 -3
  94. data/rbi/openai/resources/beta/assistants.rbi +18 -10
  95. data/rbi/openai/resources/beta/threads/runs.rbi +18 -10
  96. data/rbi/openai/resources/chat/completions.rbi +38 -12
  97. data/rbi/openai/resources/conversations/items.rbi +4 -0
  98. data/rbi/openai/resources/conversations.rbi +4 -0
  99. data/rbi/openai/resources/responses/input_tokens.rbi +5 -1
  100. data/rbi/openai/resources/responses.rbi +28 -2
  101. data/sig/openai/internal/transport/pooled_net_requester.rbs +4 -1
  102. data/sig/openai/models/batch_create_params.rbs +2 -0
  103. data/sig/openai/models/chat/completion_create_params.rbs +16 -0
  104. data/sig/openai/models/chat_model.rbs +11 -1
  105. data/sig/openai/models/conversations/conversation_item.rbs +4 -0
  106. data/sig/openai/models/reasoning_effort.rbs +2 -1
  107. data/sig/openai/models/responses/apply_patch_tool.rbs +15 -0
  108. data/sig/openai/models/responses/function_shell_tool.rbs +15 -0
  109. data/sig/openai/models/responses/input_token_count_params.rbs +2 -0
  110. data/sig/openai/models/responses/response.rbs +18 -0
  111. data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +123 -0
  112. data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +60 -0
  113. data/sig/openai/models/responses/response_create_params.rbs +18 -0
  114. data/sig/openai/models/responses/response_function_shell_call_output_content.rbs +64 -0
  115. data/sig/openai/models/responses/response_function_shell_tool_call.rbs +88 -0
  116. data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +115 -0
  117. data/sig/openai/models/responses/response_input_item.rbs +276 -0
  118. data/sig/openai/models/responses/response_item.rbs +4 -0
  119. data/sig/openai/models/responses/response_output_item.rbs +4 -0
  120. data/sig/openai/models/responses/tool.rbs +2 -0
  121. data/sig/openai/models/responses/tool_choice_apply_patch.rbs +15 -0
  122. data/sig/openai/models/responses/tool_choice_shell.rbs +15 -0
  123. data/sig/openai/resources/chat/completions.rbs +2 -0
  124. data/sig/openai/resources/responses.rbs +2 -0
  125. metadata +29 -2
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class ResponseFunctionShellToolCall < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The unique ID of the function shell tool call. Populated when this item is
9
+ # returned via API.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute action
15
+ # The shell commands and limits that describe how to run the tool call.
16
+ #
17
+ # @return [OpenAI::Models::Responses::ResponseFunctionShellToolCall::Action]
18
+ required :action, -> { OpenAI::Responses::ResponseFunctionShellToolCall::Action }
19
+
20
+ # @!attribute call_id
21
+ # The unique ID of the function shell tool call generated by the model.
22
+ #
23
+ # @return [String]
24
+ required :call_id, String
25
+
26
+ # @!attribute status
27
+ # The status of the shell call. One of `in_progress`, `completed`, or
28
+ # `incomplete`.
29
+ #
30
+ # @return [Symbol, OpenAI::Models::Responses::ResponseFunctionShellToolCall::Status]
31
+ required :status, enum: -> { OpenAI::Responses::ResponseFunctionShellToolCall::Status }
32
+
33
+ # @!attribute type
34
+ # The type of the item. Always `shell_call`.
35
+ #
36
+ # @return [Symbol, :shell_call]
37
+ required :type, const: :shell_call
38
+
39
+ # @!attribute created_by
40
+ # The ID of the entity that created this tool call.
41
+ #
42
+ # @return [String, nil]
43
+ optional :created_by, String
44
+
45
+ # @!method initialize(id:, action:, call_id:, status:, created_by: nil, type: :shell_call)
46
+ # Some parameter documentations has been truncated, see
47
+ # {OpenAI::Models::Responses::ResponseFunctionShellToolCall} for more details.
48
+ #
49
+ # A tool call that executes one or more shell commands in a managed environment.
50
+ #
51
+ # @param id [String] The unique ID of the function shell tool call. Populated when this item is retur
52
+ #
53
+ # @param action [OpenAI::Models::Responses::ResponseFunctionShellToolCall::Action] The shell commands and limits that describe how to run the tool call.
54
+ #
55
+ # @param call_id [String] The unique ID of the function shell tool call generated by the model.
56
+ #
57
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseFunctionShellToolCall::Status] The status of the shell call. One of `in_progress`, `completed`, or `incomplete`
58
+ #
59
+ # @param created_by [String] The ID of the entity that created this tool call.
60
+ #
61
+ # @param type [Symbol, :shell_call] The type of the item. Always `shell_call`.
62
+
63
+ # @see OpenAI::Models::Responses::ResponseFunctionShellToolCall#action
64
+ class Action < OpenAI::Internal::Type::BaseModel
65
+ # @!attribute commands
66
+ #
67
+ # @return [Array<String>]
68
+ required :commands, OpenAI::Internal::Type::ArrayOf[String]
69
+
70
+ # @!attribute max_output_length
71
+ # Optional maximum number of characters to return from each command.
72
+ #
73
+ # @return [Integer, nil]
74
+ required :max_output_length, Integer, nil?: true
75
+
76
+ # @!attribute timeout_ms
77
+ # Optional timeout in milliseconds for the commands.
78
+ #
79
+ # @return [Integer, nil]
80
+ required :timeout_ms, Integer, nil?: true
81
+
82
+ # @!method initialize(commands:, max_output_length:, timeout_ms:)
83
+ # The shell commands and limits that describe how to run the tool call.
84
+ #
85
+ # @param commands [Array<String>]
86
+ #
87
+ # @param max_output_length [Integer, nil] Optional maximum number of characters to return from each command.
88
+ #
89
+ # @param timeout_ms [Integer, nil] Optional timeout in milliseconds for the commands.
90
+ end
91
+
92
+ # The status of the shell call. One of `in_progress`, `completed`, or
93
+ # `incomplete`.
94
+ #
95
+ # @see OpenAI::Models::Responses::ResponseFunctionShellToolCall#status
96
+ module Status
97
+ extend OpenAI::Internal::Type::Enum
98
+
99
+ IN_PROGRESS = :in_progress
100
+ COMPLETED = :completed
101
+ INCOMPLETE = :incomplete
102
+
103
+ # @!method self.values
104
+ # @return [Array<Symbol>]
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,158 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Responses
6
+ class ResponseFunctionShellToolCallOutput < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The unique ID of the shell call output. Populated when this item is returned via
9
+ # API.
10
+ #
11
+ # @return [String]
12
+ required :id, String
13
+
14
+ # @!attribute call_id
15
+ # The unique ID of the shell tool call generated by the model.
16
+ #
17
+ # @return [String]
18
+ required :call_id, String
19
+
20
+ # @!attribute max_output_length
21
+ # The maximum length of the shell command output. This is generated by the model
22
+ # and should be passed back with the raw output.
23
+ #
24
+ # @return [Integer, nil]
25
+ required :max_output_length, Integer, nil?: true
26
+
27
+ # @!attribute output
28
+ # An array of shell call output contents
29
+ #
30
+ # @return [Array<OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output>]
31
+ required :output,
32
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output] }
33
+
34
+ # @!attribute type
35
+ # The type of the shell call output. Always `shell_call_output`.
36
+ #
37
+ # @return [Symbol, :shell_call_output]
38
+ required :type, const: :shell_call_output
39
+
40
+ # @!attribute created_by
41
+ #
42
+ # @return [String, nil]
43
+ optional :created_by, String
44
+
45
+ # @!method initialize(id:, call_id:, max_output_length:, output:, created_by: nil, type: :shell_call_output)
46
+ # Some parameter documentations has been truncated, see
47
+ # {OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput} for more
48
+ # details.
49
+ #
50
+ # The output of a shell tool call.
51
+ #
52
+ # @param id [String] The unique ID of the shell call output. Populated when this item is returned via
53
+ #
54
+ # @param call_id [String] The unique ID of the shell tool call generated by the model.
55
+ #
56
+ # @param max_output_length [Integer, nil] The maximum length of the shell command output. This is generated by the model a
57
+ #
58
+ # @param output [Array<OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output>] An array of shell call output contents
59
+ #
60
+ # @param created_by [String]
61
+ #
62
+ # @param type [Symbol, :shell_call_output] The type of the shell call output. Always `shell_call_output`.
63
+
64
+ class Output < OpenAI::Internal::Type::BaseModel
65
+ # @!attribute outcome
66
+ # Represents either an exit outcome (with an exit code) or a timeout outcome for a
67
+ # shell call output chunk.
68
+ #
69
+ # @return [OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit]
70
+ required :outcome, union: -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome }
71
+
72
+ # @!attribute stderr
73
+ #
74
+ # @return [String]
75
+ required :stderr, String
76
+
77
+ # @!attribute stdout
78
+ #
79
+ # @return [String]
80
+ required :stdout, String
81
+
82
+ # @!attribute created_by
83
+ #
84
+ # @return [String, nil]
85
+ optional :created_by, String
86
+
87
+ # @!method initialize(outcome:, stderr:, stdout:, created_by: nil)
88
+ # Some parameter documentations has been truncated, see
89
+ # {OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output} for
90
+ # more details.
91
+ #
92
+ # The content of a shell call output.
93
+ #
94
+ # @param outcome [OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit] Represents either an exit outcome (with an exit code) or a timeout outcome for a
95
+ #
96
+ # @param stderr [String]
97
+ #
98
+ # @param stdout [String]
99
+ #
100
+ # @param created_by [String]
101
+
102
+ # Represents either an exit outcome (with an exit code) or a timeout outcome for a
103
+ # shell call output chunk.
104
+ #
105
+ # @see OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output#outcome
106
+ module Outcome
107
+ extend OpenAI::Internal::Type::Union
108
+
109
+ discriminator :type
110
+
111
+ # Indicates that the function shell call exceeded its configured time limit.
112
+ variant :timeout, -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout }
113
+
114
+ # Indicates that the shell commands finished and returned an exit code.
115
+ variant :exit, -> { OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit }
116
+
117
+ class Timeout < OpenAI::Internal::Type::BaseModel
118
+ # @!attribute type
119
+ # The outcome type. Always `timeout`.
120
+ #
121
+ # @return [Symbol, :timeout]
122
+ required :type, const: :timeout
123
+
124
+ # @!method initialize(type: :timeout)
125
+ # Indicates that the function shell call exceeded its configured time limit.
126
+ #
127
+ # @param type [Symbol, :timeout] The outcome type. Always `timeout`.
128
+ end
129
+
130
+ class Exit < OpenAI::Internal::Type::BaseModel
131
+ # @!attribute exit_code
132
+ # Exit code from the shell process.
133
+ #
134
+ # @return [Integer]
135
+ required :exit_code, Integer
136
+
137
+ # @!attribute type
138
+ # The outcome type. Always `exit`.
139
+ #
140
+ # @return [Symbol, :exit]
141
+ required :type, const: :exit
142
+
143
+ # @!method initialize(exit_code:, type: :exit)
144
+ # Indicates that the shell commands finished and returned an exit code.
145
+ #
146
+ # @param exit_code [Integer] Exit code from the shell process.
147
+ #
148
+ # @param type [Symbol, :exit] The outcome type. Always `exit`.
149
+ end
150
+
151
+ # @!method self.variants
152
+ # @return [Array(OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout, OpenAI::Models::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit)]
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
@@ -68,6 +68,18 @@ module OpenAI
68
68
  # The output of a local shell tool call.
69
69
  variant :local_shell_call_output, -> { OpenAI::Responses::ResponseInputItem::LocalShellCallOutput }
70
70
 
71
+ # A tool representing a request to execute one or more shell commands.
72
+ variant :shell_call, -> { OpenAI::Responses::ResponseInputItem::ShellCall }
73
+
74
+ # The streamed output items emitted by a function shell tool call.
75
+ variant :shell_call_output, -> { OpenAI::Responses::ResponseInputItem::ShellCallOutput }
76
+
77
+ # A tool call representing a request to create, delete, or update files using diff patches.
78
+ variant :apply_patch_call, -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall }
79
+
80
+ # The streamed output emitted by an apply patch tool call.
81
+ variant :apply_patch_call_output, -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput }
82
+
71
83
  # A list of tools available on an MCP server.
72
84
  variant :mcp_list_tools, -> { OpenAI::Responses::ResponseInputItem::McpListTools }
73
85
 
@@ -595,6 +607,388 @@ module OpenAI
595
607
  end
596
608
  end
597
609
 
610
+ class ShellCall < OpenAI::Internal::Type::BaseModel
611
+ # @!attribute action
612
+ # The shell commands and limits that describe how to run the tool call.
613
+ #
614
+ # @return [OpenAI::Models::Responses::ResponseInputItem::ShellCall::Action]
615
+ required :action, -> { OpenAI::Responses::ResponseInputItem::ShellCall::Action }
616
+
617
+ # @!attribute call_id
618
+ # The unique ID of the function shell tool call generated by the model.
619
+ #
620
+ # @return [String]
621
+ required :call_id, String
622
+
623
+ # @!attribute type
624
+ # The type of the item. Always `function_shell_call`.
625
+ #
626
+ # @return [Symbol, :shell_call]
627
+ required :type, const: :shell_call
628
+
629
+ # @!attribute id
630
+ # The unique ID of the function shell tool call. Populated when this item is
631
+ # returned via API.
632
+ #
633
+ # @return [String, nil]
634
+ optional :id, String, nil?: true
635
+
636
+ # @!attribute status
637
+ # The status of the shell call. One of `in_progress`, `completed`, or
638
+ # `incomplete`.
639
+ #
640
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ShellCall::Status, nil]
641
+ optional :status, enum: -> { OpenAI::Responses::ResponseInputItem::ShellCall::Status }, nil?: true
642
+
643
+ # @!method initialize(action:, call_id:, id: nil, status: nil, type: :shell_call)
644
+ # Some parameter documentations has been truncated, see
645
+ # {OpenAI::Models::Responses::ResponseInputItem::ShellCall} for more details.
646
+ #
647
+ # A tool representing a request to execute one or more shell commands.
648
+ #
649
+ # @param action [OpenAI::Models::Responses::ResponseInputItem::ShellCall::Action] The shell commands and limits that describe how to run the tool call.
650
+ #
651
+ # @param call_id [String] The unique ID of the function shell tool call generated by the model.
652
+ #
653
+ # @param id [String, nil] The unique ID of the function shell tool call. Populated when this item is retur
654
+ #
655
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ShellCall::Status, nil] The status of the shell call. One of `in_progress`, `completed`, or `incomplete`
656
+ #
657
+ # @param type [Symbol, :shell_call] The type of the item. Always `function_shell_call`.
658
+
659
+ # @see OpenAI::Models::Responses::ResponseInputItem::ShellCall#action
660
+ class Action < OpenAI::Internal::Type::BaseModel
661
+ # @!attribute commands
662
+ # Ordered shell commands for the execution environment to run.
663
+ #
664
+ # @return [Array<String>]
665
+ required :commands, OpenAI::Internal::Type::ArrayOf[String]
666
+
667
+ # @!attribute max_output_length
668
+ # Maximum number of UTF-8 characters to capture from combined stdout and stderr
669
+ # output.
670
+ #
671
+ # @return [Integer, nil]
672
+ optional :max_output_length, Integer, nil?: true
673
+
674
+ # @!attribute timeout_ms
675
+ # Maximum wall-clock time in milliseconds to allow the shell commands to run.
676
+ #
677
+ # @return [Integer, nil]
678
+ optional :timeout_ms, Integer, nil?: true
679
+
680
+ # @!method initialize(commands:, max_output_length: nil, timeout_ms: nil)
681
+ # Some parameter documentations has been truncated, see
682
+ # {OpenAI::Models::Responses::ResponseInputItem::ShellCall::Action} for more
683
+ # details.
684
+ #
685
+ # The shell commands and limits that describe how to run the tool call.
686
+ #
687
+ # @param commands [Array<String>] Ordered shell commands for the execution environment to run.
688
+ #
689
+ # @param max_output_length [Integer, nil] Maximum number of UTF-8 characters to capture from combined stdout and stderr ou
690
+ #
691
+ # @param timeout_ms [Integer, nil] Maximum wall-clock time in milliseconds to allow the shell commands to run.
692
+ end
693
+
694
+ # The status of the shell call. One of `in_progress`, `completed`, or
695
+ # `incomplete`.
696
+ #
697
+ # @see OpenAI::Models::Responses::ResponseInputItem::ShellCall#status
698
+ module Status
699
+ extend OpenAI::Internal::Type::Enum
700
+
701
+ IN_PROGRESS = :in_progress
702
+ COMPLETED = :completed
703
+ INCOMPLETE = :incomplete
704
+
705
+ # @!method self.values
706
+ # @return [Array<Symbol>]
707
+ end
708
+ end
709
+
710
+ class ShellCallOutput < OpenAI::Internal::Type::BaseModel
711
+ # @!attribute call_id
712
+ # The unique ID of the function shell tool call generated by the model.
713
+ #
714
+ # @return [String]
715
+ required :call_id, String
716
+
717
+ # @!attribute output
718
+ # Captured chunks of stdout and stderr output, along with their associated
719
+ # outcomes.
720
+ #
721
+ # @return [Array<OpenAI::Models::Responses::ResponseFunctionShellCallOutputContent>]
722
+ required :output,
723
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Responses::ResponseFunctionShellCallOutputContent] }
724
+
725
+ # @!attribute type
726
+ # The type of the item. Always `function_shell_call_output`.
727
+ #
728
+ # @return [Symbol, :shell_call_output]
729
+ required :type, const: :shell_call_output
730
+
731
+ # @!attribute id
732
+ # The unique ID of the function shell tool call output. Populated when this item
733
+ # is returned via API.
734
+ #
735
+ # @return [String, nil]
736
+ optional :id, String, nil?: true
737
+
738
+ # @!attribute max_output_length
739
+ # The maximum number of UTF-8 characters captured for this shell call's combined
740
+ # output.
741
+ #
742
+ # @return [Integer, nil]
743
+ optional :max_output_length, Integer, nil?: true
744
+
745
+ # @!method initialize(call_id:, output:, id: nil, max_output_length: nil, type: :shell_call_output)
746
+ # Some parameter documentations has been truncated, see
747
+ # {OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput} for more
748
+ # details.
749
+ #
750
+ # The streamed output items emitted by a function shell tool call.
751
+ #
752
+ # @param call_id [String] The unique ID of the function shell tool call generated by the model.
753
+ #
754
+ # @param output [Array<OpenAI::Models::Responses::ResponseFunctionShellCallOutputContent>] Captured chunks of stdout and stderr output, along with their associated outcome
755
+ #
756
+ # @param id [String, nil] The unique ID of the function shell tool call output. Populated when this item i
757
+ #
758
+ # @param max_output_length [Integer, nil] The maximum number of UTF-8 characters captured for this shell call's combined o
759
+ #
760
+ # @param type [Symbol, :shell_call_output] The type of the item. Always `function_shell_call_output`.
761
+ end
762
+
763
+ class ApplyPatchCall < OpenAI::Internal::Type::BaseModel
764
+ # @!attribute call_id
765
+ # The unique ID of the apply patch tool call generated by the model.
766
+ #
767
+ # @return [String]
768
+ required :call_id, String
769
+
770
+ # @!attribute operation
771
+ # The specific create, delete, or update instruction for the apply_patch tool
772
+ # call.
773
+ #
774
+ # @return [OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile]
775
+ required :operation, union: -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation }
776
+
777
+ # @!attribute status
778
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
779
+ #
780
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Status]
781
+ required :status, enum: -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Status }
782
+
783
+ # @!attribute type
784
+ # The type of the item. Always `apply_patch_call`.
785
+ #
786
+ # @return [Symbol, :apply_patch_call]
787
+ required :type, const: :apply_patch_call
788
+
789
+ # @!attribute id
790
+ # The unique ID of the apply patch tool call. Populated when this item is returned
791
+ # via API.
792
+ #
793
+ # @return [String, nil]
794
+ optional :id, String, nil?: true
795
+
796
+ # @!method initialize(call_id:, operation:, status:, id: nil, type: :apply_patch_call)
797
+ # Some parameter documentations has been truncated, see
798
+ # {OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall} for more details.
799
+ #
800
+ # A tool call representing a request to create, delete, or update files using diff
801
+ # patches.
802
+ #
803
+ # @param call_id [String] The unique ID of the apply patch tool call generated by the model.
804
+ #
805
+ # @param operation [OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile] The specific create, delete, or update instruction for the apply_patch tool call
806
+ #
807
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Status] The status of the apply patch tool call. One of `in_progress` or `completed`.
808
+ #
809
+ # @param id [String, nil] The unique ID of the apply patch tool call. Populated when this item is returned
810
+ #
811
+ # @param type [Symbol, :apply_patch_call] The type of the item. Always `apply_patch_call`.
812
+
813
+ # The specific create, delete, or update instruction for the apply_patch tool
814
+ # call.
815
+ #
816
+ # @see OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall#operation
817
+ module Operation
818
+ extend OpenAI::Internal::Type::Union
819
+
820
+ discriminator :type
821
+
822
+ # Instruction for creating a new file via the apply_patch tool.
823
+ variant :create_file, -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile }
824
+
825
+ # Instruction for deleting an existing file via the apply_patch tool.
826
+ variant :delete_file, -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile }
827
+
828
+ # Instruction for updating an existing file via the apply_patch tool.
829
+ variant :update_file, -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile }
830
+
831
+ class CreateFile < OpenAI::Internal::Type::BaseModel
832
+ # @!attribute diff
833
+ # Unified diff content to apply when creating the file.
834
+ #
835
+ # @return [String]
836
+ required :diff, String
837
+
838
+ # @!attribute path
839
+ # Path of the file to create relative to the workspace root.
840
+ #
841
+ # @return [String]
842
+ required :path, String
843
+
844
+ # @!attribute type
845
+ # The operation type. Always `create_file`.
846
+ #
847
+ # @return [Symbol, :create_file]
848
+ required :type, const: :create_file
849
+
850
+ # @!method initialize(diff:, path:, type: :create_file)
851
+ # Instruction for creating a new file via the apply_patch tool.
852
+ #
853
+ # @param diff [String] Unified diff content to apply when creating the file.
854
+ #
855
+ # @param path [String] Path of the file to create relative to the workspace root.
856
+ #
857
+ # @param type [Symbol, :create_file] The operation type. Always `create_file`.
858
+ end
859
+
860
+ class DeleteFile < OpenAI::Internal::Type::BaseModel
861
+ # @!attribute path
862
+ # Path of the file to delete relative to the workspace root.
863
+ #
864
+ # @return [String]
865
+ required :path, String
866
+
867
+ # @!attribute type
868
+ # The operation type. Always `delete_file`.
869
+ #
870
+ # @return [Symbol, :delete_file]
871
+ required :type, const: :delete_file
872
+
873
+ # @!method initialize(path:, type: :delete_file)
874
+ # Instruction for deleting an existing file via the apply_patch tool.
875
+ #
876
+ # @param path [String] Path of the file to delete relative to the workspace root.
877
+ #
878
+ # @param type [Symbol, :delete_file] The operation type. Always `delete_file`.
879
+ end
880
+
881
+ class UpdateFile < OpenAI::Internal::Type::BaseModel
882
+ # @!attribute diff
883
+ # Unified diff content to apply to the existing file.
884
+ #
885
+ # @return [String]
886
+ required :diff, String
887
+
888
+ # @!attribute path
889
+ # Path of the file to update relative to the workspace root.
890
+ #
891
+ # @return [String]
892
+ required :path, String
893
+
894
+ # @!attribute type
895
+ # The operation type. Always `update_file`.
896
+ #
897
+ # @return [Symbol, :update_file]
898
+ required :type, const: :update_file
899
+
900
+ # @!method initialize(diff:, path:, type: :update_file)
901
+ # Instruction for updating an existing file via the apply_patch tool.
902
+ #
903
+ # @param diff [String] Unified diff content to apply to the existing file.
904
+ #
905
+ # @param path [String] Path of the file to update relative to the workspace root.
906
+ #
907
+ # @param type [Symbol, :update_file] The operation type. Always `update_file`.
908
+ end
909
+
910
+ # @!method self.variants
911
+ # @return [Array(OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::CreateFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::DeleteFile, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall::Operation::UpdateFile)]
912
+ end
913
+
914
+ # The status of the apply patch tool call. One of `in_progress` or `completed`.
915
+ #
916
+ # @see OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall#status
917
+ module Status
918
+ extend OpenAI::Internal::Type::Enum
919
+
920
+ IN_PROGRESS = :in_progress
921
+ COMPLETED = :completed
922
+
923
+ # @!method self.values
924
+ # @return [Array<Symbol>]
925
+ end
926
+ end
927
+
928
+ class ApplyPatchCallOutput < OpenAI::Internal::Type::BaseModel
929
+ # @!attribute call_id
930
+ # The unique ID of the apply patch tool call generated by the model.
931
+ #
932
+ # @return [String]
933
+ required :call_id, String
934
+
935
+ # @!attribute status
936
+ # The status of the apply patch tool call output. One of `completed` or `failed`.
937
+ #
938
+ # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput::Status]
939
+ required :status, enum: -> { OpenAI::Responses::ResponseInputItem::ApplyPatchCallOutput::Status }
940
+
941
+ # @!attribute type
942
+ # The type of the item. Always `apply_patch_call_output`.
943
+ #
944
+ # @return [Symbol, :apply_patch_call_output]
945
+ required :type, const: :apply_patch_call_output
946
+
947
+ # @!attribute id
948
+ # The unique ID of the apply patch tool call output. Populated when this item is
949
+ # returned via API.
950
+ #
951
+ # @return [String, nil]
952
+ optional :id, String, nil?: true
953
+
954
+ # @!attribute output
955
+ # Optional human-readable log text from the apply patch tool (e.g., patch results
956
+ # or errors).
957
+ #
958
+ # @return [String, nil]
959
+ optional :output, String
960
+
961
+ # @!method initialize(call_id:, status:, id: nil, output: nil, type: :apply_patch_call_output)
962
+ # Some parameter documentations has been truncated, see
963
+ # {OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput} for more
964
+ # details.
965
+ #
966
+ # The streamed output emitted by an apply patch tool call.
967
+ #
968
+ # @param call_id [String] The unique ID of the apply patch tool call generated by the model.
969
+ #
970
+ # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput::Status] The status of the apply patch tool call output. One of `completed` or `failed`.
971
+ #
972
+ # @param id [String, nil] The unique ID of the apply patch tool call output. Populated when this item is r
973
+ #
974
+ # @param output [String] Optional human-readable log text from the apply patch tool (e.g., patch results
975
+ #
976
+ # @param type [Symbol, :apply_patch_call_output] The type of the item. Always `apply_patch_call_output`.
977
+
978
+ # The status of the apply patch tool call output. One of `completed` or `failed`.
979
+ #
980
+ # @see OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput#status
981
+ module Status
982
+ extend OpenAI::Internal::Type::Enum
983
+
984
+ COMPLETED = :completed
985
+ FAILED = :failed
986
+
987
+ # @!method self.values
988
+ # @return [Array<Symbol>]
989
+ end
990
+ end
991
+
598
992
  class McpListTools < OpenAI::Internal::Type::BaseModel
599
993
  # @!attribute id
600
994
  # The unique ID of the list.
@@ -917,7 +1311,7 @@ module OpenAI
917
1311
  end
918
1312
 
919
1313
  # @!method self.variants
920
- # @return [Array(OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Responses::ResponseInputItem::Message, OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, OpenAI::Models::Responses::ResponseReasoningItem, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::McpListTools, OpenAI::Models::Responses::ResponseInputItem::McpApprovalRequest, OpenAI::Models::Responses::ResponseInputItem::McpApprovalResponse, OpenAI::Models::Responses::ResponseInputItem::McpCall, OpenAI::Models::Responses::ResponseCustomToolCallOutput, OpenAI::Models::Responses::ResponseCustomToolCall, OpenAI::Models::Responses::ResponseInputItem::ItemReference)]
1314
+ # @return [Array(OpenAI::Models::Responses::EasyInputMessage, OpenAI::Models::Responses::ResponseInputItem::Message, OpenAI::Models::Responses::ResponseOutputMessage, OpenAI::Models::Responses::ResponseFileSearchToolCall, OpenAI::Models::Responses::ResponseComputerToolCall, OpenAI::Models::Responses::ResponseInputItem::ComputerCallOutput, OpenAI::Models::Responses::ResponseFunctionWebSearch, OpenAI::Models::Responses::ResponseFunctionToolCall, OpenAI::Models::Responses::ResponseInputItem::FunctionCallOutput, OpenAI::Models::Responses::ResponseReasoningItem, OpenAI::Models::Responses::ResponseInputItem::ImageGenerationCall, OpenAI::Models::Responses::ResponseCodeInterpreterToolCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCall, OpenAI::Models::Responses::ResponseInputItem::LocalShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ShellCall, OpenAI::Models::Responses::ResponseInputItem::ShellCallOutput, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCall, OpenAI::Models::Responses::ResponseInputItem::ApplyPatchCallOutput, OpenAI::Models::Responses::ResponseInputItem::McpListTools, OpenAI::Models::Responses::ResponseInputItem::McpApprovalRequest, OpenAI::Models::Responses::ResponseInputItem::McpApprovalResponse, OpenAI::Models::Responses::ResponseInputItem::McpCall, OpenAI::Models::Responses::ResponseCustomToolCallOutput, OpenAI::Models::Responses::ResponseCustomToolCall, OpenAI::Models::Responses::ResponseInputItem::ItemReference)]
921
1315
  end
922
1316
  end
923
1317
  end