openai 0.9.0 → 0.11.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 +40 -0
- data/README.md +79 -1
- data/lib/openai/client.rb +11 -0
- data/lib/openai/errors.rb +25 -0
- data/lib/openai/internal/type/array_of.rb +6 -1
- data/lib/openai/internal/type/base_model.rb +76 -24
- data/lib/openai/internal/type/boolean.rb +7 -1
- data/lib/openai/internal/type/converter.rb +42 -34
- data/lib/openai/internal/type/enum.rb +10 -2
- data/lib/openai/internal/type/file_input.rb +6 -1
- data/lib/openai/internal/type/hash_of.rb +6 -1
- data/lib/openai/internal/type/union.rb +12 -7
- data/lib/openai/internal/type/unknown.rb +7 -1
- data/lib/openai/models/all_models.rb +4 -0
- data/lib/openai/models/audio/speech_create_params.rb +23 -2
- data/lib/openai/models/audio/transcription.rb +118 -1
- data/lib/openai/models/audio/transcription_text_done_event.rb +80 -1
- data/lib/openai/models/audio/transcription_verbose.rb +31 -1
- data/lib/openai/models/chat/chat_completion.rb +32 -31
- data/lib/openai/models/chat/chat_completion_chunk.rb +30 -29
- data/lib/openai/models/chat/completion_create_params.rb +34 -31
- data/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb +60 -25
- data/lib/openai/models/images_response.rb +92 -1
- data/lib/openai/models/responses/response.rb +59 -35
- data/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb +17 -8
- data/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb +14 -10
- data/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_tool_call.rb +49 -78
- data/lib/openai/models/responses/response_create_params.rb +92 -67
- data/lib/openai/models/responses/response_function_web_search.rb +115 -1
- data/lib/openai/models/responses/response_includable.rb +8 -6
- data/lib/openai/models/responses/response_output_text.rb +18 -2
- data/lib/openai/models/responses/response_stream_event.rb +2 -2
- data/lib/openai/models/responses/tool_choice_mcp.rb +40 -0
- data/lib/openai/models/responses/tool_choice_types.rb +0 -3
- data/lib/openai/models/responses_model.rb +4 -0
- data/lib/openai/models/webhooks/batch_cancelled_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_completed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_expired_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/batch_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_canceled_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/eval_run_succeeded_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_cancelled_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_completed_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/response_failed_webhook_event.rb +84 -0
- data/lib/openai/models/webhooks/response_incomplete_webhook_event.rb +85 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +59 -0
- data/lib/openai/models/webhooks/webhook_unwrap_params.rb +16 -0
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/audio/speech.rb +3 -1
- data/lib/openai/resources/chat/completions.rb +10 -2
- data/lib/openai/resources/fine_tuning/checkpoints/permissions.rb +1 -2
- data/lib/openai/resources/responses.rb +24 -16
- data/lib/openai/resources/webhooks.rb +124 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +18 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/errors.rbi +16 -0
- data/rbi/openai/internal/type/boolean.rbi +2 -0
- data/rbi/openai/internal/type/converter.rbi +15 -15
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/internal/type/unknown.rbi +2 -0
- data/rbi/openai/models/all_models.rbi +20 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +59 -2
- data/rbi/openai/models/audio/transcription.rbi +213 -3
- data/rbi/openai/models/audio/transcription_text_done_event.rbi +146 -1
- data/rbi/openai/models/audio/transcription_verbose.rbi +47 -0
- data/rbi/openai/models/chat/chat_completion.rbi +47 -42
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +47 -42
- data/rbi/openai/models/chat/completion_create_params.rbi +51 -42
- data/rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi +95 -26
- data/rbi/openai/models/images_response.rbi +146 -0
- data/rbi/openai/models/responses/response.rbi +75 -44
- data/rbi/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi +17 -7
- data/rbi/openai/models/responses/response_code_interpreter_call_code_done_event.rbi +13 -5
- data/rbi/openai/models/responses/response_code_interpreter_call_completed_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_tool_call.rbi +83 -125
- data/rbi/openai/models/responses/response_create_params.rbi +174 -115
- data/rbi/openai/models/responses/response_function_web_search.rbi +163 -0
- data/rbi/openai/models/responses/response_includable.rbi +17 -11
- data/rbi/openai/models/responses/response_output_text.rbi +26 -4
- data/rbi/openai/models/responses/tool_choice_mcp.rbi +53 -0
- data/rbi/openai/models/responses/tool_choice_types.rbi +0 -5
- data/rbi/openai/models/responses_model.rbi +20 -0
- data/rbi/openai/models/webhooks/batch_cancelled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/batch_completed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/batch_expired_webhook_event.rbi +150 -0
- data/rbi/openai/models/webhooks/batch_failed_webhook_event.rbi +149 -0
- data/rbi/openai/models/webhooks/eval_run_canceled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/eval_run_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/eval_run_succeeded_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rbi +158 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rbi +156 -0
- data/rbi/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rbi +158 -0
- data/rbi/openai/models/webhooks/response_cancelled_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_completed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_failed_webhook_event.rbi +154 -0
- data/rbi/openai/models/webhooks/response_incomplete_webhook_event.rbi +155 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +40 -0
- data/rbi/openai/models/webhooks/webhook_unwrap_params.rbi +32 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/audio/speech.rbi +6 -1
- data/rbi/openai/resources/chat/completions.rbi +34 -30
- data/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi +1 -3
- data/rbi/openai/resources/responses.rbi +108 -84
- data/rbi/openai/resources/webhooks.rbi +68 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/errors.rbs +9 -0
- data/sig/openai/internal/type/converter.rbs +7 -1
- data/sig/openai/models/all_models.rbs +8 -0
- data/sig/openai/models/audio/speech_create_params.rbs +21 -1
- data/sig/openai/models/audio/transcription.rbs +95 -3
- data/sig/openai/models/audio/transcription_text_done_event.rbs +72 -2
- data/sig/openai/models/audio/transcription_verbose.rbs +21 -0
- data/sig/openai/models/chat/chat_completion.rbs +2 -1
- data/sig/openai/models/chat/chat_completion_chunk.rbs +2 -1
- data/sig/openai/models/chat/completion_create_params.rbs +2 -1
- data/sig/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbs +53 -16
- data/sig/openai/models/images_response.rbs +83 -0
- data/sig/openai/models/responses/response.rbs +13 -1
- data/sig/openai/models/responses/response_code_interpreter_call_code_delta_event.rbs +5 -0
- data/sig/openai/models/responses/response_code_interpreter_call_code_done_event.rbs +5 -0
- data/sig/openai/models/responses/response_code_interpreter_call_completed_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_call_in_progress_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_call_interpreting_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_tool_call.rbs +31 -52
- data/sig/openai/models/responses/response_create_params.rbs +31 -11
- data/sig/openai/models/responses/response_function_web_search.rbs +54 -0
- data/sig/openai/models/responses/response_includable.rbs +7 -5
- data/sig/openai/models/responses/response_output_text.rbs +15 -1
- data/sig/openai/models/responses/tool_choice_mcp.rbs +23 -0
- data/sig/openai/models/responses/tool_choice_types.rbs +0 -2
- data/sig/openai/models/responses_model.rbs +8 -0
- data/sig/openai/models/webhooks/batch_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_completed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_expired_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/batch_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_canceled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/eval_run_succeeded_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/fine_tuning_job_succeeded_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_cancelled_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_completed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_failed_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/response_incomplete_webhook_event.rbs +66 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +27 -0
- data/sig/openai/models/webhooks/webhook_unwrap_params.rbs +17 -0
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/audio/speech.rbs +1 -0
- data/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs +1 -1
- data/sig/openai/resources/responses.rbs +8 -4
- data/sig/openai/resources/webhooks.rbs +33 -0
- metadata +56 -2
@@ -16,6 +16,19 @@ module OpenAI
|
|
16
16
|
sig { returns(String) }
|
17
17
|
attr_accessor :id
|
18
18
|
|
19
|
+
# An object describing the specific action taken in this web search call. Includes
|
20
|
+
# details on how the model used the web (search, open_page, find).
|
21
|
+
sig do
|
22
|
+
returns(
|
23
|
+
T.any(
|
24
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search,
|
25
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage,
|
26
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Find
|
27
|
+
)
|
28
|
+
)
|
29
|
+
end
|
30
|
+
attr_accessor :action
|
31
|
+
|
19
32
|
# The status of the web search tool call.
|
20
33
|
sig do
|
21
34
|
returns(
|
@@ -34,6 +47,12 @@ module OpenAI
|
|
34
47
|
sig do
|
35
48
|
params(
|
36
49
|
id: String,
|
50
|
+
action:
|
51
|
+
T.any(
|
52
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search::OrHash,
|
53
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage::OrHash,
|
54
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Find::OrHash
|
55
|
+
),
|
37
56
|
status:
|
38
57
|
OpenAI::Responses::ResponseFunctionWebSearch::Status::OrSymbol,
|
39
58
|
type: Symbol
|
@@ -42,6 +61,9 @@ module OpenAI
|
|
42
61
|
def self.new(
|
43
62
|
# The unique ID of the web search tool call.
|
44
63
|
id:,
|
64
|
+
# An object describing the specific action taken in this web search call. Includes
|
65
|
+
# details on how the model used the web (search, open_page, find).
|
66
|
+
action:,
|
45
67
|
# The status of the web search tool call.
|
46
68
|
status:,
|
47
69
|
# The type of the web search tool call. Always `web_search_call`.
|
@@ -53,6 +75,12 @@ module OpenAI
|
|
53
75
|
override.returns(
|
54
76
|
{
|
55
77
|
id: String,
|
78
|
+
action:
|
79
|
+
T.any(
|
80
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search,
|
81
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage,
|
82
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Find
|
83
|
+
),
|
56
84
|
status:
|
57
85
|
OpenAI::Responses::ResponseFunctionWebSearch::Status::OrSymbol,
|
58
86
|
type: Symbol
|
@@ -62,6 +90,141 @@ module OpenAI
|
|
62
90
|
def to_hash
|
63
91
|
end
|
64
92
|
|
93
|
+
# An object describing the specific action taken in this web search call. Includes
|
94
|
+
# details on how the model used the web (search, open_page, find).
|
95
|
+
module Action
|
96
|
+
extend OpenAI::Internal::Type::Union
|
97
|
+
|
98
|
+
Variants =
|
99
|
+
T.type_alias do
|
100
|
+
T.any(
|
101
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search,
|
102
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage,
|
103
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Find
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
class Search < OpenAI::Internal::Type::BaseModel
|
108
|
+
OrHash =
|
109
|
+
T.type_alias do
|
110
|
+
T.any(
|
111
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Search,
|
112
|
+
OpenAI::Internal::AnyHash
|
113
|
+
)
|
114
|
+
end
|
115
|
+
|
116
|
+
# The search query.
|
117
|
+
sig { returns(String) }
|
118
|
+
attr_accessor :query
|
119
|
+
|
120
|
+
# The action type.
|
121
|
+
sig { returns(Symbol) }
|
122
|
+
attr_accessor :type
|
123
|
+
|
124
|
+
# Action type "search" - Performs a web search query.
|
125
|
+
sig do
|
126
|
+
params(query: String, type: Symbol).returns(T.attached_class)
|
127
|
+
end
|
128
|
+
def self.new(
|
129
|
+
# The search query.
|
130
|
+
query:,
|
131
|
+
# The action type.
|
132
|
+
type: :search
|
133
|
+
)
|
134
|
+
end
|
135
|
+
|
136
|
+
sig { override.returns({ query: String, type: Symbol }) }
|
137
|
+
def to_hash
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
class OpenPage < OpenAI::Internal::Type::BaseModel
|
142
|
+
OrHash =
|
143
|
+
T.type_alias do
|
144
|
+
T.any(
|
145
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::OpenPage,
|
146
|
+
OpenAI::Internal::AnyHash
|
147
|
+
)
|
148
|
+
end
|
149
|
+
|
150
|
+
# The action type.
|
151
|
+
sig { returns(Symbol) }
|
152
|
+
attr_accessor :type
|
153
|
+
|
154
|
+
# The URL opened by the model.
|
155
|
+
sig { returns(String) }
|
156
|
+
attr_accessor :url
|
157
|
+
|
158
|
+
# Action type "open_page" - Opens a specific URL from search results.
|
159
|
+
sig { params(url: String, type: Symbol).returns(T.attached_class) }
|
160
|
+
def self.new(
|
161
|
+
# The URL opened by the model.
|
162
|
+
url:,
|
163
|
+
# The action type.
|
164
|
+
type: :open_page
|
165
|
+
)
|
166
|
+
end
|
167
|
+
|
168
|
+
sig { override.returns({ type: Symbol, url: String }) }
|
169
|
+
def to_hash
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
class Find < OpenAI::Internal::Type::BaseModel
|
174
|
+
OrHash =
|
175
|
+
T.type_alias do
|
176
|
+
T.any(
|
177
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Find,
|
178
|
+
OpenAI::Internal::AnyHash
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
# The pattern or text to search for within the page.
|
183
|
+
sig { returns(String) }
|
184
|
+
attr_accessor :pattern
|
185
|
+
|
186
|
+
# The action type.
|
187
|
+
sig { returns(Symbol) }
|
188
|
+
attr_accessor :type
|
189
|
+
|
190
|
+
# The URL of the page searched for the pattern.
|
191
|
+
sig { returns(String) }
|
192
|
+
attr_accessor :url
|
193
|
+
|
194
|
+
# Action type "find": Searches for a pattern within a loaded page.
|
195
|
+
sig do
|
196
|
+
params(pattern: String, url: String, type: Symbol).returns(
|
197
|
+
T.attached_class
|
198
|
+
)
|
199
|
+
end
|
200
|
+
def self.new(
|
201
|
+
# The pattern or text to search for within the page.
|
202
|
+
pattern:,
|
203
|
+
# The URL of the page searched for the pattern.
|
204
|
+
url:,
|
205
|
+
# The action type.
|
206
|
+
type: :find
|
207
|
+
)
|
208
|
+
end
|
209
|
+
|
210
|
+
sig do
|
211
|
+
override.returns({ pattern: String, type: Symbol, url: String })
|
212
|
+
end
|
213
|
+
def to_hash
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
sig do
|
218
|
+
override.returns(
|
219
|
+
T::Array[
|
220
|
+
OpenAI::Responses::ResponseFunctionWebSearch::Action::Variants
|
221
|
+
]
|
222
|
+
)
|
223
|
+
end
|
224
|
+
def self.variants
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
65
228
|
# The status of the web search tool call.
|
66
229
|
module Status
|
67
230
|
extend OpenAI::Internal::Type::Enum
|
@@ -6,18 +6,19 @@ module OpenAI
|
|
6
6
|
# Specify additional output data to include in the model response. Currently
|
7
7
|
# supported values are:
|
8
8
|
#
|
9
|
+
# - `code_interpreter_call.outputs`: Includes the outputs of python code execution
|
10
|
+
# in code interpreter tool call items.
|
11
|
+
# - `computer_call_output.output.image_url`: Include image urls from the computer
|
12
|
+
# call output.
|
9
13
|
# - `file_search_call.results`: Include the search results of the file search tool
|
10
14
|
# call.
|
11
15
|
# - `message.input_image.image_url`: Include image urls from the input message.
|
12
|
-
# - `
|
13
|
-
# call output.
|
16
|
+
# - `message.output_text.logprobs`: Include logprobs with assistant messages.
|
14
17
|
# - `reasoning.encrypted_content`: Includes an encrypted version of reasoning
|
15
18
|
# tokens in reasoning item outputs. This enables reasoning items to be used in
|
16
19
|
# multi-turn conversations when using the Responses API statelessly (like when
|
17
20
|
# the `store` parameter is set to `false`, or when an organization is enrolled
|
18
21
|
# in the zero data retention program).
|
19
|
-
# - `code_interpreter_call.outputs`: Includes the outputs of python code execution
|
20
|
-
# in code interpreter tool call items.
|
21
22
|
module ResponseIncludable
|
22
23
|
extend OpenAI::Internal::Type::Enum
|
23
24
|
|
@@ -25,6 +26,16 @@ module OpenAI
|
|
25
26
|
T.type_alias { T.all(Symbol, OpenAI::Responses::ResponseIncludable) }
|
26
27
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
27
28
|
|
29
|
+
CODE_INTERPRETER_CALL_OUTPUTS =
|
30
|
+
T.let(
|
31
|
+
:"code_interpreter_call.outputs",
|
32
|
+
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
33
|
+
)
|
34
|
+
COMPUTER_CALL_OUTPUT_OUTPUT_IMAGE_URL =
|
35
|
+
T.let(
|
36
|
+
:"computer_call_output.output.image_url",
|
37
|
+
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
38
|
+
)
|
28
39
|
FILE_SEARCH_CALL_RESULTS =
|
29
40
|
T.let(
|
30
41
|
:"file_search_call.results",
|
@@ -35,9 +46,9 @@ module OpenAI
|
|
35
46
|
:"message.input_image.image_url",
|
36
47
|
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
37
48
|
)
|
38
|
-
|
49
|
+
MESSAGE_OUTPUT_TEXT_LOGPROBS =
|
39
50
|
T.let(
|
40
|
-
:"
|
51
|
+
:"message.output_text.logprobs",
|
41
52
|
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
42
53
|
)
|
43
54
|
REASONING_ENCRYPTED_CONTENT =
|
@@ -45,11 +56,6 @@ module OpenAI
|
|
45
56
|
:"reasoning.encrypted_content",
|
46
57
|
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
47
58
|
)
|
48
|
-
CODE_INTERPRETER_CALL_OUTPUTS =
|
49
|
-
T.let(
|
50
|
-
:"code_interpreter_call.outputs",
|
51
|
-
OpenAI::Responses::ResponseIncludable::TaggedSymbol
|
52
|
-
)
|
53
59
|
|
54
60
|
sig do
|
55
61
|
override.returns(
|
@@ -131,6 +131,10 @@ module OpenAI
|
|
131
131
|
sig { returns(String) }
|
132
132
|
attr_accessor :file_id
|
133
133
|
|
134
|
+
# The filename of the file cited.
|
135
|
+
sig { returns(String) }
|
136
|
+
attr_accessor :filename
|
137
|
+
|
134
138
|
# The index of the file in the list of files.
|
135
139
|
sig { returns(Integer) }
|
136
140
|
attr_accessor :index
|
@@ -141,13 +145,18 @@ module OpenAI
|
|
141
145
|
|
142
146
|
# A citation to a file.
|
143
147
|
sig do
|
144
|
-
params(
|
145
|
-
|
146
|
-
|
148
|
+
params(
|
149
|
+
file_id: String,
|
150
|
+
filename: String,
|
151
|
+
index: Integer,
|
152
|
+
type: Symbol
|
153
|
+
).returns(T.attached_class)
|
147
154
|
end
|
148
155
|
def self.new(
|
149
156
|
# The ID of the file.
|
150
157
|
file_id:,
|
158
|
+
# The filename of the file cited.
|
159
|
+
filename:,
|
151
160
|
# The index of the file in the list of files.
|
152
161
|
index:,
|
153
162
|
# The type of the file citation. Always `file_citation`.
|
@@ -157,7 +166,12 @@ module OpenAI
|
|
157
166
|
|
158
167
|
sig do
|
159
168
|
override.returns(
|
160
|
-
{
|
169
|
+
{
|
170
|
+
file_id: String,
|
171
|
+
filename: String,
|
172
|
+
index: Integer,
|
173
|
+
type: Symbol
|
174
|
+
}
|
161
175
|
)
|
162
176
|
end
|
163
177
|
def to_hash
|
@@ -253,6 +267,10 @@ module OpenAI
|
|
253
267
|
sig { returns(String) }
|
254
268
|
attr_accessor :file_id
|
255
269
|
|
270
|
+
# The filename of the container file cited.
|
271
|
+
sig { returns(String) }
|
272
|
+
attr_accessor :filename
|
273
|
+
|
256
274
|
# The index of the first character of the container file citation in the message.
|
257
275
|
sig { returns(Integer) }
|
258
276
|
attr_accessor :start_index
|
@@ -267,6 +285,7 @@ module OpenAI
|
|
267
285
|
container_id: String,
|
268
286
|
end_index: Integer,
|
269
287
|
file_id: String,
|
288
|
+
filename: String,
|
270
289
|
start_index: Integer,
|
271
290
|
type: Symbol
|
272
291
|
).returns(T.attached_class)
|
@@ -278,6 +297,8 @@ module OpenAI
|
|
278
297
|
end_index:,
|
279
298
|
# The ID of the file.
|
280
299
|
file_id:,
|
300
|
+
# The filename of the container file cited.
|
301
|
+
filename:,
|
281
302
|
# The index of the first character of the container file citation in the message.
|
282
303
|
start_index:,
|
283
304
|
# The type of the container file citation. Always `container_file_citation`.
|
@@ -291,6 +312,7 @@ module OpenAI
|
|
291
312
|
container_id: String,
|
292
313
|
end_index: Integer,
|
293
314
|
file_id: String,
|
315
|
+
filename: String,
|
294
316
|
start_index: Integer,
|
295
317
|
type: Symbol
|
296
318
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Responses
|
6
|
+
class ToolChoiceMcp < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(OpenAI::Responses::ToolChoiceMcp, OpenAI::Internal::AnyHash)
|
10
|
+
end
|
11
|
+
|
12
|
+
# The label of the MCP server to use.
|
13
|
+
sig { returns(String) }
|
14
|
+
attr_accessor :server_label
|
15
|
+
|
16
|
+
# For MCP tools, the type is always `mcp`.
|
17
|
+
sig { returns(Symbol) }
|
18
|
+
attr_accessor :type
|
19
|
+
|
20
|
+
# The name of the tool to call on the server.
|
21
|
+
sig { returns(T.nilable(String)) }
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# Use this option to force the model to call a specific tool on a remote MCP
|
25
|
+
# server.
|
26
|
+
sig do
|
27
|
+
params(
|
28
|
+
server_label: String,
|
29
|
+
name: T.nilable(String),
|
30
|
+
type: Symbol
|
31
|
+
).returns(T.attached_class)
|
32
|
+
end
|
33
|
+
def self.new(
|
34
|
+
# The label of the MCP server to use.
|
35
|
+
server_label:,
|
36
|
+
# The name of the tool to call on the server.
|
37
|
+
name: nil,
|
38
|
+
# For MCP tools, the type is always `mcp`.
|
39
|
+
type: :mcp
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
sig do
|
44
|
+
override.returns(
|
45
|
+
{ server_label: String, type: Symbol, name: T.nilable(String) }
|
46
|
+
)
|
47
|
+
end
|
48
|
+
def to_hash
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -18,7 +18,6 @@ module OpenAI
|
|
18
18
|
# - `web_search_preview`
|
19
19
|
# - `computer_use_preview`
|
20
20
|
# - `code_interpreter`
|
21
|
-
# - `mcp`
|
22
21
|
# - `image_generation`
|
23
22
|
sig { returns(OpenAI::Responses::ToolChoiceTypes::Type::OrSymbol) }
|
24
23
|
attr_accessor :type
|
@@ -40,7 +39,6 @@ module OpenAI
|
|
40
39
|
# - `web_search_preview`
|
41
40
|
# - `computer_use_preview`
|
42
41
|
# - `code_interpreter`
|
43
|
-
# - `mcp`
|
44
42
|
# - `image_generation`
|
45
43
|
type:
|
46
44
|
)
|
@@ -63,7 +61,6 @@ module OpenAI
|
|
63
61
|
# - `web_search_preview`
|
64
62
|
# - `computer_use_preview`
|
65
63
|
# - `code_interpreter`
|
66
|
-
# - `mcp`
|
67
64
|
# - `image_generation`
|
68
65
|
module Type
|
69
66
|
extend OpenAI::Internal::Type::Enum
|
@@ -104,8 +101,6 @@ module OpenAI
|
|
104
101
|
:code_interpreter,
|
105
102
|
OpenAI::Responses::ToolChoiceTypes::Type::TaggedSymbol
|
106
103
|
)
|
107
|
-
MCP =
|
108
|
-
T.let(:mcp, OpenAI::Responses::ToolChoiceTypes::Type::TaggedSymbol)
|
109
104
|
|
110
105
|
sig do
|
111
106
|
override.returns(
|
@@ -43,6 +43,26 @@ module OpenAI
|
|
43
43
|
:"o3-pro-2025-06-10",
|
44
44
|
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
45
45
|
)
|
46
|
+
O3_DEEP_RESEARCH =
|
47
|
+
T.let(
|
48
|
+
:"o3-deep-research",
|
49
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
50
|
+
)
|
51
|
+
O3_DEEP_RESEARCH_2025_06_26 =
|
52
|
+
T.let(
|
53
|
+
:"o3-deep-research-2025-06-26",
|
54
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
55
|
+
)
|
56
|
+
O4_MINI_DEEP_RESEARCH =
|
57
|
+
T.let(
|
58
|
+
:"o4-mini-deep-research",
|
59
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
60
|
+
)
|
61
|
+
O4_MINI_DEEP_RESEARCH_2025_06_26 =
|
62
|
+
T.let(
|
63
|
+
:"o4-mini-deep-research-2025-06-26",
|
64
|
+
OpenAI::ResponsesModel::ResponsesOnlyModel::TaggedSymbol
|
65
|
+
)
|
46
66
|
COMPUTER_USE_PREVIEW =
|
47
67
|
T.let(
|
48
68
|
:"computer-use-preview",
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Webhooks
|
6
|
+
class BatchCancelledWebhookEvent < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The unique ID of the event.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The Unix timestamp (in seconds) of when the batch API request was cancelled.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# Event data payload.
|
24
|
+
sig { returns(OpenAI::Webhooks::BatchCancelledWebhookEvent::Data) }
|
25
|
+
attr_reader :data
|
26
|
+
|
27
|
+
sig do
|
28
|
+
params(
|
29
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data::OrHash
|
30
|
+
).void
|
31
|
+
end
|
32
|
+
attr_writer :data
|
33
|
+
|
34
|
+
# The type of the event. Always `batch.cancelled`.
|
35
|
+
sig { returns(Symbol) }
|
36
|
+
attr_accessor :type
|
37
|
+
|
38
|
+
# The object of the event. Always `event`.
|
39
|
+
sig do
|
40
|
+
returns(
|
41
|
+
T.nilable(
|
42
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
43
|
+
)
|
44
|
+
)
|
45
|
+
end
|
46
|
+
attr_reader :object
|
47
|
+
|
48
|
+
sig do
|
49
|
+
params(
|
50
|
+
object:
|
51
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::OrSymbol
|
52
|
+
).void
|
53
|
+
end
|
54
|
+
attr_writer :object
|
55
|
+
|
56
|
+
# Sent when a batch API request has been cancelled.
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
id: String,
|
60
|
+
created_at: Integer,
|
61
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data::OrHash,
|
62
|
+
object:
|
63
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::OrSymbol,
|
64
|
+
type: Symbol
|
65
|
+
).returns(T.attached_class)
|
66
|
+
end
|
67
|
+
def self.new(
|
68
|
+
# The unique ID of the event.
|
69
|
+
id:,
|
70
|
+
# The Unix timestamp (in seconds) of when the batch API request was cancelled.
|
71
|
+
created_at:,
|
72
|
+
# Event data payload.
|
73
|
+
data:,
|
74
|
+
# The object of the event. Always `event`.
|
75
|
+
object: nil,
|
76
|
+
# The type of the event. Always `batch.cancelled`.
|
77
|
+
type: :"batch.cancelled"
|
78
|
+
)
|
79
|
+
end
|
80
|
+
|
81
|
+
sig do
|
82
|
+
override.returns(
|
83
|
+
{
|
84
|
+
id: String,
|
85
|
+
created_at: Integer,
|
86
|
+
data: OpenAI::Webhooks::BatchCancelledWebhookEvent::Data,
|
87
|
+
type: Symbol,
|
88
|
+
object:
|
89
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
90
|
+
}
|
91
|
+
)
|
92
|
+
end
|
93
|
+
def to_hash
|
94
|
+
end
|
95
|
+
|
96
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
97
|
+
OrHash =
|
98
|
+
T.type_alias do
|
99
|
+
T.any(
|
100
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Data,
|
101
|
+
OpenAI::Internal::AnyHash
|
102
|
+
)
|
103
|
+
end
|
104
|
+
|
105
|
+
# The unique ID of the batch API request.
|
106
|
+
sig { returns(String) }
|
107
|
+
attr_accessor :id
|
108
|
+
|
109
|
+
# Event data payload.
|
110
|
+
sig { params(id: String).returns(T.attached_class) }
|
111
|
+
def self.new(
|
112
|
+
# The unique ID of the batch API request.
|
113
|
+
id:
|
114
|
+
)
|
115
|
+
end
|
116
|
+
|
117
|
+
sig { override.returns({ id: String }) }
|
118
|
+
def to_hash
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# The object of the event. Always `event`.
|
123
|
+
module Object
|
124
|
+
extend OpenAI::Internal::Type::Enum
|
125
|
+
|
126
|
+
TaggedSymbol =
|
127
|
+
T.type_alias do
|
128
|
+
T.all(
|
129
|
+
Symbol,
|
130
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object
|
131
|
+
)
|
132
|
+
end
|
133
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
134
|
+
|
135
|
+
EVENT =
|
136
|
+
T.let(
|
137
|
+
:event,
|
138
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
139
|
+
)
|
140
|
+
|
141
|
+
sig do
|
142
|
+
override.returns(
|
143
|
+
T::Array[
|
144
|
+
OpenAI::Webhooks::BatchCancelledWebhookEvent::Object::TaggedSymbol
|
145
|
+
]
|
146
|
+
)
|
147
|
+
end
|
148
|
+
def self.values
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|