openai 0.64.0 → 0.66.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 +16 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/audit_log_list_params.rb +6 -0
- data/lib/openai/models/admin/organization/audit_log_list_response.rb +231 -1
- data/lib/openai/models/chat/chat_completion.rb +341 -3
- data/lib/openai/models/chat/chat_completion_chunk.rb +341 -1
- data/lib/openai/models/chat/completion_create_params.rb +42 -1
- data/lib/openai/models/conversations/conversation_create_params.rb +2 -2
- data/lib/openai/models/conversations/conversation_item.rb +57 -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/responses/compacted_response.rb +2 -2
- data/lib/openai/models/responses/input_token_count_params.rb +41 -4
- data/lib/openai/models/responses/response.rb +296 -6
- data/lib/openai/models/responses/response_compact_params.rb +3 -3
- data/lib/openai/models/responses/response_create_params.rb +45 -4
- data/lib/openai/models/responses/response_function_web_search.rb +11 -9
- data/lib/openai/models/responses/response_input_item.rb +38 -1
- data/lib/openai/models/responses/response_item.rb +57 -1
- data/lib/openai/models/responses/response_item_list.rb +2 -2
- data/lib/openai/models/responses/response_output_item.rb +57 -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/responses_client_event.rb +46 -4
- 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 +4 -2
- data/lib/openai/resources/responses.rb +9 -5
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/models/admin/organization/audit_log_list_params.rbi +30 -0
- data/rbi/openai/models/admin/organization/audit_log_list_response.rbi +489 -3
- data/rbi/openai/models/chat/chat_completion.rbi +620 -3
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +621 -0
- data/rbi/openai/models/chat/completion_create_params.rbi +76 -0
- data/rbi/openai/models/conversations/conversation_create_params.rbi +3 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +150 -0
- data/rbi/openai/models/conversations/conversation_item_list.rbi +1 -0
- data/rbi/openai/models/conversations/item_create_params.rbi +3 -0
- data/rbi/openai/models/responses/compacted_response.rbi +1 -0
- data/rbi/openai/models/responses/input_token_count_params.rbi +85 -0
- data/rbi/openai/models/responses/response.rbi +510 -0
- data/rbi/openai/models/responses/response_create_params.rbi +78 -0
- data/rbi/openai/models/responses/response_function_web_search.rbi +11 -8
- data/rbi/openai/models/responses/response_input_item.rbi +120 -0
- data/rbi/openai/models/responses/response_item.rbi +150 -0
- data/rbi/openai/models/responses/response_item_list.rbi +1 -0
- data/rbi/openai/models/responses/response_output_item.rbi +150 -0
- data/rbi/openai/models/responses/response_output_item_added_event.rbi +1 -0
- data/rbi/openai/models/responses/response_output_item_done_event.rbi +1 -0
- data/rbi/openai/models/responses/responses_client_event.rbi +78 -0
- data/rbi/openai/resources/chat/completions.rbi +28 -0
- data/rbi/openai/resources/conversations/items.rbi +1 -0
- data/rbi/openai/resources/conversations.rbi +1 -0
- data/rbi/openai/resources/responses/input_tokens.rbi +9 -0
- data/rbi/openai/resources/responses.rbi +28 -0
- data/sig/openai/models/admin/organization/audit_log_list_params.rbs +12 -0
- data/sig/openai/models/admin/organization/audit_log_list_response.rbs +216 -3
- data/sig/openai/models/chat/chat_completion.rbs +243 -0
- data/sig/openai/models/chat/chat_completion_chunk.rbs +243 -0
- data/sig/openai/models/chat/completion_create_params.rbs +15 -0
- data/sig/openai/models/conversations/conversation_item.rbs +58 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +20 -0
- data/sig/openai/models/responses/response.rbs +189 -0
- data/sig/openai/models/responses/response_create_params.rbs +15 -0
- data/sig/openai/models/responses/response_function_web_search.rbs +7 -5
- data/sig/openai/models/responses/response_input_item.rbs +33 -0
- data/sig/openai/models/responses/response_item.rbs +58 -0
- data/sig/openai/models/responses/response_output_item.rbs +58 -0
- data/sig/openai/models/responses/responses_client_event.rbs +15 -0
- data/sig/openai/resources/chat/completions.rbs +2 -0
- data/sig/openai/resources/responses/input_tokens.rbs +1 -0
- data/sig/openai/resources/responses.rbs +2 -0
- metadata +2 -2
|
@@ -10,6 +10,7 @@ module OpenAI
|
|
|
10
10
|
created: Integer,
|
|
11
11
|
model: String,
|
|
12
12
|
object: :"chat.completion",
|
|
13
|
+
moderation: OpenAI::Chat::ChatCompletion::Moderation?,
|
|
13
14
|
service_tier: OpenAI::Models::Chat::ChatCompletion::service_tier?,
|
|
14
15
|
system_fingerprint: String,
|
|
15
16
|
usage: OpenAI::CompletionUsage
|
|
@@ -26,6 +27,8 @@ module OpenAI
|
|
|
26
27
|
|
|
27
28
|
attr_accessor object: :"chat.completion"
|
|
28
29
|
|
|
30
|
+
attr_accessor moderation: OpenAI::Chat::ChatCompletion::Moderation?
|
|
31
|
+
|
|
29
32
|
attr_accessor service_tier: OpenAI::Models::Chat::ChatCompletion::service_tier?
|
|
30
33
|
|
|
31
34
|
attr_reader system_fingerprint: String?
|
|
@@ -41,6 +44,7 @@ module OpenAI
|
|
|
41
44
|
choices: ::Array[OpenAI::Chat::ChatCompletion::Choice],
|
|
42
45
|
created: Integer,
|
|
43
46
|
model: String,
|
|
47
|
+
?moderation: OpenAI::Chat::ChatCompletion::Moderation?,
|
|
44
48
|
?service_tier: OpenAI::Models::Chat::ChatCompletion::service_tier?,
|
|
45
49
|
?system_fingerprint: String,
|
|
46
50
|
?usage: OpenAI::CompletionUsage,
|
|
@@ -53,6 +57,7 @@ module OpenAI
|
|
|
53
57
|
created: Integer,
|
|
54
58
|
model: String,
|
|
55
59
|
object: :"chat.completion",
|
|
60
|
+
moderation: OpenAI::Chat::ChatCompletion::Moderation?,
|
|
56
61
|
service_tier: OpenAI::Models::Chat::ChatCompletion::service_tier?,
|
|
57
62
|
system_fingerprint: String,
|
|
58
63
|
usage: OpenAI::CompletionUsage
|
|
@@ -127,6 +132,244 @@ module OpenAI
|
|
|
127
132
|
end
|
|
128
133
|
end
|
|
129
134
|
|
|
135
|
+
type moderation =
|
|
136
|
+
{
|
|
137
|
+
input: OpenAI::Models::Chat::ChatCompletion::Moderation::input,
|
|
138
|
+
output: OpenAI::Models::Chat::ChatCompletion::Moderation::output
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
142
|
+
attr_accessor input: OpenAI::Models::Chat::ChatCompletion::Moderation::input
|
|
143
|
+
|
|
144
|
+
attr_accessor output: OpenAI::Models::Chat::ChatCompletion::Moderation::output
|
|
145
|
+
|
|
146
|
+
def initialize: (
|
|
147
|
+
input: OpenAI::Models::Chat::ChatCompletion::Moderation::input,
|
|
148
|
+
output: OpenAI::Models::Chat::ChatCompletion::Moderation::output
|
|
149
|
+
) -> void
|
|
150
|
+
|
|
151
|
+
def to_hash: -> {
|
|
152
|
+
input: OpenAI::Models::Chat::ChatCompletion::Moderation::input,
|
|
153
|
+
output: OpenAI::Models::Chat::ChatCompletion::Moderation::output
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type input =
|
|
157
|
+
OpenAI::Chat::ChatCompletion::Moderation::Input::ModerationResults
|
|
158
|
+
| OpenAI::Chat::ChatCompletion::Moderation::Input::Error
|
|
159
|
+
|
|
160
|
+
module Input
|
|
161
|
+
extend OpenAI::Internal::Type::Union
|
|
162
|
+
|
|
163
|
+
type moderation_results =
|
|
164
|
+
{
|
|
165
|
+
model: String,
|
|
166
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result],
|
|
167
|
+
type: :moderation_results
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
class ModerationResults < OpenAI::Internal::Type::BaseModel
|
|
171
|
+
attr_accessor model: String
|
|
172
|
+
|
|
173
|
+
attr_accessor results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result]
|
|
174
|
+
|
|
175
|
+
attr_accessor type: :moderation_results
|
|
176
|
+
|
|
177
|
+
def initialize: (
|
|
178
|
+
model: String,
|
|
179
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result],
|
|
180
|
+
?type: :moderation_results
|
|
181
|
+
) -> void
|
|
182
|
+
|
|
183
|
+
def to_hash: -> {
|
|
184
|
+
model: String,
|
|
185
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result],
|
|
186
|
+
type: :moderation_results
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
type result =
|
|
190
|
+
{
|
|
191
|
+
categories: ::Hash[Symbol, bool],
|
|
192
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
193
|
+
category_scores: ::Hash[Symbol, Float],
|
|
194
|
+
flagged: bool,
|
|
195
|
+
model: String,
|
|
196
|
+
type: :moderation_result
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
200
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
201
|
+
|
|
202
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result::category_applied_input_type]]
|
|
203
|
+
|
|
204
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
205
|
+
|
|
206
|
+
attr_accessor flagged: bool
|
|
207
|
+
|
|
208
|
+
attr_accessor model: String
|
|
209
|
+
|
|
210
|
+
attr_accessor type: :moderation_result
|
|
211
|
+
|
|
212
|
+
def initialize: (
|
|
213
|
+
categories: ::Hash[Symbol, bool],
|
|
214
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
215
|
+
category_scores: ::Hash[Symbol, Float],
|
|
216
|
+
flagged: bool,
|
|
217
|
+
model: String,
|
|
218
|
+
?type: :moderation_result
|
|
219
|
+
) -> void
|
|
220
|
+
|
|
221
|
+
def to_hash: -> {
|
|
222
|
+
categories: ::Hash[Symbol, bool],
|
|
223
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
224
|
+
category_scores: ::Hash[Symbol, Float],
|
|
225
|
+
flagged: bool,
|
|
226
|
+
model: String,
|
|
227
|
+
type: :moderation_result
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
type category_applied_input_type = :text | :image
|
|
231
|
+
|
|
232
|
+
module CategoryAppliedInputType
|
|
233
|
+
extend OpenAI::Internal::Type::Enum
|
|
234
|
+
|
|
235
|
+
TEXT: :text
|
|
236
|
+
IMAGE: :image
|
|
237
|
+
|
|
238
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Input::ModerationResults::Result::category_applied_input_type]
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
type error = { code: String, message: String, type: :error }
|
|
244
|
+
|
|
245
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
246
|
+
attr_accessor code: String
|
|
247
|
+
|
|
248
|
+
attr_accessor message: String
|
|
249
|
+
|
|
250
|
+
attr_accessor type: :error
|
|
251
|
+
|
|
252
|
+
def initialize: (
|
|
253
|
+
code: String,
|
|
254
|
+
message: String,
|
|
255
|
+
?type: :error
|
|
256
|
+
) -> void
|
|
257
|
+
|
|
258
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::input]
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
type output =
|
|
265
|
+
OpenAI::Chat::ChatCompletion::Moderation::Output::ModerationResults
|
|
266
|
+
| OpenAI::Chat::ChatCompletion::Moderation::Output::Error
|
|
267
|
+
|
|
268
|
+
module Output
|
|
269
|
+
extend OpenAI::Internal::Type::Union
|
|
270
|
+
|
|
271
|
+
type moderation_results =
|
|
272
|
+
{
|
|
273
|
+
model: String,
|
|
274
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result],
|
|
275
|
+
type: :moderation_results
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
class ModerationResults < OpenAI::Internal::Type::BaseModel
|
|
279
|
+
attr_accessor model: String
|
|
280
|
+
|
|
281
|
+
attr_accessor results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result]
|
|
282
|
+
|
|
283
|
+
attr_accessor type: :moderation_results
|
|
284
|
+
|
|
285
|
+
def initialize: (
|
|
286
|
+
model: String,
|
|
287
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result],
|
|
288
|
+
?type: :moderation_results
|
|
289
|
+
) -> void
|
|
290
|
+
|
|
291
|
+
def to_hash: -> {
|
|
292
|
+
model: String,
|
|
293
|
+
results: ::Array[OpenAI::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result],
|
|
294
|
+
type: :moderation_results
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
type result =
|
|
298
|
+
{
|
|
299
|
+
categories: ::Hash[Symbol, bool],
|
|
300
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
301
|
+
category_scores: ::Hash[Symbol, Float],
|
|
302
|
+
flagged: bool,
|
|
303
|
+
model: String,
|
|
304
|
+
type: :moderation_result
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
308
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
309
|
+
|
|
310
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result::category_applied_input_type]]
|
|
311
|
+
|
|
312
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
313
|
+
|
|
314
|
+
attr_accessor flagged: bool
|
|
315
|
+
|
|
316
|
+
attr_accessor model: String
|
|
317
|
+
|
|
318
|
+
attr_accessor type: :moderation_result
|
|
319
|
+
|
|
320
|
+
def initialize: (
|
|
321
|
+
categories: ::Hash[Symbol, bool],
|
|
322
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
323
|
+
category_scores: ::Hash[Symbol, Float],
|
|
324
|
+
flagged: bool,
|
|
325
|
+
model: String,
|
|
326
|
+
?type: :moderation_result
|
|
327
|
+
) -> void
|
|
328
|
+
|
|
329
|
+
def to_hash: -> {
|
|
330
|
+
categories: ::Hash[Symbol, bool],
|
|
331
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
332
|
+
category_scores: ::Hash[Symbol, Float],
|
|
333
|
+
flagged: bool,
|
|
334
|
+
model: String,
|
|
335
|
+
type: :moderation_result
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
type category_applied_input_type = :text | :image
|
|
339
|
+
|
|
340
|
+
module CategoryAppliedInputType
|
|
341
|
+
extend OpenAI::Internal::Type::Enum
|
|
342
|
+
|
|
343
|
+
TEXT: :text
|
|
344
|
+
IMAGE: :image
|
|
345
|
+
|
|
346
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::Output::ModerationResults::Result::category_applied_input_type]
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
type error = { code: String, message: String, type: :error }
|
|
352
|
+
|
|
353
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
354
|
+
attr_accessor code: String
|
|
355
|
+
|
|
356
|
+
attr_accessor message: String
|
|
357
|
+
|
|
358
|
+
attr_accessor type: :error
|
|
359
|
+
|
|
360
|
+
def initialize: (
|
|
361
|
+
code: String,
|
|
362
|
+
message: String,
|
|
363
|
+
?type: :error
|
|
364
|
+
) -> void
|
|
365
|
+
|
|
366
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletion::Moderation::output]
|
|
370
|
+
end
|
|
371
|
+
end
|
|
372
|
+
|
|
130
373
|
type service_tier = :auto | :default | :flex | :scale | :priority
|
|
131
374
|
|
|
132
375
|
module ServiceTier
|
|
@@ -10,6 +10,7 @@ module OpenAI
|
|
|
10
10
|
created: Integer,
|
|
11
11
|
model: String,
|
|
12
12
|
object: :"chat.completion.chunk",
|
|
13
|
+
moderation: OpenAI::Chat::ChatCompletionChunk::Moderation?,
|
|
13
14
|
service_tier: OpenAI::Models::Chat::ChatCompletionChunk::service_tier?,
|
|
14
15
|
system_fingerprint: String,
|
|
15
16
|
usage: OpenAI::CompletionUsage?
|
|
@@ -26,6 +27,8 @@ module OpenAI
|
|
|
26
27
|
|
|
27
28
|
attr_accessor object: :"chat.completion.chunk"
|
|
28
29
|
|
|
30
|
+
attr_accessor moderation: OpenAI::Chat::ChatCompletionChunk::Moderation?
|
|
31
|
+
|
|
29
32
|
attr_accessor service_tier: OpenAI::Models::Chat::ChatCompletionChunk::service_tier?
|
|
30
33
|
|
|
31
34
|
attr_reader system_fingerprint: String?
|
|
@@ -39,6 +42,7 @@ module OpenAI
|
|
|
39
42
|
choices: ::Array[OpenAI::Chat::ChatCompletionChunk::Choice],
|
|
40
43
|
created: Integer,
|
|
41
44
|
model: String,
|
|
45
|
+
?moderation: OpenAI::Chat::ChatCompletionChunk::Moderation?,
|
|
42
46
|
?service_tier: OpenAI::Models::Chat::ChatCompletionChunk::service_tier?,
|
|
43
47
|
?system_fingerprint: String,
|
|
44
48
|
?usage: OpenAI::CompletionUsage?,
|
|
@@ -51,6 +55,7 @@ module OpenAI
|
|
|
51
55
|
created: Integer,
|
|
52
56
|
model: String,
|
|
53
57
|
object: :"chat.completion.chunk",
|
|
58
|
+
moderation: OpenAI::Chat::ChatCompletionChunk::Moderation?,
|
|
54
59
|
service_tier: OpenAI::Models::Chat::ChatCompletionChunk::service_tier?,
|
|
55
60
|
system_fingerprint: String,
|
|
56
61
|
usage: OpenAI::CompletionUsage?
|
|
@@ -272,6 +277,244 @@ module OpenAI
|
|
|
272
277
|
end
|
|
273
278
|
end
|
|
274
279
|
|
|
280
|
+
type moderation =
|
|
281
|
+
{
|
|
282
|
+
input: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::input,
|
|
283
|
+
output: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::output
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
287
|
+
attr_accessor input: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::input
|
|
288
|
+
|
|
289
|
+
attr_accessor output: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::output
|
|
290
|
+
|
|
291
|
+
def initialize: (
|
|
292
|
+
input: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::input,
|
|
293
|
+
output: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::output
|
|
294
|
+
) -> void
|
|
295
|
+
|
|
296
|
+
def to_hash: -> {
|
|
297
|
+
input: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::input,
|
|
298
|
+
output: OpenAI::Models::Chat::ChatCompletionChunk::Moderation::output
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
type input =
|
|
302
|
+
OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults
|
|
303
|
+
| OpenAI::Chat::ChatCompletionChunk::Moderation::Input::Error
|
|
304
|
+
|
|
305
|
+
module Input
|
|
306
|
+
extend OpenAI::Internal::Type::Union
|
|
307
|
+
|
|
308
|
+
type moderation_results =
|
|
309
|
+
{
|
|
310
|
+
model: String,
|
|
311
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result],
|
|
312
|
+
type: :moderation_results
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
class ModerationResults < OpenAI::Internal::Type::BaseModel
|
|
316
|
+
attr_accessor model: String
|
|
317
|
+
|
|
318
|
+
attr_accessor results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result]
|
|
319
|
+
|
|
320
|
+
attr_accessor type: :moderation_results
|
|
321
|
+
|
|
322
|
+
def initialize: (
|
|
323
|
+
model: String,
|
|
324
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result],
|
|
325
|
+
?type: :moderation_results
|
|
326
|
+
) -> void
|
|
327
|
+
|
|
328
|
+
def to_hash: -> {
|
|
329
|
+
model: String,
|
|
330
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result],
|
|
331
|
+
type: :moderation_results
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
type result =
|
|
335
|
+
{
|
|
336
|
+
categories: ::Hash[Symbol, bool],
|
|
337
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
338
|
+
category_scores: ::Hash[Symbol, Float],
|
|
339
|
+
flagged: bool,
|
|
340
|
+
model: String,
|
|
341
|
+
type: :moderation_result
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
345
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
346
|
+
|
|
347
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::category_applied_input_type]]
|
|
348
|
+
|
|
349
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
350
|
+
|
|
351
|
+
attr_accessor flagged: bool
|
|
352
|
+
|
|
353
|
+
attr_accessor model: String
|
|
354
|
+
|
|
355
|
+
attr_accessor type: :moderation_result
|
|
356
|
+
|
|
357
|
+
def initialize: (
|
|
358
|
+
categories: ::Hash[Symbol, bool],
|
|
359
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
360
|
+
category_scores: ::Hash[Symbol, Float],
|
|
361
|
+
flagged: bool,
|
|
362
|
+
model: String,
|
|
363
|
+
?type: :moderation_result
|
|
364
|
+
) -> void
|
|
365
|
+
|
|
366
|
+
def to_hash: -> {
|
|
367
|
+
categories: ::Hash[Symbol, bool],
|
|
368
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::category_applied_input_type]],
|
|
369
|
+
category_scores: ::Hash[Symbol, Float],
|
|
370
|
+
flagged: bool,
|
|
371
|
+
model: String,
|
|
372
|
+
type: :moderation_result
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
type category_applied_input_type = :text | :image
|
|
376
|
+
|
|
377
|
+
module CategoryAppliedInputType
|
|
378
|
+
extend OpenAI::Internal::Type::Enum
|
|
379
|
+
|
|
380
|
+
TEXT: :text
|
|
381
|
+
IMAGE: :image
|
|
382
|
+
|
|
383
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Input::ModerationResults::Result::category_applied_input_type]
|
|
384
|
+
end
|
|
385
|
+
end
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
type error = { code: String, message: String, type: :error }
|
|
389
|
+
|
|
390
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
391
|
+
attr_accessor code: String
|
|
392
|
+
|
|
393
|
+
attr_accessor message: String
|
|
394
|
+
|
|
395
|
+
attr_accessor type: :error
|
|
396
|
+
|
|
397
|
+
def initialize: (
|
|
398
|
+
code: String,
|
|
399
|
+
message: String,
|
|
400
|
+
?type: :error
|
|
401
|
+
) -> void
|
|
402
|
+
|
|
403
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::input]
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
type output =
|
|
410
|
+
OpenAI::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults
|
|
411
|
+
| OpenAI::Chat::ChatCompletionChunk::Moderation::Output::Error
|
|
412
|
+
|
|
413
|
+
module Output
|
|
414
|
+
extend OpenAI::Internal::Type::Union
|
|
415
|
+
|
|
416
|
+
type moderation_results =
|
|
417
|
+
{
|
|
418
|
+
model: String,
|
|
419
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result],
|
|
420
|
+
type: :moderation_results
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
class ModerationResults < OpenAI::Internal::Type::BaseModel
|
|
424
|
+
attr_accessor model: String
|
|
425
|
+
|
|
426
|
+
attr_accessor results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result]
|
|
427
|
+
|
|
428
|
+
attr_accessor type: :moderation_results
|
|
429
|
+
|
|
430
|
+
def initialize: (
|
|
431
|
+
model: String,
|
|
432
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result],
|
|
433
|
+
?type: :moderation_results
|
|
434
|
+
) -> void
|
|
435
|
+
|
|
436
|
+
def to_hash: -> {
|
|
437
|
+
model: String,
|
|
438
|
+
results: ::Array[OpenAI::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result],
|
|
439
|
+
type: :moderation_results
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
type result =
|
|
443
|
+
{
|
|
444
|
+
categories: ::Hash[Symbol, bool],
|
|
445
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
446
|
+
category_scores: ::Hash[Symbol, Float],
|
|
447
|
+
flagged: bool,
|
|
448
|
+
model: String,
|
|
449
|
+
type: :moderation_result
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
class Result < OpenAI::Internal::Type::BaseModel
|
|
453
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
454
|
+
|
|
455
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result::category_applied_input_type]]
|
|
456
|
+
|
|
457
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
458
|
+
|
|
459
|
+
attr_accessor flagged: bool
|
|
460
|
+
|
|
461
|
+
attr_accessor model: String
|
|
462
|
+
|
|
463
|
+
attr_accessor type: :moderation_result
|
|
464
|
+
|
|
465
|
+
def initialize: (
|
|
466
|
+
categories: ::Hash[Symbol, bool],
|
|
467
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
468
|
+
category_scores: ::Hash[Symbol, Float],
|
|
469
|
+
flagged: bool,
|
|
470
|
+
model: String,
|
|
471
|
+
?type: :moderation_result
|
|
472
|
+
) -> void
|
|
473
|
+
|
|
474
|
+
def to_hash: -> {
|
|
475
|
+
categories: ::Hash[Symbol, bool],
|
|
476
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result::category_applied_input_type]],
|
|
477
|
+
category_scores: ::Hash[Symbol, Float],
|
|
478
|
+
flagged: bool,
|
|
479
|
+
model: String,
|
|
480
|
+
type: :moderation_result
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
type category_applied_input_type = :text | :image
|
|
484
|
+
|
|
485
|
+
module CategoryAppliedInputType
|
|
486
|
+
extend OpenAI::Internal::Type::Enum
|
|
487
|
+
|
|
488
|
+
TEXT: :text
|
|
489
|
+
IMAGE: :image
|
|
490
|
+
|
|
491
|
+
def self?.values: -> ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::Output::ModerationResults::Result::category_applied_input_type]
|
|
492
|
+
end
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
type error = { code: String, message: String, type: :error }
|
|
497
|
+
|
|
498
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
499
|
+
attr_accessor code: String
|
|
500
|
+
|
|
501
|
+
attr_accessor message: String
|
|
502
|
+
|
|
503
|
+
attr_accessor type: :error
|
|
504
|
+
|
|
505
|
+
def initialize: (
|
|
506
|
+
code: String,
|
|
507
|
+
message: String,
|
|
508
|
+
?type: :error
|
|
509
|
+
) -> void
|
|
510
|
+
|
|
511
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
def self?.variants: -> ::Array[OpenAI::Models::Chat::ChatCompletionChunk::Moderation::output]
|
|
515
|
+
end
|
|
516
|
+
end
|
|
517
|
+
|
|
275
518
|
type service_tier = :auto | :default | :flex | :scale | :priority
|
|
276
519
|
|
|
277
520
|
module ServiceTier
|
|
@@ -15,6 +15,7 @@ module OpenAI
|
|
|
15
15
|
max_tokens: Integer?,
|
|
16
16
|
metadata: OpenAI::Models::metadata?,
|
|
17
17
|
modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?,
|
|
18
|
+
moderation: OpenAI::Chat::CompletionCreateParams::Moderation?,
|
|
18
19
|
n: Integer?,
|
|
19
20
|
parallel_tool_calls: bool,
|
|
20
21
|
prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
|
@@ -76,6 +77,8 @@ module OpenAI
|
|
|
76
77
|
|
|
77
78
|
attr_accessor modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?
|
|
78
79
|
|
|
80
|
+
attr_accessor moderation: OpenAI::Chat::CompletionCreateParams::Moderation?
|
|
81
|
+
|
|
79
82
|
attr_accessor n: Integer?
|
|
80
83
|
|
|
81
84
|
attr_reader parallel_tool_calls: bool?
|
|
@@ -157,6 +160,7 @@ module OpenAI
|
|
|
157
160
|
?max_tokens: Integer?,
|
|
158
161
|
?metadata: OpenAI::Models::metadata?,
|
|
159
162
|
?modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?,
|
|
163
|
+
?moderation: OpenAI::Chat::CompletionCreateParams::Moderation?,
|
|
160
164
|
?n: Integer?,
|
|
161
165
|
?parallel_tool_calls: bool,
|
|
162
166
|
?prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
|
@@ -195,6 +199,7 @@ module OpenAI
|
|
|
195
199
|
max_tokens: Integer?,
|
|
196
200
|
metadata: OpenAI::Models::metadata?,
|
|
197
201
|
modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?,
|
|
202
|
+
moderation: OpenAI::Chat::CompletionCreateParams::Moderation?,
|
|
198
203
|
n: Integer?,
|
|
199
204
|
parallel_tool_calls: bool,
|
|
200
205
|
prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
|
@@ -293,6 +298,16 @@ module OpenAI
|
|
|
293
298
|
def self?.values: -> ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]
|
|
294
299
|
end
|
|
295
300
|
|
|
301
|
+
type moderation = { model: String }
|
|
302
|
+
|
|
303
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
304
|
+
attr_accessor model: String
|
|
305
|
+
|
|
306
|
+
def initialize: (model: String) -> void
|
|
307
|
+
|
|
308
|
+
def to_hash: -> { model: String }
|
|
309
|
+
end
|
|
310
|
+
|
|
296
311
|
type prompt_cache_retention = :in_memory | :"24h"
|
|
297
312
|
|
|
298
313
|
module PromptCacheRetention
|
|
@@ -14,6 +14,7 @@ module OpenAI
|
|
|
14
14
|
| OpenAI::Responses::ResponseComputerToolCallOutputItem
|
|
15
15
|
| OpenAI::Responses::ResponseToolSearchCall
|
|
16
16
|
| OpenAI::Responses::ResponseToolSearchOutputItem
|
|
17
|
+
| OpenAI::Conversations::ConversationItem::AdditionalTools
|
|
17
18
|
| OpenAI::Responses::ResponseReasoningItem
|
|
18
19
|
| OpenAI::Responses::ResponseCompactionItem
|
|
19
20
|
| OpenAI::Responses::ResponseCodeInterpreterToolCall
|
|
@@ -78,6 +79,63 @@ module OpenAI
|
|
|
78
79
|
end
|
|
79
80
|
end
|
|
80
81
|
|
|
82
|
+
type additional_tools =
|
|
83
|
+
{
|
|
84
|
+
id: String,
|
|
85
|
+
role: OpenAI::Models::Conversations::ConversationItem::AdditionalTools::role,
|
|
86
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
87
|
+
type: :additional_tools
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
class AdditionalTools < OpenAI::Internal::Type::BaseModel
|
|
91
|
+
attr_accessor id: String
|
|
92
|
+
|
|
93
|
+
attr_accessor role: OpenAI::Models::Conversations::ConversationItem::AdditionalTools::role
|
|
94
|
+
|
|
95
|
+
attr_accessor tools: ::Array[OpenAI::Models::Responses::tool]
|
|
96
|
+
|
|
97
|
+
attr_accessor type: :additional_tools
|
|
98
|
+
|
|
99
|
+
def initialize: (
|
|
100
|
+
id: String,
|
|
101
|
+
role: OpenAI::Models::Conversations::ConversationItem::AdditionalTools::role,
|
|
102
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
103
|
+
?type: :additional_tools
|
|
104
|
+
) -> void
|
|
105
|
+
|
|
106
|
+
def to_hash: -> {
|
|
107
|
+
id: String,
|
|
108
|
+
role: OpenAI::Models::Conversations::ConversationItem::AdditionalTools::role,
|
|
109
|
+
tools: ::Array[OpenAI::Models::Responses::tool],
|
|
110
|
+
type: :additional_tools
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
type role =
|
|
114
|
+
:unknown
|
|
115
|
+
| :user
|
|
116
|
+
| :assistant
|
|
117
|
+
| :system
|
|
118
|
+
| :critic
|
|
119
|
+
| :discriminator
|
|
120
|
+
| :developer
|
|
121
|
+
| :tool
|
|
122
|
+
|
|
123
|
+
module Role
|
|
124
|
+
extend OpenAI::Internal::Type::Enum
|
|
125
|
+
|
|
126
|
+
UNKNOWN: :unknown
|
|
127
|
+
USER: :user
|
|
128
|
+
ASSISTANT: :assistant
|
|
129
|
+
SYSTEM: :system
|
|
130
|
+
CRITIC: :critic
|
|
131
|
+
DISCRIMINATOR: :discriminator
|
|
132
|
+
DEVELOPER: :developer
|
|
133
|
+
TOOL: :tool
|
|
134
|
+
|
|
135
|
+
def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::AdditionalTools::role]
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
81
139
|
type local_shell_call =
|
|
82
140
|
{
|
|
83
141
|
id: String,
|