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,233 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # @see OpenAI::Resources::Decisions#create
6
+ class DecisionCreateParams < OpenAI::Internal::Type::BaseModel
7
+ extend OpenAI::Internal::Type::RequestParameters::Converter
8
+ include OpenAI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute input
11
+ # Shared evidence, as a string or an array of user messages containing text and
12
+ # inline images. Non-user roles, function calls, function-call outputs, files,
13
+ # audio, and item references are not supported. At most 128 image parts are
14
+ # allowed across all messages in one request.
15
+ #
16
+ # @return [String, Array<OpenAI::Models::DecisionInputMessage>]
17
+ required :input, union: -> { OpenAI::DecisionCreateParams::Input }
18
+
19
+ # @!attribute model
20
+ #
21
+ # @return [String]
22
+ required :model, String
23
+
24
+ # @!attribute questions
25
+ #
26
+ # @return [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
27
+ required :questions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::DecisionCreateParams::Question] }
28
+
29
+ # @!attribute safety_identifier
30
+ # Opaque caller-provided end-user identifier, scoped by the verified org. Match
31
+ # Responses' limit; this is never the authenticated user identity.
32
+ #
33
+ # @return [String, nil]
34
+ optional :safety_identifier, String, nil?: true
35
+
36
+ # @!method initialize(input:, model:, questions:, safety_identifier: nil, request_options: {})
37
+ # @param input [String, Array<OpenAI::Models::DecisionInputMessage>]
38
+ # Shared evidence, as a string or an array of user messages containing text and
39
+ # inline images. Non-user roles, function calls, function-call outputs, files,
40
+ # audio, and item references are not supported. At most 128 image parts are
41
+ # allowed across all messages in one request.
42
+ #
43
+ # @param model [String]
44
+ #
45
+ # @param questions [Array<OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score>]
46
+ #
47
+ # @param safety_identifier [String, nil]
48
+ # Opaque caller-provided end-user identifier, scoped by the verified org. Match
49
+ # Responses' limit; this is never the authenticated user identity.
50
+ #
51
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
52
+
53
+ # Shared evidence, as a string or an array of user messages containing text and
54
+ # inline images. Non-user roles, function calls, function-call outputs, files,
55
+ # audio, and item references are not supported. At most 128 image parts are
56
+ # allowed across all messages in one request.
57
+ module Input
58
+ extend OpenAI::Internal::Type::Union
59
+
60
+ variant String
61
+
62
+ variant -> { OpenAI::Models::DecisionCreateParams::Input::DecisionInputMessageArray }
63
+
64
+ # @!method self.variants
65
+ # @return [Array(String, Array<OpenAI::Models::DecisionInputMessage>)]
66
+
67
+ # @type [OpenAI::Internal::Type::Converter]
68
+ DecisionInputMessageArray = OpenAI::Internal::Type::ArrayOf[-> { OpenAI::DecisionInputMessage }]
69
+ end
70
+
71
+ # A question about the request's input, with an optional correlation name.
72
+ module Question
73
+ extend OpenAI::Internal::Type::Union
74
+
75
+ discriminator :type
76
+
77
+ variant :predicate, -> { OpenAI::DecisionCreateParams::Question::Predicate }
78
+
79
+ variant :choice, -> { OpenAI::DecisionCreateParams::Question::Choice }
80
+
81
+ variant :score, -> { OpenAI::DecisionCreateParams::Question::Score }
82
+
83
+ class Predicate < OpenAI::Internal::Type::BaseModel
84
+ # @!attribute instructions
85
+ #
86
+ # @return [String]
87
+ required :instructions, String
88
+
89
+ # @!attribute type
90
+ # The type of the object. Always `predicate`.
91
+ #
92
+ # @return [Symbol, :predicate]
93
+ required :type, const: :predicate
94
+
95
+ # @!attribute name
96
+ #
97
+ # @return [String, nil]
98
+ optional :name, String
99
+
100
+ # @!method initialize(instructions:, name: nil, type: :predicate)
101
+ # @param instructions [String]
102
+ #
103
+ # @param name [String]
104
+ #
105
+ # @param type [Symbol, :predicate]
106
+ # The type of the object. Always `predicate`.
107
+ end
108
+
109
+ class Choice < OpenAI::Internal::Type::BaseModel
110
+ # @!attribute choices
111
+ #
112
+ # @return [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
113
+ required(
114
+ :choices,
115
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::DecisionCreateParams::Question::Choice::Choice] }
116
+ )
117
+
118
+ # @!attribute instructions
119
+ #
120
+ # @return [String]
121
+ required :instructions, String
122
+
123
+ # @!attribute type
124
+ # The type of the object. Always `choice`.
125
+ #
126
+ # @return [Symbol, :choice]
127
+ required :type, const: :choice
128
+
129
+ # @!attribute name
130
+ #
131
+ # @return [String, nil]
132
+ optional :name, String
133
+
134
+ # @!method initialize(choices:, instructions:, name: nil, type: :choice)
135
+ # @param choices [Array<OpenAI::Models::DecisionCreateParams::Question::Choice::Choice>]
136
+ #
137
+ # @param instructions [String]
138
+ #
139
+ # @param name [String]
140
+ #
141
+ # @param type [Symbol, :choice]
142
+ # The type of the object. Always `choice`.
143
+ class Choice < OpenAI::Internal::Type::BaseModel
144
+ # @!attribute value
145
+ # Choice values are typed: a string and a boolean with the same text are distinct.
146
+ #
147
+ # @return [String, Boolean]
148
+ required :value, union: -> { OpenAI::DecisionCreateParams::Question::Choice::Choice::Value }
149
+
150
+ # @!attribute description
151
+ #
152
+ # @return [String, nil]
153
+ optional :description, String
154
+
155
+ # @!method initialize(value:, description: nil)
156
+ # @param value [String, Boolean]
157
+ # Choice values are typed: a string and a boolean with the same text are distinct.
158
+ #
159
+ # @param description [String]
160
+
161
+ # Choice values are typed: a string and a boolean with the same text are distinct.
162
+ #
163
+ # @see OpenAI::Models::DecisionCreateParams::Question::Choice::Choice#value
164
+ module Value
165
+ extend OpenAI::Internal::Type::Union
166
+
167
+ variant String
168
+
169
+ variant OpenAI::Internal::Type::Boolean
170
+
171
+ # @!method self.variants
172
+ # @return [Array(String, Boolean)]
173
+ end
174
+ end
175
+ end
176
+
177
+ class Score < OpenAI::Internal::Type::BaseModel
178
+ # @!attribute instructions
179
+ #
180
+ # @return [String]
181
+ required :instructions, String
182
+
183
+ # @!attribute levels
184
+ #
185
+ # @return [Array<OpenAI::Models::DecisionCreateParams::Question::Score::Level>]
186
+ required(
187
+ :levels,
188
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::DecisionCreateParams::Question::Score::Level] }
189
+ )
190
+
191
+ # @!attribute type
192
+ # The type of the object. Always `score`.
193
+ #
194
+ # @return [Symbol, :score]
195
+ required :type, const: :score
196
+
197
+ # @!attribute name
198
+ #
199
+ # @return [String, nil]
200
+ optional :name, String
201
+
202
+ # @!method initialize(instructions:, levels:, name: nil, type: :score)
203
+ # @param instructions [String]
204
+ #
205
+ # @param levels [Array<OpenAI::Models::DecisionCreateParams::Question::Score::Level>]
206
+ #
207
+ # @param name [String]
208
+ #
209
+ # @param type [Symbol, :score]
210
+ # The type of the object. Always `score`.
211
+ class Level < OpenAI::Internal::Type::BaseModel
212
+ # @!attribute label
213
+ #
214
+ # @return [String]
215
+ required :label, String
216
+
217
+ # @!attribute description
218
+ #
219
+ # @return [String, nil]
220
+ optional :description, String
221
+
222
+ # @!method initialize(label:, description: nil)
223
+ # @param label [String]
224
+ # @param description [String]
225
+ end
226
+ end
227
+
228
+ # @!method self.variants
229
+ # @return [Array(OpenAI::Models::DecisionCreateParams::Question::Predicate, OpenAI::Models::DecisionCreateParams::Question::Choice, OpenAI::Models::DecisionCreateParams::Question::Score)]
230
+ end
231
+ end
232
+ end
233
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ class DecisionInputImage < OpenAI::Internal::Type::BaseModel
6
+ # @!attribute image_url
7
+ # A base64-encoded image in a data URL.
8
+ #
9
+ # @return [String]
10
+ required :image_url, String
11
+
12
+ # @!attribute type
13
+ #
14
+ # @return [Symbol, :input_image]
15
+ required :type, const: :input_image
16
+
17
+ # @!attribute detail
18
+ # The image detail level, using the selected model's image profile. Defaults to
19
+ # auto.
20
+ #
21
+ # @return [Symbol, OpenAI::Models::DecisionInputImage::Detail, nil]
22
+ optional :detail, enum: -> { OpenAI::DecisionInputImage::Detail }, nil?: true
23
+
24
+ # @!method initialize(image_url:, detail: nil, type: :input_image)
25
+ # An inline image. External URLs and file IDs are not supported.
26
+ #
27
+ # @param image_url [String]
28
+ # A base64-encoded image in a data URL.
29
+ #
30
+ # @param detail [Symbol, OpenAI::Models::DecisionInputImage::Detail, nil]
31
+ # The image detail level, using the selected model's image profile. Defaults to
32
+ # auto.
33
+ #
34
+ # @param type [Symbol, :input_image]
35
+
36
+ # The image detail level, using the selected model's image profile. Defaults to
37
+ # auto.
38
+ #
39
+ # @see OpenAI::Models::DecisionInputImage#detail
40
+ module Detail
41
+ extend OpenAI::Internal::Type::Enum
42
+
43
+ LOW = :low
44
+ HIGH = :high
45
+ AUTO = :auto
46
+ ORIGINAL = :original
47
+
48
+ # @!method self.values
49
+ # @return [Array<Symbol>]
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ class DecisionInputMessage < OpenAI::Internal::Type::BaseModel
6
+ # @!attribute content
7
+ # Text evidence or an ordered list of text and inline image parts.
8
+ #
9
+ # @return [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
10
+ required :content, union: -> { OpenAI::DecisionInputMessage::Content }
11
+
12
+ # @!attribute role
13
+ #
14
+ # @return [Symbol, :user]
15
+ required :role, const: :user
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, OpenAI::Models::DecisionInputMessage::Type, nil]
20
+ optional :type, enum: -> { OpenAI::DecisionInputMessage::Type }
21
+
22
+ # @!method initialize(content:, type: nil, role: :user)
23
+ # A user message containing text or inline images.
24
+ #
25
+ # @param content [String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>]
26
+ # Text evidence or an ordered list of text and inline image parts.
27
+ #
28
+ # @param type [Symbol, OpenAI::Models::DecisionInputMessage::Type]
29
+ #
30
+ # @param role [Symbol, :user]
31
+
32
+ # Text evidence or an ordered list of text and inline image parts.
33
+ #
34
+ # @see OpenAI::Models::DecisionInputMessage#content
35
+ module Content
36
+ extend OpenAI::Internal::Type::Union
37
+
38
+ variant String
39
+
40
+ variant -> { OpenAI::Models::DecisionInputMessage::Content::DecisionInputPartArray }
41
+
42
+ # @!method self.variants
43
+ # @return [Array(String, Array<OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage>)]
44
+
45
+ # @type [OpenAI::Internal::Type::Converter]
46
+ DecisionInputPartArray = OpenAI::Internal::Type::ArrayOf[union: -> { OpenAI::DecisionInputPart }]
47
+ end
48
+
49
+ # @see OpenAI::Models::DecisionInputMessage#type
50
+ module Type
51
+ extend OpenAI::Internal::Type::Enum
52
+
53
+ MESSAGE = :message
54
+
55
+ # @!method self.values
56
+ # @return [Array<Symbol>]
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ # An inline image. External URLs and file IDs are not supported.
6
+ module DecisionInputPart
7
+ extend OpenAI::Internal::Type::Union
8
+
9
+ discriminator :type
10
+
11
+ variant :input_text, -> { OpenAI::DecisionInputText }
12
+
13
+ # An inline image. External URLs and file IDs are not supported.
14
+ variant :input_image, -> { OpenAI::DecisionInputImage }
15
+
16
+ # @!method self.variants
17
+ # @return [Array(OpenAI::Models::DecisionInputText, OpenAI::Models::DecisionInputImage)]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ class DecisionInputText < OpenAI::Internal::Type::BaseModel
6
+ # @!attribute text
7
+ #
8
+ # @return [String]
9
+ required :text, String
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, :input_text]
14
+ required :type, const: :input_text
15
+
16
+ # @!method initialize(text:, type: :input_text)
17
+ # @param text [String]
18
+ # @param type [Symbol, :input_text]
19
+ end
20
+ end
21
+ end