openai 0.65.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 +8 -0
- data/README.md +1 -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 +26 -1
- data/lib/openai/models/responses/response.rb +275 -1
- data/lib/openai/models/responses/response_create_params.rb +26 -1
- data/lib/openai/models/responses/responses_client_event.rb +27 -1
- data/lib/openai/resources/chat/completions.rb +6 -2
- data/lib/openai/resources/responses.rb +6 -2
- data/lib/openai/version.rb +1 -1
- 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 +52 -0
- data/rbi/openai/models/responses/response.rbi +485 -0
- data/rbi/openai/models/responses/response_create_params.rbi +54 -0
- data/rbi/openai/models/responses/responses_client_event.rbi +54 -0
- data/rbi/openai/resources/chat/completions.rbi +12 -0
- data/rbi/openai/resources/responses.rbi +12 -0
- 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/responses/response.rbs +189 -0
- data/sig/openai/models/responses/response_create_params.rbs +15 -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.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.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
|
|
@@ -22,6 +22,7 @@ module OpenAI
|
|
|
22
22
|
conversation: OpenAI::Responses::Response::Conversation?,
|
|
23
23
|
max_output_tokens: Integer?,
|
|
24
24
|
max_tool_calls: Integer?,
|
|
25
|
+
moderation: OpenAI::Responses::Response::Moderation?,
|
|
25
26
|
previous_response_id: String?,
|
|
26
27
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
27
28
|
prompt_cache_key: String,
|
|
@@ -76,6 +77,8 @@ module OpenAI
|
|
|
76
77
|
|
|
77
78
|
attr_accessor max_tool_calls: Integer?
|
|
78
79
|
|
|
80
|
+
attr_accessor moderation: OpenAI::Responses::Response::Moderation?
|
|
81
|
+
|
|
79
82
|
attr_accessor previous_response_id: String?
|
|
80
83
|
|
|
81
84
|
attr_accessor prompt: OpenAI::Responses::ResponsePrompt?
|
|
@@ -139,6 +142,7 @@ module OpenAI
|
|
|
139
142
|
?conversation: OpenAI::Responses::Response::Conversation?,
|
|
140
143
|
?max_output_tokens: Integer?,
|
|
141
144
|
?max_tool_calls: Integer?,
|
|
145
|
+
?moderation: OpenAI::Responses::Response::Moderation?,
|
|
142
146
|
?previous_response_id: String?,
|
|
143
147
|
?prompt: OpenAI::Responses::ResponsePrompt?,
|
|
144
148
|
?prompt_cache_key: String,
|
|
@@ -175,6 +179,7 @@ module OpenAI
|
|
|
175
179
|
conversation: OpenAI::Responses::Response::Conversation?,
|
|
176
180
|
max_output_tokens: Integer?,
|
|
177
181
|
max_tool_calls: Integer?,
|
|
182
|
+
moderation: OpenAI::Responses::Response::Moderation?,
|
|
178
183
|
previous_response_id: String?,
|
|
179
184
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
180
185
|
prompt_cache_key: String,
|
|
@@ -259,6 +264,190 @@ module OpenAI
|
|
|
259
264
|
def to_hash: -> { id: String }
|
|
260
265
|
end
|
|
261
266
|
|
|
267
|
+
type moderation =
|
|
268
|
+
{
|
|
269
|
+
input: OpenAI::Models::Responses::Response::Moderation::input,
|
|
270
|
+
output: OpenAI::Models::Responses::Response::Moderation::output
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
274
|
+
attr_accessor input: OpenAI::Models::Responses::Response::Moderation::input
|
|
275
|
+
|
|
276
|
+
attr_accessor output: OpenAI::Models::Responses::Response::Moderation::output
|
|
277
|
+
|
|
278
|
+
def initialize: (
|
|
279
|
+
input: OpenAI::Models::Responses::Response::Moderation::input,
|
|
280
|
+
output: OpenAI::Models::Responses::Response::Moderation::output
|
|
281
|
+
) -> void
|
|
282
|
+
|
|
283
|
+
def to_hash: -> {
|
|
284
|
+
input: OpenAI::Models::Responses::Response::Moderation::input,
|
|
285
|
+
output: OpenAI::Models::Responses::Response::Moderation::output
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
type input =
|
|
289
|
+
OpenAI::Responses::Response::Moderation::Input::ModerationResult
|
|
290
|
+
| OpenAI::Responses::Response::Moderation::Input::Error
|
|
291
|
+
|
|
292
|
+
module Input
|
|
293
|
+
extend OpenAI::Internal::Type::Union
|
|
294
|
+
|
|
295
|
+
type moderation_result =
|
|
296
|
+
{
|
|
297
|
+
categories: ::Hash[Symbol, bool],
|
|
298
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Input::ModerationResult::category_applied_input_type]],
|
|
299
|
+
category_scores: ::Hash[Symbol, Float],
|
|
300
|
+
flagged: bool,
|
|
301
|
+
model: String,
|
|
302
|
+
type: :moderation_result
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
class ModerationResult < OpenAI::Internal::Type::BaseModel
|
|
306
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
307
|
+
|
|
308
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Input::ModerationResult::category_applied_input_type]]
|
|
309
|
+
|
|
310
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
311
|
+
|
|
312
|
+
attr_accessor flagged: bool
|
|
313
|
+
|
|
314
|
+
attr_accessor model: String
|
|
315
|
+
|
|
316
|
+
attr_accessor type: :moderation_result
|
|
317
|
+
|
|
318
|
+
def initialize: (
|
|
319
|
+
categories: ::Hash[Symbol, bool],
|
|
320
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Input::ModerationResult::category_applied_input_type]],
|
|
321
|
+
category_scores: ::Hash[Symbol, Float],
|
|
322
|
+
flagged: bool,
|
|
323
|
+
model: String,
|
|
324
|
+
?type: :moderation_result
|
|
325
|
+
) -> void
|
|
326
|
+
|
|
327
|
+
def to_hash: -> {
|
|
328
|
+
categories: ::Hash[Symbol, bool],
|
|
329
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Input::ModerationResult::category_applied_input_type]],
|
|
330
|
+
category_scores: ::Hash[Symbol, Float],
|
|
331
|
+
flagged: bool,
|
|
332
|
+
model: String,
|
|
333
|
+
type: :moderation_result
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
type category_applied_input_type = :text | :image
|
|
337
|
+
|
|
338
|
+
module CategoryAppliedInputType
|
|
339
|
+
extend OpenAI::Internal::Type::Enum
|
|
340
|
+
|
|
341
|
+
TEXT: :text
|
|
342
|
+
IMAGE: :image
|
|
343
|
+
|
|
344
|
+
def self?.values: -> ::Array[OpenAI::Models::Responses::Response::Moderation::Input::ModerationResult::category_applied_input_type]
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
type error = { code: String, message: String, type: :error }
|
|
349
|
+
|
|
350
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
351
|
+
attr_accessor code: String
|
|
352
|
+
|
|
353
|
+
attr_accessor message: String
|
|
354
|
+
|
|
355
|
+
attr_accessor type: :error
|
|
356
|
+
|
|
357
|
+
def initialize: (
|
|
358
|
+
code: String,
|
|
359
|
+
message: String,
|
|
360
|
+
?type: :error
|
|
361
|
+
) -> void
|
|
362
|
+
|
|
363
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
def self?.variants: -> ::Array[OpenAI::Models::Responses::Response::Moderation::input]
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
type output =
|
|
370
|
+
OpenAI::Responses::Response::Moderation::Output::ModerationResult
|
|
371
|
+
| OpenAI::Responses::Response::Moderation::Output::Error
|
|
372
|
+
|
|
373
|
+
module Output
|
|
374
|
+
extend OpenAI::Internal::Type::Union
|
|
375
|
+
|
|
376
|
+
type moderation_result =
|
|
377
|
+
{
|
|
378
|
+
categories: ::Hash[Symbol, bool],
|
|
379
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Output::ModerationResult::category_applied_input_type]],
|
|
380
|
+
category_scores: ::Hash[Symbol, Float],
|
|
381
|
+
flagged: bool,
|
|
382
|
+
model: String,
|
|
383
|
+
type: :moderation_result
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
class ModerationResult < OpenAI::Internal::Type::BaseModel
|
|
387
|
+
attr_accessor categories: ::Hash[Symbol, bool]
|
|
388
|
+
|
|
389
|
+
attr_accessor category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Output::ModerationResult::category_applied_input_type]]
|
|
390
|
+
|
|
391
|
+
attr_accessor category_scores: ::Hash[Symbol, Float]
|
|
392
|
+
|
|
393
|
+
attr_accessor flagged: bool
|
|
394
|
+
|
|
395
|
+
attr_accessor model: String
|
|
396
|
+
|
|
397
|
+
attr_accessor type: :moderation_result
|
|
398
|
+
|
|
399
|
+
def initialize: (
|
|
400
|
+
categories: ::Hash[Symbol, bool],
|
|
401
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Output::ModerationResult::category_applied_input_type]],
|
|
402
|
+
category_scores: ::Hash[Symbol, Float],
|
|
403
|
+
flagged: bool,
|
|
404
|
+
model: String,
|
|
405
|
+
?type: :moderation_result
|
|
406
|
+
) -> void
|
|
407
|
+
|
|
408
|
+
def to_hash: -> {
|
|
409
|
+
categories: ::Hash[Symbol, bool],
|
|
410
|
+
category_applied_input_types: ::Hash[Symbol, ::Array[OpenAI::Models::Responses::Response::Moderation::Output::ModerationResult::category_applied_input_type]],
|
|
411
|
+
category_scores: ::Hash[Symbol, Float],
|
|
412
|
+
flagged: bool,
|
|
413
|
+
model: String,
|
|
414
|
+
type: :moderation_result
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
type category_applied_input_type = :text | :image
|
|
418
|
+
|
|
419
|
+
module CategoryAppliedInputType
|
|
420
|
+
extend OpenAI::Internal::Type::Enum
|
|
421
|
+
|
|
422
|
+
TEXT: :text
|
|
423
|
+
IMAGE: :image
|
|
424
|
+
|
|
425
|
+
def self?.values: -> ::Array[OpenAI::Models::Responses::Response::Moderation::Output::ModerationResult::category_applied_input_type]
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
type error = { code: String, message: String, type: :error }
|
|
430
|
+
|
|
431
|
+
class Error < OpenAI::Internal::Type::BaseModel
|
|
432
|
+
attr_accessor code: String
|
|
433
|
+
|
|
434
|
+
attr_accessor message: String
|
|
435
|
+
|
|
436
|
+
attr_accessor type: :error
|
|
437
|
+
|
|
438
|
+
def initialize: (
|
|
439
|
+
code: String,
|
|
440
|
+
message: String,
|
|
441
|
+
?type: :error
|
|
442
|
+
) -> void
|
|
443
|
+
|
|
444
|
+
def to_hash: -> { code: String, message: String, type: :error }
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
def self?.variants: -> ::Array[OpenAI::Models::Responses::Response::Moderation::output]
|
|
448
|
+
end
|
|
449
|
+
end
|
|
450
|
+
|
|
262
451
|
type prompt_cache_retention = :in_memory | :"24h"
|
|
263
452
|
|
|
264
453
|
module PromptCacheRetention
|
|
@@ -13,6 +13,7 @@ module OpenAI
|
|
|
13
13
|
max_tool_calls: Integer?,
|
|
14
14
|
metadata: OpenAI::Models::metadata?,
|
|
15
15
|
model: OpenAI::Models::responses_model,
|
|
16
|
+
moderation: OpenAI::Responses::ResponseCreateParams::Moderation?,
|
|
16
17
|
parallel_tool_calls: bool?,
|
|
17
18
|
previous_response_id: String?,
|
|
18
19
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -66,6 +67,8 @@ module OpenAI
|
|
|
66
67
|
OpenAI::Models::responses_model
|
|
67
68
|
) -> OpenAI::Models::responses_model
|
|
68
69
|
|
|
70
|
+
attr_accessor moderation: OpenAI::Responses::ResponseCreateParams::Moderation?
|
|
71
|
+
|
|
69
72
|
attr_accessor parallel_tool_calls: bool?
|
|
70
73
|
|
|
71
74
|
attr_accessor previous_response_id: String?
|
|
@@ -131,6 +134,7 @@ module OpenAI
|
|
|
131
134
|
?max_tool_calls: Integer?,
|
|
132
135
|
?metadata: OpenAI::Models::metadata?,
|
|
133
136
|
?model: OpenAI::Models::responses_model,
|
|
137
|
+
?moderation: OpenAI::Responses::ResponseCreateParams::Moderation?,
|
|
134
138
|
?parallel_tool_calls: bool?,
|
|
135
139
|
?previous_response_id: String?,
|
|
136
140
|
?prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -163,6 +167,7 @@ module OpenAI
|
|
|
163
167
|
max_tool_calls: Integer?,
|
|
164
168
|
metadata: OpenAI::Models::metadata?,
|
|
165
169
|
model: OpenAI::Models::responses_model,
|
|
170
|
+
moderation: OpenAI::Responses::ResponseCreateParams::Moderation?,
|
|
166
171
|
parallel_tool_calls: bool?,
|
|
167
172
|
previous_response_id: String?,
|
|
168
173
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -213,6 +218,16 @@ module OpenAI
|
|
|
213
218
|
def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponseCreateParams::input]
|
|
214
219
|
end
|
|
215
220
|
|
|
221
|
+
type moderation = { model: String }
|
|
222
|
+
|
|
223
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
224
|
+
attr_accessor model: String
|
|
225
|
+
|
|
226
|
+
def initialize: (model: String) -> void
|
|
227
|
+
|
|
228
|
+
def to_hash: -> { model: String }
|
|
229
|
+
end
|
|
230
|
+
|
|
216
231
|
type prompt_cache_retention = :in_memory | :"24h"
|
|
217
232
|
|
|
218
233
|
module PromptCacheRetention
|
|
@@ -14,6 +14,7 @@ module OpenAI
|
|
|
14
14
|
max_tool_calls: Integer?,
|
|
15
15
|
metadata: OpenAI::Models::metadata?,
|
|
16
16
|
model: OpenAI::Models::responses_model,
|
|
17
|
+
moderation: OpenAI::Responses::ResponsesClientEvent::Moderation?,
|
|
17
18
|
parallel_tool_calls: bool?,
|
|
18
19
|
previous_response_id: String?,
|
|
19
20
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -66,6 +67,8 @@ module OpenAI
|
|
|
66
67
|
OpenAI::Models::responses_model
|
|
67
68
|
) -> OpenAI::Models::responses_model
|
|
68
69
|
|
|
70
|
+
attr_accessor moderation: OpenAI::Responses::ResponsesClientEvent::Moderation?
|
|
71
|
+
|
|
69
72
|
attr_accessor parallel_tool_calls: bool?
|
|
70
73
|
|
|
71
74
|
attr_accessor previous_response_id: String?
|
|
@@ -133,6 +136,7 @@ module OpenAI
|
|
|
133
136
|
?max_tool_calls: Integer?,
|
|
134
137
|
?metadata: OpenAI::Models::metadata?,
|
|
135
138
|
?model: OpenAI::Models::responses_model,
|
|
139
|
+
?moderation: OpenAI::Responses::ResponsesClientEvent::Moderation?,
|
|
136
140
|
?parallel_tool_calls: bool?,
|
|
137
141
|
?previous_response_id: String?,
|
|
138
142
|
?prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -167,6 +171,7 @@ module OpenAI
|
|
|
167
171
|
max_tool_calls: Integer?,
|
|
168
172
|
metadata: OpenAI::Models::metadata?,
|
|
169
173
|
model: OpenAI::Models::responses_model,
|
|
174
|
+
moderation: OpenAI::Responses::ResponsesClientEvent::Moderation?,
|
|
170
175
|
parallel_tool_calls: bool?,
|
|
171
176
|
previous_response_id: String?,
|
|
172
177
|
prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -217,6 +222,16 @@ module OpenAI
|
|
|
217
222
|
def self?.variants: -> ::Array[OpenAI::Models::Responses::ResponsesClientEvent::input]
|
|
218
223
|
end
|
|
219
224
|
|
|
225
|
+
type moderation = { model: String }
|
|
226
|
+
|
|
227
|
+
class Moderation < OpenAI::Internal::Type::BaseModel
|
|
228
|
+
attr_accessor model: String
|
|
229
|
+
|
|
230
|
+
def initialize: (model: String) -> void
|
|
231
|
+
|
|
232
|
+
def to_hash: -> { model: String }
|
|
233
|
+
end
|
|
234
|
+
|
|
220
235
|
type prompt_cache_retention = :in_memory | :"24h"
|
|
221
236
|
|
|
222
237
|
module PromptCacheRetention
|
|
@@ -17,6 +17,7 @@ module OpenAI
|
|
|
17
17
|
?max_tokens: Integer?,
|
|
18
18
|
?metadata: OpenAI::Models::metadata?,
|
|
19
19
|
?modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?,
|
|
20
|
+
?moderation: OpenAI::Chat::CompletionCreateParams::Moderation?,
|
|
20
21
|
?n: Integer?,
|
|
21
22
|
?parallel_tool_calls: bool,
|
|
22
23
|
?prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
|
@@ -55,6 +56,7 @@ module OpenAI
|
|
|
55
56
|
?max_tokens: Integer?,
|
|
56
57
|
?metadata: OpenAI::Models::metadata?,
|
|
57
58
|
?modalities: ::Array[OpenAI::Models::Chat::CompletionCreateParams::modality]?,
|
|
59
|
+
?moderation: OpenAI::Chat::CompletionCreateParams::Moderation?,
|
|
58
60
|
?n: Integer?,
|
|
59
61
|
?parallel_tool_calls: bool,
|
|
60
62
|
?prediction: OpenAI::Chat::ChatCompletionPredictionContent?,
|
|
@@ -16,6 +16,7 @@ module OpenAI
|
|
|
16
16
|
?max_tool_calls: Integer?,
|
|
17
17
|
?metadata: OpenAI::Models::metadata?,
|
|
18
18
|
?model: OpenAI::Models::responses_model,
|
|
19
|
+
?moderation: OpenAI::Responses::ResponseCreateParams::Moderation?,
|
|
19
20
|
?parallel_tool_calls: bool?,
|
|
20
21
|
?previous_response_id: String?,
|
|
21
22
|
?prompt: OpenAI::Responses::ResponsePrompt?,
|
|
@@ -48,6 +49,7 @@ module OpenAI
|
|
|
48
49
|
?max_tool_calls: Integer?,
|
|
49
50
|
?metadata: OpenAI::Models::metadata?,
|
|
50
51
|
?model: OpenAI::Models::responses_model,
|
|
52
|
+
?moderation: OpenAI::Responses::ResponseCreateParams::Moderation?,
|
|
51
53
|
?parallel_tool_calls: bool?,
|
|
52
54
|
?previous_response_id: String?,
|
|
53
55
|
?prompt: OpenAI::Responses::ResponsePrompt?,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.66.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAI
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|