openai 0.100.0 → 0.101.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/client.rb +4 -0
  5. data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +1166 -3
  6. data/lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb +176 -0
  7. data/lib/openai/models/decision.rb +313 -0
  8. data/lib/openai/models/decision_create_params.rb +233 -0
  9. data/lib/openai/models/decision_input_image.rb +53 -0
  10. data/lib/openai/models/decision_input_message.rb +60 -0
  11. data/lib/openai/models/decision_input_part.rb +20 -0
  12. data/lib/openai/models/decision_input_text.rb +21 -0
  13. data/lib/openai/models/responses/response_tool_search_output_item_param.rb +1166 -3
  14. data/lib/openai/models/responses/tool_search_output_namespace_tool.rb +174 -0
  15. data/lib/openai/models.rb +12 -0
  16. data/lib/openai/resources/decisions.rb +59 -0
  17. data/lib/openai/version.rb +1 -1
  18. data/lib/openai.rb +9 -0
  19. data/rbi/openai/client.rbi +3 -0
  20. data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +1893 -18
  21. data/rbi/openai/models/beta/beta_tool_search_output_namespace_tool.rbi +272 -0
  22. data/rbi/openai/models/decision.rbi +586 -0
  23. data/rbi/openai/models/decision_create_params.rbi +435 -0
  24. data/rbi/openai/models/decision_input_image.rbi +81 -0
  25. data/rbi/openai/models/decision_input_message.rbi +96 -0
  26. data/rbi/openai/models/decision_input_part.rbi +24 -0
  27. data/rbi/openai/models/decision_input_text.rbi +49 -0
  28. data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +1901 -18
  29. data/rbi/openai/models/responses/tool_search_output_namespace_tool.rbi +272 -0
  30. data/rbi/openai/models.rbi +12 -0
  31. data/rbi/openai/resources/decisions.rbi +57 -0
  32. data/sig/openai/client.rbs +2 -0
  33. data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +993 -4
  34. data/sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs +162 -0
  35. data/sig/openai/models/decision.rbs +296 -0
  36. data/sig/openai/models/decision_create_params.rbs +227 -0
  37. data/sig/openai/models/decision_input_image.rbs +51 -0
  38. data/sig/openai/models/decision_input_message.rbs +57 -0
  39. data/sig/openai/models/decision_input_part.rbs +12 -0
  40. data/sig/openai/models/decision_input_text.rbs +15 -0
  41. data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +993 -4
  42. data/sig/openai/models/responses/tool_search_output_namespace_tool.rbs +160 -0
  43. data/sig/openai/models.rbs +12 -0
  44. data/sig/openai/resources/decisions.rbs +15 -0
  45. metadata +28 -1
@@ -0,0 +1,435 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ class DecisionCreateParams < OpenAI::Internal::Type::BaseModel
7
+
8
+ extend OpenAI::Internal::Type::RequestParameters::Converter
9
+ include OpenAI::Internal::Type::RequestParameters
10
+
11
+ OrHash = T.type_alias do
12
+ T.any(
13
+ OpenAI::DecisionCreateParams,
14
+ OpenAI::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Shared evidence, as a string or an array of user messages containing text and
19
+ # inline images. Non-user roles, function calls, function-call outputs, files,
20
+ # audio, and item references are not supported. At most 128 image parts are
21
+ # allowed across all messages in one request.
22
+ sig { returns(OpenAI::DecisionCreateParams::Input::Variants) }
23
+ attr_accessor :input
24
+
25
+ sig { returns(String) }
26
+ attr_accessor :model
27
+
28
+ sig {
29
+ returns(
30
+ T::Array[
31
+ T.any(
32
+ OpenAI::DecisionCreateParams::Question::Predicate,
33
+ OpenAI::DecisionCreateParams::Question::Choice,
34
+ OpenAI::DecisionCreateParams::Question::Score
35
+ )
36
+ ]
37
+ )
38
+ }
39
+ attr_accessor :questions
40
+
41
+ # Opaque caller-provided end-user identifier, scoped by the verified org. Match
42
+ # Responses' limit; this is never the authenticated user identity.
43
+ sig { returns(T.nilable(String)) }
44
+ attr_accessor :safety_identifier
45
+
46
+ sig do
47
+ params(
48
+
49
+ input: OpenAI::DecisionCreateParams::Input::Variants,
50
+
51
+ model: String,
52
+
53
+ questions: T::Array[
54
+ T.any(
55
+ OpenAI::DecisionCreateParams::Question::Predicate::OrHash,
56
+ OpenAI::DecisionCreateParams::Question::Choice::OrHash,
57
+ OpenAI::DecisionCreateParams::Question::Score::OrHash
58
+ )
59
+ ],
60
+
61
+ safety_identifier: T.nilable(String),
62
+
63
+ request_options: OpenAI::RequestOptions::OrHash
64
+ )
65
+ .returns(T.attached_class)
66
+ end
67
+ def self.new(
68
+
69
+ # Shared evidence, as a string or an array of user messages containing text and
70
+ # inline images. Non-user roles, function calls, function-call outputs, files,
71
+ # audio, and item references are not supported. At most 128 image parts are
72
+ # allowed across all messages in one request.
73
+ input:,
74
+
75
+ model:,
76
+
77
+ questions:,
78
+
79
+ # Opaque caller-provided end-user identifier, scoped by the verified org. Match
80
+ # Responses' limit; this is never the authenticated user identity.
81
+ safety_identifier: nil,
82
+
83
+ request_options: {}
84
+ )
85
+ end
86
+
87
+ sig do
88
+ override.returns(
89
+ {
90
+ input: OpenAI::DecisionCreateParams::Input::Variants,
91
+ model: String,
92
+ questions: T::Array[
93
+ T.any(
94
+ OpenAI::DecisionCreateParams::Question::Predicate,
95
+ OpenAI::DecisionCreateParams::Question::Choice,
96
+ OpenAI::DecisionCreateParams::Question::Score
97
+ )
98
+ ],
99
+ safety_identifier: T.nilable(String),
100
+ request_options: OpenAI::RequestOptions
101
+ }
102
+ )
103
+ end
104
+ def to_hash
105
+ end
106
+
107
+ # Shared evidence, as a string or an array of user messages containing text and
108
+ # inline images. Non-user roles, function calls, function-call outputs, files,
109
+ # audio, and item references are not supported. At most 128 image parts are
110
+ # allowed across all messages in one request.
111
+ module Input
112
+ extend OpenAI::Internal::Type::Union
113
+
114
+ Variants = T.type_alias { T.any(String, T::Array[OpenAI::DecisionInputMessage]) }
115
+
116
+ sig { override.returns(T::Array[OpenAI::DecisionCreateParams::Input::Variants]) }
117
+ def self.variants
118
+ end
119
+
120
+ DecisionInputMessageArray = T.let(
121
+ OpenAI::Internal::Type::ArrayOf[OpenAI::DecisionInputMessage],
122
+ OpenAI::Internal::Type::Converter
123
+ )
124
+
125
+ end
126
+
127
+ # A question about the request's input, with an optional correlation name.
128
+ module Question
129
+ extend OpenAI::Internal::Type::Union
130
+
131
+ Variants = T.type_alias {
132
+ T.any(
133
+ OpenAI::DecisionCreateParams::Question::Predicate,
134
+ OpenAI::DecisionCreateParams::Question::Choice,
135
+ OpenAI::DecisionCreateParams::Question::Score
136
+ )
137
+ }
138
+
139
+ class Predicate < OpenAI::Internal::Type::BaseModel
140
+ OrHash = T.type_alias do
141
+ T.any(
142
+ OpenAI::DecisionCreateParams::Question::Predicate,
143
+ OpenAI::Internal::AnyHash
144
+ )
145
+ end
146
+
147
+ sig { returns(String) }
148
+ attr_accessor :instructions
149
+
150
+ # The type of the object. Always `predicate`.
151
+ sig { returns(Symbol) }
152
+ attr_accessor :type
153
+
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :name
156
+
157
+ sig { params(name: String).void }
158
+ attr_writer :name
159
+
160
+ sig do
161
+ params(
162
+
163
+ instructions: String,
164
+
165
+ name: String,
166
+
167
+ type: Symbol
168
+ )
169
+ .returns(T.attached_class)
170
+ end
171
+ def self.new(
172
+
173
+ instructions:,
174
+
175
+ name: nil,
176
+
177
+ # The type of the object. Always `predicate`.
178
+
179
+ type: :predicate
180
+ )
181
+ end
182
+
183
+ sig do
184
+ override.returns(
185
+ {instructions: String, type: Symbol, name: String}
186
+ )
187
+ end
188
+ def to_hash
189
+ end
190
+
191
+ end
192
+
193
+ class Choice < OpenAI::Internal::Type::BaseModel
194
+ OrHash = T.type_alias do
195
+ T.any(
196
+ OpenAI::DecisionCreateParams::Question::Choice,
197
+ OpenAI::Internal::AnyHash
198
+ )
199
+ end
200
+
201
+ sig { returns(T::Array[OpenAI::DecisionCreateParams::Question::Choice::Choice]) }
202
+ attr_accessor :choices
203
+
204
+ sig { returns(String) }
205
+ attr_accessor :instructions
206
+
207
+ # The type of the object. Always `choice`.
208
+ sig { returns(Symbol) }
209
+ attr_accessor :type
210
+
211
+ sig { returns(T.nilable(String)) }
212
+ attr_reader :name
213
+
214
+ sig { params(name: String).void }
215
+ attr_writer :name
216
+
217
+ sig do
218
+ params(
219
+
220
+ choices: T::Array[OpenAI::DecisionCreateParams::Question::Choice::Choice::OrHash],
221
+
222
+ instructions: String,
223
+
224
+ name: String,
225
+
226
+ type: Symbol
227
+ )
228
+ .returns(T.attached_class)
229
+ end
230
+ def self.new(
231
+
232
+ choices:,
233
+
234
+ instructions:,
235
+
236
+ name: nil,
237
+
238
+ # The type of the object. Always `choice`.
239
+
240
+ type: :choice
241
+ )
242
+ end
243
+
244
+ sig do
245
+ override.returns(
246
+ {
247
+ choices: T::Array[OpenAI::DecisionCreateParams::Question::Choice::Choice],
248
+ instructions: String,
249
+ type: Symbol,
250
+ name: String
251
+ }
252
+ )
253
+ end
254
+ def to_hash
255
+ end
256
+
257
+ class Choice < OpenAI::Internal::Type::BaseModel
258
+ OrHash = T.type_alias do
259
+ T.any(
260
+ OpenAI::DecisionCreateParams::Question::Choice::Choice,
261
+ OpenAI::Internal::AnyHash
262
+ )
263
+ end
264
+
265
+ # Choice values are typed: a string and a boolean with the same text are distinct.
266
+ sig { returns(T.any(String, T::Boolean)) }
267
+ attr_accessor :value
268
+
269
+ sig { returns(T.nilable(String)) }
270
+ attr_reader :description
271
+
272
+ sig { params(description: String).void }
273
+ attr_writer :description
274
+
275
+ sig do
276
+ params(
277
+
278
+ value: T.any(String, T::Boolean),
279
+
280
+ description: String
281
+ )
282
+ .returns(T.attached_class)
283
+ end
284
+ def self.new(
285
+
286
+ # Choice values are typed: a string and a boolean with the same text are distinct.
287
+ value:,
288
+
289
+ description: nil
290
+ )
291
+ end
292
+
293
+ sig do
294
+ override.returns(
295
+ {value: T.any(String, T::Boolean), description: String}
296
+ )
297
+ end
298
+ def to_hash
299
+ end
300
+
301
+ # Choice values are typed: a string and a boolean with the same text are distinct.
302
+ module Value
303
+ extend OpenAI::Internal::Type::Union
304
+
305
+ Variants = T.type_alias { T.any(String, T::Boolean) }
306
+
307
+ sig {
308
+ override.returns(T::Array[OpenAI::DecisionCreateParams::Question::Choice::Choice::Value::Variants])
309
+ }
310
+ def self.variants
311
+ end
312
+
313
+ end
314
+ end
315
+ end
316
+
317
+ class Score < OpenAI::Internal::Type::BaseModel
318
+ OrHash = T.type_alias do
319
+ T.any(
320
+ OpenAI::DecisionCreateParams::Question::Score,
321
+ OpenAI::Internal::AnyHash
322
+ )
323
+ end
324
+
325
+ sig { returns(String) }
326
+ attr_accessor :instructions
327
+
328
+ sig { returns(T::Array[OpenAI::DecisionCreateParams::Question::Score::Level]) }
329
+ attr_accessor :levels
330
+
331
+ # The type of the object. Always `score`.
332
+ sig { returns(Symbol) }
333
+ attr_accessor :type
334
+
335
+ sig { returns(T.nilable(String)) }
336
+ attr_reader :name
337
+
338
+ sig { params(name: String).void }
339
+ attr_writer :name
340
+
341
+ sig do
342
+ params(
343
+
344
+ instructions: String,
345
+
346
+ levels: T::Array[OpenAI::DecisionCreateParams::Question::Score::Level::OrHash],
347
+
348
+ name: String,
349
+
350
+ type: Symbol
351
+ )
352
+ .returns(T.attached_class)
353
+ end
354
+ def self.new(
355
+
356
+ instructions:,
357
+
358
+ levels:,
359
+
360
+ name: nil,
361
+
362
+ # The type of the object. Always `score`.
363
+
364
+ type: :score
365
+ )
366
+ end
367
+
368
+ sig do
369
+ override.returns(
370
+ {
371
+ instructions: String,
372
+ levels: T::Array[OpenAI::DecisionCreateParams::Question::Score::Level],
373
+ type: Symbol,
374
+ name: String
375
+ }
376
+ )
377
+ end
378
+ def to_hash
379
+ end
380
+
381
+ class Level < OpenAI::Internal::Type::BaseModel
382
+ OrHash = T.type_alias do
383
+ T.any(
384
+ OpenAI::DecisionCreateParams::Question::Score::Level,
385
+ OpenAI::Internal::AnyHash
386
+ )
387
+ end
388
+
389
+ sig { returns(String) }
390
+ attr_accessor :label
391
+
392
+ sig { returns(T.nilable(String)) }
393
+ attr_reader :description
394
+
395
+ sig { params(description: String).void }
396
+ attr_writer :description
397
+
398
+ sig do
399
+ params(
400
+
401
+ label: String,
402
+
403
+ description: String
404
+ )
405
+ .returns(T.attached_class)
406
+ end
407
+ def self.new(
408
+
409
+ label:,
410
+
411
+ description: nil
412
+ )
413
+ end
414
+
415
+ sig do
416
+ override.returns(
417
+ {label: String, description: String}
418
+ )
419
+ end
420
+ def to_hash
421
+ end
422
+
423
+ end
424
+ end
425
+
426
+ sig { override.returns(T::Array[OpenAI::DecisionCreateParams::Question::Variants]) }
427
+ def self.variants
428
+ end
429
+
430
+ end
431
+
432
+ end
433
+
434
+ end
435
+ end
@@ -0,0 +1,81 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ class DecisionInputImage < OpenAI::Internal::Type::BaseModel
7
+
8
+ OrHash = T.type_alias do
9
+ T.any(
10
+ OpenAI::DecisionInputImage,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # A base64-encoded image in a data URL.
16
+ sig { returns(String) }
17
+ attr_accessor :image_url
18
+
19
+ sig { returns(Symbol) }
20
+ attr_accessor :type
21
+
22
+ # The image detail level, using the selected model's image profile. Defaults to
23
+ # auto.
24
+ sig { returns(T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol)) }
25
+ attr_accessor :detail
26
+
27
+ # An inline image. External URLs and file IDs are not supported.
28
+ sig do
29
+ params(
30
+
31
+ image_url: String,
32
+
33
+ detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol),
34
+
35
+ type: Symbol
36
+ )
37
+ .returns(T.attached_class)
38
+ end
39
+ def self.new(
40
+
41
+ # A base64-encoded image in a data URL.
42
+ image_url:,
43
+
44
+ # The image detail level, using the selected model's image profile. Defaults to
45
+ # auto.
46
+ detail: nil,
47
+
48
+ type: :input_image
49
+ )
50
+ end
51
+
52
+ sig do
53
+ override.returns(
54
+ {image_url: String, type: Symbol, detail: T.nilable(OpenAI::DecisionInputImage::Detail::OrSymbol)}
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+
60
+ # The image detail level, using the selected model's image profile. Defaults to
61
+ # auto.
62
+ module Detail
63
+ extend OpenAI::Internal::Type::Enum
64
+
65
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::DecisionInputImage::Detail) }
66
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
67
+
68
+ LOW = T.let(:low, OpenAI::DecisionInputImage::Detail::TaggedSymbol)
69
+ HIGH = T.let(:high, OpenAI::DecisionInputImage::Detail::TaggedSymbol)
70
+ AUTO = T.let(:auto, OpenAI::DecisionInputImage::Detail::TaggedSymbol)
71
+ ORIGINAL = T.let(:original, OpenAI::DecisionInputImage::Detail::TaggedSymbol)
72
+
73
+ sig { override.returns(T::Array[OpenAI::DecisionInputImage::Detail::TaggedSymbol]) }
74
+ def self.values
75
+ end
76
+ end
77
+
78
+ end
79
+
80
+ end
81
+ end
@@ -0,0 +1,96 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ class DecisionInputMessage < OpenAI::Internal::Type::BaseModel
7
+
8
+ OrHash = T.type_alias do
9
+ T.any(
10
+ OpenAI::DecisionInputMessage,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Text evidence or an ordered list of text and inline image parts.
16
+ sig { returns(OpenAI::DecisionInputMessage::Content::Variants) }
17
+ attr_accessor :content
18
+
19
+ sig { returns(Symbol) }
20
+ attr_accessor :role
21
+
22
+ sig { returns(T.nilable(OpenAI::DecisionInputMessage::Type::OrSymbol)) }
23
+ attr_reader :type
24
+
25
+ sig { params(type: OpenAI::DecisionInputMessage::Type::OrSymbol).void }
26
+ attr_writer :type
27
+
28
+ # A user message containing text or inline images.
29
+ sig do
30
+ params(
31
+
32
+ content: OpenAI::DecisionInputMessage::Content::Variants,
33
+
34
+ type: OpenAI::DecisionInputMessage::Type::OrSymbol,
35
+
36
+ role: Symbol
37
+ )
38
+ .returns(T.attached_class)
39
+ end
40
+ def self.new(
41
+
42
+ # Text evidence or an ordered list of text and inline image parts.
43
+ content:,
44
+
45
+ type: nil,
46
+
47
+ role: :user
48
+ )
49
+ end
50
+
51
+ sig do
52
+ override.returns(
53
+ {
54
+ content: OpenAI::DecisionInputMessage::Content::Variants,
55
+ role: Symbol,
56
+ type: OpenAI::DecisionInputMessage::Type::OrSymbol
57
+ }
58
+ )
59
+ end
60
+ def to_hash
61
+ end
62
+
63
+ # Text evidence or an ordered list of text and inline image parts.
64
+ module Content
65
+ extend OpenAI::Internal::Type::Union
66
+
67
+ Variants = T.type_alias { T.any(String, T::Array[OpenAI::DecisionInputPart::Variants]) }
68
+
69
+ sig { override.returns(T::Array[OpenAI::DecisionInputMessage::Content::Variants]) }
70
+ def self.variants
71
+ end
72
+
73
+ DecisionInputPartArray = T.let(
74
+ OpenAI::Internal::Type::ArrayOf[union: OpenAI::DecisionInputPart],
75
+ OpenAI::Internal::Type::Converter
76
+ )
77
+
78
+ end
79
+
80
+ module Type
81
+ extend OpenAI::Internal::Type::Enum
82
+
83
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::DecisionInputMessage::Type) }
84
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
85
+
86
+ MESSAGE = T.let(:message, OpenAI::DecisionInputMessage::Type::TaggedSymbol)
87
+
88
+ sig { override.returns(T::Array[OpenAI::DecisionInputMessage::Type::TaggedSymbol]) }
89
+ def self.values
90
+ end
91
+ end
92
+
93
+ end
94
+
95
+ end
96
+ end
@@ -0,0 +1,24 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ # An inline image. External URLs and file IDs are not supported.
7
+ module DecisionInputPart
8
+ extend OpenAI::Internal::Type::Union
9
+
10
+ Variants = T.type_alias do
11
+ T.any(
12
+ OpenAI::DecisionInputText,
13
+ OpenAI::DecisionInputImage
14
+ )
15
+ end
16
+
17
+ sig { override.returns(T::Array[OpenAI::DecisionInputPart::Variants]) }
18
+ def self.variants
19
+ end
20
+
21
+ end
22
+
23
+ end
24
+ end
@@ -0,0 +1,49 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ class DecisionInputText < OpenAI::Internal::Type::BaseModel
7
+
8
+ OrHash = T.type_alias do
9
+ T.any(
10
+ OpenAI::DecisionInputText,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(String) }
16
+ attr_accessor :text
17
+
18
+ sig { returns(Symbol) }
19
+ attr_accessor :type
20
+
21
+ sig do
22
+ params(
23
+
24
+ text: String,
25
+
26
+ type: Symbol
27
+ )
28
+ .returns(T.attached_class)
29
+ end
30
+ def self.new(
31
+
32
+ text:,
33
+
34
+ type: :input_text
35
+ )
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {text: String, type: Symbol}
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+
46
+ end
47
+
48
+ end
49
+ end