openai 0.35.2 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +21 -15
- data/lib/openai/internal/type/enum.rb +6 -6
- data/lib/openai/models/batch_create_params.rb +9 -6
- data/lib/openai/models/beta/assistant_create_params.rb +9 -5
- data/lib/openai/models/beta/assistant_update_params.rb +9 -5
- data/lib/openai/models/beta/threads/run_create_params.rb +10 -6
- data/lib/openai/models/chat/completion_create_params.rb +37 -6
- data/lib/openai/models/chat_model.rb +5 -0
- data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
- data/lib/openai/models/conversations/conversation_item.rb +13 -1
- data/lib/openai/models/conversations/conversation_item_list.rb +2 -2
- data/lib/openai/models/conversations/item_create_params.rb +2 -2
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +9 -5
- data/lib/openai/models/evals/run_cancel_response.rb +20 -12
- data/lib/openai/models/evals/run_create_params.rb +20 -12
- data/lib/openai/models/evals/run_create_response.rb +20 -12
- data/lib/openai/models/evals/run_list_response.rb +20 -12
- data/lib/openai/models/evals/run_retrieve_response.rb +20 -12
- data/lib/openai/models/graders/score_model_grader.rb +9 -5
- data/lib/openai/models/reasoning.rb +10 -6
- data/lib/openai/models/reasoning_effort.rb +10 -5
- data/lib/openai/models/responses/apply_patch_tool.rb +20 -0
- data/lib/openai/models/responses/function_shell_tool.rb +20 -0
- data/lib/openai/models/responses/input_token_count_params.rb +14 -8
- data/lib/openai/models/responses/response.rb +46 -11
- data/lib/openai/models/responses/response_apply_patch_tool_call.rb +179 -0
- data/lib/openai/models/responses/response_apply_patch_tool_call_output.rb +77 -0
- data/lib/openai/models/responses/response_create_params.rb +42 -9
- data/lib/openai/models/responses/response_function_shell_call_output_content.rb +88 -0
- data/lib/openai/models/responses/response_function_shell_tool_call.rb +109 -0
- data/lib/openai/models/responses/response_function_shell_tool_call_output.rb +158 -0
- data/lib/openai/models/responses/response_input_item.rb +395 -1
- data/lib/openai/models/responses/response_item.rb +13 -1
- data/lib/openai/models/responses/response_item_list.rb +2 -2
- data/lib/openai/models/responses/response_output_item.rb +13 -1
- data/lib/openai/models/responses/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/responses/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/tool.rb +7 -1
- data/lib/openai/models/responses/tool_choice_apply_patch.rb +20 -0
- data/lib/openai/models/responses/tool_choice_shell.rb +20 -0
- data/lib/openai/resources/chat/completions.rb +6 -2
- data/lib/openai/resources/conversations/items.rb +3 -3
- data/lib/openai/resources/conversations.rb +1 -1
- data/lib/openai/resources/responses/input_items.rb +1 -1
- data/lib/openai/resources/responses/input_tokens.rb +3 -3
- data/lib/openai/resources/responses.rb +12 -8
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +9 -0
- data/rbi/openai/models/batch_create_params.rbi +17 -9
- data/rbi/openai/models/beta/assistant_create_params.rbi +18 -10
- data/rbi/openai/models/beta/assistant_update_params.rbi +18 -10
- data/rbi/openai/models/beta/threads/run_create_params.rbi +18 -10
- data/rbi/openai/models/chat/completion_create_params.rbi +82 -10
- data/rbi/openai/models/chat_model.rbi +7 -0
- data/rbi/openai/models/conversations/conversation_create_params.rbi +12 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +4 -0
- data/rbi/openai/models/conversations/conversation_item_list.rbi +4 -0
- data/rbi/openai/models/conversations/item_create_params.rbi +12 -0
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +18 -10
- data/rbi/openai/models/evals/run_cancel_response.rbi +40 -20
- data/rbi/openai/models/evals/run_create_params.rbi +44 -20
- data/rbi/openai/models/evals/run_create_response.rbi +40 -20
- data/rbi/openai/models/evals/run_list_response.rbi +40 -20
- data/rbi/openai/models/evals/run_retrieve_response.rbi +40 -20
- data/rbi/openai/models/graders/score_model_grader.rbi +18 -10
- data/rbi/openai/models/reasoning.rbi +18 -10
- data/rbi/openai/models/reasoning_effort.rbi +10 -5
- data/rbi/openai/models/responses/apply_patch_tool.rbi +30 -0
- data/rbi/openai/models/responses/function_shell_tool.rbi +33 -0
- data/rbi/openai/models/responses/input_token_count_params.rbi +18 -4
- data/rbi/openai/models/responses/response.rbi +73 -2
- data/rbi/openai/models/responses/response_apply_patch_tool_call.rbi +300 -0
- data/rbi/openai/models/responses/response_apply_patch_tool_call_output.rbi +129 -0
- data/rbi/openai/models/responses/response_create_params.rbi +87 -5
- data/rbi/openai/models/responses/response_function_shell_call_output_content.rbi +157 -0
- data/rbi/openai/models/responses/response_function_shell_tool_call.rbi +198 -0
- data/rbi/openai/models/responses/response_function_shell_tool_call_output.rbi +254 -0
- data/rbi/openai/models/responses/response_input_item.rbi +675 -0
- data/rbi/openai/models/responses/response_item.rbi +4 -0
- data/rbi/openai/models/responses/response_item_list.rbi +4 -0
- data/rbi/openai/models/responses/response_output_item.rbi +4 -0
- data/rbi/openai/models/responses/response_output_item_added_event.rbi +4 -0
- data/rbi/openai/models/responses/response_output_item_done_event.rbi +4 -0
- data/rbi/openai/models/responses/tool.rbi +2 -0
- data/rbi/openai/models/responses/tool_choice_apply_patch.rbi +33 -0
- data/rbi/openai/models/responses/tool_choice_shell.rbi +30 -0
- data/rbi/openai/resources/batches.rbi +4 -3
- data/rbi/openai/resources/beta/assistants.rbi +18 -10
- data/rbi/openai/resources/beta/threads/runs.rbi +18 -10
- data/rbi/openai/resources/chat/completions.rbi +38 -12
- data/rbi/openai/resources/conversations/items.rbi +4 -0
- data/rbi/openai/resources/conversations.rbi +4 -0
- data/rbi/openai/resources/responses/input_tokens.rbi +5 -1
- data/rbi/openai/resources/responses.rbi +28 -2
- data/sig/openai/models/batch_create_params.rbs +2 -0
- data/sig/openai/models/chat/completion_create_params.rbs +16 -0
- data/sig/openai/models/chat_model.rbs +11 -1
- data/sig/openai/models/conversations/conversation_item.rbs +4 -0
- data/sig/openai/models/reasoning_effort.rbs +2 -1
- data/sig/openai/models/responses/apply_patch_tool.rbs +15 -0
- data/sig/openai/models/responses/function_shell_tool.rbs +15 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +2 -0
- data/sig/openai/models/responses/response.rbs +18 -0
- data/sig/openai/models/responses/response_apply_patch_tool_call.rbs +123 -0
- data/sig/openai/models/responses/response_apply_patch_tool_call_output.rbs +60 -0
- data/sig/openai/models/responses/response_create_params.rbs +18 -0
- data/sig/openai/models/responses/response_function_shell_call_output_content.rbs +64 -0
- data/sig/openai/models/responses/response_function_shell_tool_call.rbs +88 -0
- data/sig/openai/models/responses/response_function_shell_tool_call_output.rbs +115 -0
- data/sig/openai/models/responses/response_input_item.rbs +276 -0
- data/sig/openai/models/responses/response_item.rbs +4 -0
- data/sig/openai/models/responses/response_output_item.rbs +4 -0
- data/sig/openai/models/responses/tool.rbs +2 -0
- data/sig/openai/models/responses/tool_choice_apply_patch.rbs +15 -0
- data/sig/openai/models/responses/tool_choice_shell.rbs +15 -0
- data/sig/openai/resources/chat/completions.rbs +2 -0
- data/sig/openai/resources/responses.rbs +2 -0
- metadata +29 -2
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module Responses
|
|
6
|
+
class ResponseFunctionShellToolCallOutput < OpenAI::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput,
|
|
11
|
+
OpenAI::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# The unique ID of the shell call output. Populated when this item is returned via
|
|
16
|
+
# API.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# The unique ID of the shell tool call generated by the model.
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :call_id
|
|
23
|
+
|
|
24
|
+
# The maximum length of the shell command output. This is generated by the model
|
|
25
|
+
# and should be passed back with the raw output.
|
|
26
|
+
sig { returns(T.nilable(Integer)) }
|
|
27
|
+
attr_accessor :max_output_length
|
|
28
|
+
|
|
29
|
+
# An array of shell call output contents
|
|
30
|
+
sig do
|
|
31
|
+
returns(
|
|
32
|
+
T::Array[
|
|
33
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output
|
|
34
|
+
]
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
attr_accessor :output
|
|
38
|
+
|
|
39
|
+
# The type of the shell call output. Always `shell_call_output`.
|
|
40
|
+
sig { returns(Symbol) }
|
|
41
|
+
attr_accessor :type
|
|
42
|
+
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :created_by
|
|
45
|
+
|
|
46
|
+
sig { params(created_by: String).void }
|
|
47
|
+
attr_writer :created_by
|
|
48
|
+
|
|
49
|
+
# The output of a shell tool call.
|
|
50
|
+
sig do
|
|
51
|
+
params(
|
|
52
|
+
id: String,
|
|
53
|
+
call_id: String,
|
|
54
|
+
max_output_length: T.nilable(Integer),
|
|
55
|
+
output:
|
|
56
|
+
T::Array[
|
|
57
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::OrHash
|
|
58
|
+
],
|
|
59
|
+
created_by: String,
|
|
60
|
+
type: Symbol
|
|
61
|
+
).returns(T.attached_class)
|
|
62
|
+
end
|
|
63
|
+
def self.new(
|
|
64
|
+
# The unique ID of the shell call output. Populated when this item is returned via
|
|
65
|
+
# API.
|
|
66
|
+
id:,
|
|
67
|
+
# The unique ID of the shell tool call generated by the model.
|
|
68
|
+
call_id:,
|
|
69
|
+
# The maximum length of the shell command output. This is generated by the model
|
|
70
|
+
# and should be passed back with the raw output.
|
|
71
|
+
max_output_length:,
|
|
72
|
+
# An array of shell call output contents
|
|
73
|
+
output:,
|
|
74
|
+
created_by: nil,
|
|
75
|
+
# The type of the shell call output. Always `shell_call_output`.
|
|
76
|
+
type: :shell_call_output
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
sig do
|
|
81
|
+
override.returns(
|
|
82
|
+
{
|
|
83
|
+
id: String,
|
|
84
|
+
call_id: String,
|
|
85
|
+
max_output_length: T.nilable(Integer),
|
|
86
|
+
output:
|
|
87
|
+
T::Array[
|
|
88
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output
|
|
89
|
+
],
|
|
90
|
+
type: Symbol,
|
|
91
|
+
created_by: String
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
end
|
|
95
|
+
def to_hash
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
class Output < OpenAI::Internal::Type::BaseModel
|
|
99
|
+
OrHash =
|
|
100
|
+
T.type_alias do
|
|
101
|
+
T.any(
|
|
102
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output,
|
|
103
|
+
OpenAI::Internal::AnyHash
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Represents either an exit outcome (with an exit code) or a timeout outcome for a
|
|
108
|
+
# shell call output chunk.
|
|
109
|
+
sig do
|
|
110
|
+
returns(
|
|
111
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Variants
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
attr_accessor :outcome
|
|
115
|
+
|
|
116
|
+
sig { returns(String) }
|
|
117
|
+
attr_accessor :stderr
|
|
118
|
+
|
|
119
|
+
sig { returns(String) }
|
|
120
|
+
attr_accessor :stdout
|
|
121
|
+
|
|
122
|
+
sig { returns(T.nilable(String)) }
|
|
123
|
+
attr_reader :created_by
|
|
124
|
+
|
|
125
|
+
sig { params(created_by: String).void }
|
|
126
|
+
attr_writer :created_by
|
|
127
|
+
|
|
128
|
+
# The content of a shell call output.
|
|
129
|
+
sig do
|
|
130
|
+
params(
|
|
131
|
+
outcome:
|
|
132
|
+
T.any(
|
|
133
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout::OrHash,
|
|
134
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit::OrHash
|
|
135
|
+
),
|
|
136
|
+
stderr: String,
|
|
137
|
+
stdout: String,
|
|
138
|
+
created_by: String
|
|
139
|
+
).returns(T.attached_class)
|
|
140
|
+
end
|
|
141
|
+
def self.new(
|
|
142
|
+
# Represents either an exit outcome (with an exit code) or a timeout outcome for a
|
|
143
|
+
# shell call output chunk.
|
|
144
|
+
outcome:,
|
|
145
|
+
stderr:,
|
|
146
|
+
stdout:,
|
|
147
|
+
created_by: nil
|
|
148
|
+
)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
sig do
|
|
152
|
+
override.returns(
|
|
153
|
+
{
|
|
154
|
+
outcome:
|
|
155
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Variants,
|
|
156
|
+
stderr: String,
|
|
157
|
+
stdout: String,
|
|
158
|
+
created_by: String
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
end
|
|
162
|
+
def to_hash
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Represents either an exit outcome (with an exit code) or a timeout outcome for a
|
|
166
|
+
# shell call output chunk.
|
|
167
|
+
module Outcome
|
|
168
|
+
extend OpenAI::Internal::Type::Union
|
|
169
|
+
|
|
170
|
+
Variants =
|
|
171
|
+
T.type_alias do
|
|
172
|
+
T.any(
|
|
173
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout,
|
|
174
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit
|
|
175
|
+
)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
class Timeout < OpenAI::Internal::Type::BaseModel
|
|
179
|
+
OrHash =
|
|
180
|
+
T.type_alias do
|
|
181
|
+
T.any(
|
|
182
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Timeout,
|
|
183
|
+
OpenAI::Internal::AnyHash
|
|
184
|
+
)
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# The outcome type. Always `timeout`.
|
|
188
|
+
sig { returns(Symbol) }
|
|
189
|
+
attr_accessor :type
|
|
190
|
+
|
|
191
|
+
# Indicates that the function shell call exceeded its configured time limit.
|
|
192
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
|
193
|
+
def self.new(
|
|
194
|
+
# The outcome type. Always `timeout`.
|
|
195
|
+
type: :timeout
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
sig { override.returns({ type: Symbol }) }
|
|
200
|
+
def to_hash
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
class Exit < OpenAI::Internal::Type::BaseModel
|
|
205
|
+
OrHash =
|
|
206
|
+
T.type_alias do
|
|
207
|
+
T.any(
|
|
208
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Exit,
|
|
209
|
+
OpenAI::Internal::AnyHash
|
|
210
|
+
)
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Exit code from the shell process.
|
|
214
|
+
sig { returns(Integer) }
|
|
215
|
+
attr_accessor :exit_code
|
|
216
|
+
|
|
217
|
+
# The outcome type. Always `exit`.
|
|
218
|
+
sig { returns(Symbol) }
|
|
219
|
+
attr_accessor :type
|
|
220
|
+
|
|
221
|
+
# Indicates that the shell commands finished and returned an exit code.
|
|
222
|
+
sig do
|
|
223
|
+
params(exit_code: Integer, type: Symbol).returns(
|
|
224
|
+
T.attached_class
|
|
225
|
+
)
|
|
226
|
+
end
|
|
227
|
+
def self.new(
|
|
228
|
+
# Exit code from the shell process.
|
|
229
|
+
exit_code:,
|
|
230
|
+
# The outcome type. Always `exit`.
|
|
231
|
+
type: :exit
|
|
232
|
+
)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
sig { override.returns({ exit_code: Integer, type: Symbol }) }
|
|
236
|
+
def to_hash
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
sig do
|
|
241
|
+
override.returns(
|
|
242
|
+
T::Array[
|
|
243
|
+
OpenAI::Responses::ResponseFunctionShellToolCallOutput::Output::Outcome::Variants
|
|
244
|
+
]
|
|
245
|
+
)
|
|
246
|
+
end
|
|
247
|
+
def self.variants
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
end
|