moderation_api 2.1.0 → 2.2.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/moderation_api/internal/transport/pooled_net_requester.rb +12 -10
- data/lib/moderation_api/models/content_submit_params.rb +147 -21
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +316 -62
- data/sig/moderation_api/models/content_submit_params.rbs +233 -62
- metadata +2 -2
|
@@ -278,244 +278,408 @@ module ModerationAPI
|
|
|
278
278
|
module Policy
|
|
279
279
|
extend ModerationAPI::Internal::Type::Union
|
|
280
280
|
|
|
281
|
-
type toxicity = { id: :toxicity, flag: bool }
|
|
281
|
+
type toxicity = { id: :toxicity, flag: bool, threshold: Float }
|
|
282
282
|
|
|
283
283
|
class Toxicity < ModerationAPI::Internal::Type::BaseModel
|
|
284
284
|
attr_accessor id: :toxicity
|
|
285
285
|
|
|
286
286
|
attr_accessor flag: bool
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
attr_reader threshold: Float?
|
|
289
289
|
|
|
290
|
-
def
|
|
290
|
+
def threshold=: (Float) -> Float
|
|
291
|
+
|
|
292
|
+
def initialize: (
|
|
293
|
+
flag: bool,
|
|
294
|
+
?threshold: Float,
|
|
295
|
+
?id: :toxicity
|
|
296
|
+
) -> void
|
|
297
|
+
|
|
298
|
+
def to_hash: -> { id: :toxicity, flag: bool, threshold: Float }
|
|
291
299
|
end
|
|
292
300
|
|
|
293
|
-
type personal_information =
|
|
301
|
+
type personal_information =
|
|
302
|
+
{ id: :personal_information, flag: bool, threshold: Float }
|
|
294
303
|
|
|
295
304
|
class PersonalInformation < ModerationAPI::Internal::Type::BaseModel
|
|
296
305
|
attr_accessor id: :personal_information
|
|
297
306
|
|
|
298
307
|
attr_accessor flag: bool
|
|
299
308
|
|
|
300
|
-
|
|
309
|
+
attr_reader threshold: Float?
|
|
310
|
+
|
|
311
|
+
def threshold=: (Float) -> Float
|
|
301
312
|
|
|
302
|
-
def
|
|
313
|
+
def initialize: (
|
|
314
|
+
flag: bool,
|
|
315
|
+
?threshold: Float,
|
|
316
|
+
?id: :personal_information
|
|
317
|
+
) -> void
|
|
318
|
+
|
|
319
|
+
def to_hash: -> {
|
|
320
|
+
id: :personal_information,
|
|
321
|
+
flag: bool,
|
|
322
|
+
threshold: Float
|
|
323
|
+
}
|
|
303
324
|
end
|
|
304
325
|
|
|
305
|
-
type toxicity_severe =
|
|
326
|
+
type toxicity_severe =
|
|
327
|
+
{ id: :toxicity_severe, flag: bool, threshold: Float }
|
|
306
328
|
|
|
307
329
|
class ToxicitySevere < ModerationAPI::Internal::Type::BaseModel
|
|
308
330
|
attr_accessor id: :toxicity_severe
|
|
309
331
|
|
|
310
332
|
attr_accessor flag: bool
|
|
311
333
|
|
|
312
|
-
|
|
334
|
+
attr_reader threshold: Float?
|
|
313
335
|
|
|
314
|
-
def
|
|
336
|
+
def threshold=: (Float) -> Float
|
|
337
|
+
|
|
338
|
+
def initialize: (
|
|
339
|
+
flag: bool,
|
|
340
|
+
?threshold: Float,
|
|
341
|
+
?id: :toxicity_severe
|
|
342
|
+
) -> void
|
|
343
|
+
|
|
344
|
+
def to_hash: -> { id: :toxicity_severe, flag: bool, threshold: Float }
|
|
315
345
|
end
|
|
316
346
|
|
|
317
|
-
type hate = { id: :hate, flag: bool }
|
|
347
|
+
type hate = { id: :hate, flag: bool, threshold: Float }
|
|
318
348
|
|
|
319
349
|
class Hate < ModerationAPI::Internal::Type::BaseModel
|
|
320
350
|
attr_accessor id: :hate
|
|
321
351
|
|
|
322
352
|
attr_accessor flag: bool
|
|
323
353
|
|
|
324
|
-
|
|
354
|
+
attr_reader threshold: Float?
|
|
355
|
+
|
|
356
|
+
def threshold=: (Float) -> Float
|
|
357
|
+
|
|
358
|
+
def initialize: (flag: bool, ?threshold: Float, ?id: :hate) -> void
|
|
325
359
|
|
|
326
|
-
def to_hash: -> { id: :hate, flag: bool }
|
|
360
|
+
def to_hash: -> { id: :hate, flag: bool, threshold: Float }
|
|
327
361
|
end
|
|
328
362
|
|
|
329
|
-
type illicit = { id: :illicit, flag: bool }
|
|
363
|
+
type illicit = { id: :illicit, flag: bool, threshold: Float }
|
|
330
364
|
|
|
331
365
|
class Illicit < ModerationAPI::Internal::Type::BaseModel
|
|
332
366
|
attr_accessor id: :illicit
|
|
333
367
|
|
|
334
368
|
attr_accessor flag: bool
|
|
335
369
|
|
|
336
|
-
|
|
370
|
+
attr_reader threshold: Float?
|
|
337
371
|
|
|
338
|
-
def
|
|
372
|
+
def threshold=: (Float) -> Float
|
|
373
|
+
|
|
374
|
+
def initialize: (flag: bool, ?threshold: Float, ?id: :illicit) -> void
|
|
375
|
+
|
|
376
|
+
def to_hash: -> { id: :illicit, flag: bool, threshold: Float }
|
|
339
377
|
end
|
|
340
378
|
|
|
341
|
-
type illicit_drugs =
|
|
379
|
+
type illicit_drugs =
|
|
380
|
+
{ id: :illicit_drugs, flag: bool, threshold: Float }
|
|
342
381
|
|
|
343
382
|
class IllicitDrugs < ModerationAPI::Internal::Type::BaseModel
|
|
344
383
|
attr_accessor id: :illicit_drugs
|
|
345
384
|
|
|
346
385
|
attr_accessor flag: bool
|
|
347
386
|
|
|
348
|
-
|
|
387
|
+
attr_reader threshold: Float?
|
|
388
|
+
|
|
389
|
+
def threshold=: (Float) -> Float
|
|
349
390
|
|
|
350
|
-
def
|
|
391
|
+
def initialize: (
|
|
392
|
+
flag: bool,
|
|
393
|
+
?threshold: Float,
|
|
394
|
+
?id: :illicit_drugs
|
|
395
|
+
) -> void
|
|
396
|
+
|
|
397
|
+
def to_hash: -> { id: :illicit_drugs, flag: bool, threshold: Float }
|
|
351
398
|
end
|
|
352
399
|
|
|
353
|
-
type illicit_alcohol =
|
|
400
|
+
type illicit_alcohol =
|
|
401
|
+
{ id: :illicit_alcohol, flag: bool, threshold: Float }
|
|
354
402
|
|
|
355
403
|
class IllicitAlcohol < ModerationAPI::Internal::Type::BaseModel
|
|
356
404
|
attr_accessor id: :illicit_alcohol
|
|
357
405
|
|
|
358
406
|
attr_accessor flag: bool
|
|
359
407
|
|
|
360
|
-
|
|
408
|
+
attr_reader threshold: Float?
|
|
409
|
+
|
|
410
|
+
def threshold=: (Float) -> Float
|
|
361
411
|
|
|
362
|
-
def
|
|
412
|
+
def initialize: (
|
|
413
|
+
flag: bool,
|
|
414
|
+
?threshold: Float,
|
|
415
|
+
?id: :illicit_alcohol
|
|
416
|
+
) -> void
|
|
417
|
+
|
|
418
|
+
def to_hash: -> { id: :illicit_alcohol, flag: bool, threshold: Float }
|
|
363
419
|
end
|
|
364
420
|
|
|
365
|
-
type illicit_firearms =
|
|
421
|
+
type illicit_firearms =
|
|
422
|
+
{ id: :illicit_firearms, flag: bool, threshold: Float }
|
|
366
423
|
|
|
367
424
|
class IllicitFirearms < ModerationAPI::Internal::Type::BaseModel
|
|
368
425
|
attr_accessor id: :illicit_firearms
|
|
369
426
|
|
|
370
427
|
attr_accessor flag: bool
|
|
371
428
|
|
|
372
|
-
|
|
429
|
+
attr_reader threshold: Float?
|
|
430
|
+
|
|
431
|
+
def threshold=: (Float) -> Float
|
|
373
432
|
|
|
374
|
-
def
|
|
433
|
+
def initialize: (
|
|
434
|
+
flag: bool,
|
|
435
|
+
?threshold: Float,
|
|
436
|
+
?id: :illicit_firearms
|
|
437
|
+
) -> void
|
|
438
|
+
|
|
439
|
+
def to_hash: -> {
|
|
440
|
+
id: :illicit_firearms,
|
|
441
|
+
flag: bool,
|
|
442
|
+
threshold: Float
|
|
443
|
+
}
|
|
375
444
|
end
|
|
376
445
|
|
|
377
|
-
type illicit_tobacco =
|
|
446
|
+
type illicit_tobacco =
|
|
447
|
+
{ id: :illicit_tobacco, flag: bool, threshold: Float }
|
|
378
448
|
|
|
379
449
|
class IllicitTobacco < ModerationAPI::Internal::Type::BaseModel
|
|
380
450
|
attr_accessor id: :illicit_tobacco
|
|
381
451
|
|
|
382
452
|
attr_accessor flag: bool
|
|
383
453
|
|
|
384
|
-
|
|
454
|
+
attr_reader threshold: Float?
|
|
455
|
+
|
|
456
|
+
def threshold=: (Float) -> Float
|
|
457
|
+
|
|
458
|
+
def initialize: (
|
|
459
|
+
flag: bool,
|
|
460
|
+
?threshold: Float,
|
|
461
|
+
?id: :illicit_tobacco
|
|
462
|
+
) -> void
|
|
385
463
|
|
|
386
|
-
def to_hash: -> { id: :illicit_tobacco, flag: bool }
|
|
464
|
+
def to_hash: -> { id: :illicit_tobacco, flag: bool, threshold: Float }
|
|
387
465
|
end
|
|
388
466
|
|
|
389
|
-
type illicit_gambling =
|
|
467
|
+
type illicit_gambling =
|
|
468
|
+
{ id: :illicit_gambling, flag: bool, threshold: Float }
|
|
390
469
|
|
|
391
470
|
class IllicitGambling < ModerationAPI::Internal::Type::BaseModel
|
|
392
471
|
attr_accessor id: :illicit_gambling
|
|
393
472
|
|
|
394
473
|
attr_accessor flag: bool
|
|
395
474
|
|
|
396
|
-
|
|
475
|
+
attr_reader threshold: Float?
|
|
397
476
|
|
|
398
|
-
def
|
|
477
|
+
def threshold=: (Float) -> Float
|
|
478
|
+
|
|
479
|
+
def initialize: (
|
|
480
|
+
flag: bool,
|
|
481
|
+
?threshold: Float,
|
|
482
|
+
?id: :illicit_gambling
|
|
483
|
+
) -> void
|
|
484
|
+
|
|
485
|
+
def to_hash: -> {
|
|
486
|
+
id: :illicit_gambling,
|
|
487
|
+
flag: bool,
|
|
488
|
+
threshold: Float
|
|
489
|
+
}
|
|
399
490
|
end
|
|
400
491
|
|
|
401
|
-
type sexual = { id: :sexual, flag: bool }
|
|
492
|
+
type sexual = { id: :sexual, flag: bool, threshold: Float }
|
|
402
493
|
|
|
403
494
|
class Sexual < ModerationAPI::Internal::Type::BaseModel
|
|
404
495
|
attr_accessor id: :sexual
|
|
405
496
|
|
|
406
497
|
attr_accessor flag: bool
|
|
407
498
|
|
|
408
|
-
|
|
499
|
+
attr_reader threshold: Float?
|
|
500
|
+
|
|
501
|
+
def threshold=: (Float) -> Float
|
|
502
|
+
|
|
503
|
+
def initialize: (flag: bool, ?threshold: Float, ?id: :sexual) -> void
|
|
409
504
|
|
|
410
|
-
def to_hash: -> { id: :sexual, flag: bool }
|
|
505
|
+
def to_hash: -> { id: :sexual, flag: bool, threshold: Float }
|
|
411
506
|
end
|
|
412
507
|
|
|
413
|
-
type flirtation = { id: :flirtation, flag: bool }
|
|
508
|
+
type flirtation = { id: :flirtation, flag: bool, threshold: Float }
|
|
414
509
|
|
|
415
510
|
class Flirtation < ModerationAPI::Internal::Type::BaseModel
|
|
416
511
|
attr_accessor id: :flirtation
|
|
417
512
|
|
|
418
513
|
attr_accessor flag: bool
|
|
419
514
|
|
|
420
|
-
|
|
515
|
+
attr_reader threshold: Float?
|
|
421
516
|
|
|
422
|
-
def
|
|
517
|
+
def threshold=: (Float) -> Float
|
|
518
|
+
|
|
519
|
+
def initialize: (
|
|
520
|
+
flag: bool,
|
|
521
|
+
?threshold: Float,
|
|
522
|
+
?id: :flirtation
|
|
523
|
+
) -> void
|
|
524
|
+
|
|
525
|
+
def to_hash: -> { id: :flirtation, flag: bool, threshold: Float }
|
|
423
526
|
end
|
|
424
527
|
|
|
425
|
-
type profanity = { id: :profanity, flag: bool }
|
|
528
|
+
type profanity = { id: :profanity, flag: bool, threshold: Float }
|
|
426
529
|
|
|
427
530
|
class Profanity < ModerationAPI::Internal::Type::BaseModel
|
|
428
531
|
attr_accessor id: :profanity
|
|
429
532
|
|
|
430
533
|
attr_accessor flag: bool
|
|
431
534
|
|
|
432
|
-
|
|
535
|
+
attr_reader threshold: Float?
|
|
536
|
+
|
|
537
|
+
def threshold=: (Float) -> Float
|
|
433
538
|
|
|
434
|
-
def
|
|
539
|
+
def initialize: (
|
|
540
|
+
flag: bool,
|
|
541
|
+
?threshold: Float,
|
|
542
|
+
?id: :profanity
|
|
543
|
+
) -> void
|
|
544
|
+
|
|
545
|
+
def to_hash: -> { id: :profanity, flag: bool, threshold: Float }
|
|
435
546
|
end
|
|
436
547
|
|
|
437
|
-
type violence = { id: :violence, flag: bool }
|
|
548
|
+
type violence = { id: :violence, flag: bool, threshold: Float }
|
|
438
549
|
|
|
439
550
|
class Violence < ModerationAPI::Internal::Type::BaseModel
|
|
440
551
|
attr_accessor id: :violence
|
|
441
552
|
|
|
442
553
|
attr_accessor flag: bool
|
|
443
554
|
|
|
444
|
-
|
|
555
|
+
attr_reader threshold: Float?
|
|
556
|
+
|
|
557
|
+
def threshold=: (Float) -> Float
|
|
558
|
+
|
|
559
|
+
def initialize: (
|
|
560
|
+
flag: bool,
|
|
561
|
+
?threshold: Float,
|
|
562
|
+
?id: :violence
|
|
563
|
+
) -> void
|
|
445
564
|
|
|
446
|
-
def to_hash: -> { id: :violence, flag: bool }
|
|
565
|
+
def to_hash: -> { id: :violence, flag: bool, threshold: Float }
|
|
447
566
|
end
|
|
448
567
|
|
|
449
|
-
type self_harm = { id: :self_harm, flag: bool }
|
|
568
|
+
type self_harm = { id: :self_harm, flag: bool, threshold: Float }
|
|
450
569
|
|
|
451
570
|
class SelfHarm < ModerationAPI::Internal::Type::BaseModel
|
|
452
571
|
attr_accessor id: :self_harm
|
|
453
572
|
|
|
454
573
|
attr_accessor flag: bool
|
|
455
574
|
|
|
456
|
-
|
|
575
|
+
attr_reader threshold: Float?
|
|
457
576
|
|
|
458
|
-
def
|
|
577
|
+
def threshold=: (Float) -> Float
|
|
578
|
+
|
|
579
|
+
def initialize: (
|
|
580
|
+
flag: bool,
|
|
581
|
+
?threshold: Float,
|
|
582
|
+
?id: :self_harm
|
|
583
|
+
) -> void
|
|
584
|
+
|
|
585
|
+
def to_hash: -> { id: :self_harm, flag: bool, threshold: Float }
|
|
459
586
|
end
|
|
460
587
|
|
|
461
|
-
type spam = { id: :spam, flag: bool }
|
|
588
|
+
type spam = { id: :spam, flag: bool, threshold: Float }
|
|
462
589
|
|
|
463
590
|
class Spam < ModerationAPI::Internal::Type::BaseModel
|
|
464
591
|
attr_accessor id: :spam
|
|
465
592
|
|
|
466
593
|
attr_accessor flag: bool
|
|
467
594
|
|
|
468
|
-
|
|
595
|
+
attr_reader threshold: Float?
|
|
596
|
+
|
|
597
|
+
def threshold=: (Float) -> Float
|
|
469
598
|
|
|
470
|
-
def
|
|
599
|
+
def initialize: (flag: bool, ?threshold: Float, ?id: :spam) -> void
|
|
600
|
+
|
|
601
|
+
def to_hash: -> { id: :spam, flag: bool, threshold: Float }
|
|
471
602
|
end
|
|
472
603
|
|
|
473
|
-
type self_promotion =
|
|
604
|
+
type self_promotion =
|
|
605
|
+
{ id: :self_promotion, flag: bool, threshold: Float }
|
|
474
606
|
|
|
475
607
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
476
608
|
attr_accessor id: :self_promotion
|
|
477
609
|
|
|
478
610
|
attr_accessor flag: bool
|
|
479
611
|
|
|
480
|
-
|
|
612
|
+
attr_reader threshold: Float?
|
|
613
|
+
|
|
614
|
+
def threshold=: (Float) -> Float
|
|
481
615
|
|
|
482
|
-
def
|
|
616
|
+
def initialize: (
|
|
617
|
+
flag: bool,
|
|
618
|
+
?threshold: Float,
|
|
619
|
+
?id: :self_promotion
|
|
620
|
+
) -> void
|
|
621
|
+
|
|
622
|
+
def to_hash: -> { id: :self_promotion, flag: bool, threshold: Float }
|
|
483
623
|
end
|
|
484
624
|
|
|
485
|
-
type political = { id: :political, flag: bool }
|
|
625
|
+
type political = { id: :political, flag: bool, threshold: Float }
|
|
486
626
|
|
|
487
627
|
class Political < ModerationAPI::Internal::Type::BaseModel
|
|
488
628
|
attr_accessor id: :political
|
|
489
629
|
|
|
490
630
|
attr_accessor flag: bool
|
|
491
631
|
|
|
492
|
-
|
|
632
|
+
attr_reader threshold: Float?
|
|
633
|
+
|
|
634
|
+
def threshold=: (Float) -> Float
|
|
493
635
|
|
|
494
|
-
def
|
|
636
|
+
def initialize: (
|
|
637
|
+
flag: bool,
|
|
638
|
+
?threshold: Float,
|
|
639
|
+
?id: :political
|
|
640
|
+
) -> void
|
|
641
|
+
|
|
642
|
+
def to_hash: -> { id: :political, flag: bool, threshold: Float }
|
|
495
643
|
end
|
|
496
644
|
|
|
497
|
-
type religion = { id: :religion, flag: bool }
|
|
645
|
+
type religion = { id: :religion, flag: bool, threshold: Float }
|
|
498
646
|
|
|
499
647
|
class Religion < ModerationAPI::Internal::Type::BaseModel
|
|
500
648
|
attr_accessor id: :religion
|
|
501
649
|
|
|
502
650
|
attr_accessor flag: bool
|
|
503
651
|
|
|
504
|
-
|
|
652
|
+
attr_reader threshold: Float?
|
|
653
|
+
|
|
654
|
+
def threshold=: (Float) -> Float
|
|
505
655
|
|
|
506
|
-
def
|
|
656
|
+
def initialize: (
|
|
657
|
+
flag: bool,
|
|
658
|
+
?threshold: Float,
|
|
659
|
+
?id: :religion
|
|
660
|
+
) -> void
|
|
661
|
+
|
|
662
|
+
def to_hash: -> { id: :religion, flag: bool, threshold: Float }
|
|
507
663
|
end
|
|
508
664
|
|
|
509
|
-
type code_abuse = { id: :code_abuse, flag: bool }
|
|
665
|
+
type code_abuse = { id: :code_abuse, flag: bool, threshold: Float }
|
|
510
666
|
|
|
511
667
|
class CodeAbuse < ModerationAPI::Internal::Type::BaseModel
|
|
512
668
|
attr_accessor id: :code_abuse
|
|
513
669
|
|
|
514
670
|
attr_accessor flag: bool
|
|
515
671
|
|
|
516
|
-
|
|
672
|
+
attr_reader threshold: Float?
|
|
673
|
+
|
|
674
|
+
def threshold=: (Float) -> Float
|
|
675
|
+
|
|
676
|
+
def initialize: (
|
|
677
|
+
flag: bool,
|
|
678
|
+
?threshold: Float,
|
|
679
|
+
?id: :code_abuse
|
|
680
|
+
) -> void
|
|
517
681
|
|
|
518
|
-
def to_hash: -> { id: :code_abuse, flag: bool }
|
|
682
|
+
def to_hash: -> { id: :code_abuse, flag: bool, threshold: Float }
|
|
519
683
|
end
|
|
520
684
|
|
|
521
685
|
type pii_masking =
|
|
@@ -699,7 +863,8 @@ module ModerationAPI
|
|
|
699
863
|
id: :guideline,
|
|
700
864
|
flag: bool,
|
|
701
865
|
guideline_key: String,
|
|
702
|
-
instructions: String
|
|
866
|
+
instructions: String,
|
|
867
|
+
threshold: Float
|
|
703
868
|
}
|
|
704
869
|
|
|
705
870
|
class Guideline < ModerationAPI::Internal::Type::BaseModel
|
|
@@ -711,10 +876,15 @@ module ModerationAPI
|
|
|
711
876
|
|
|
712
877
|
attr_accessor instructions: String
|
|
713
878
|
|
|
879
|
+
attr_reader threshold: Float?
|
|
880
|
+
|
|
881
|
+
def threshold=: (Float) -> Float
|
|
882
|
+
|
|
714
883
|
def initialize: (
|
|
715
884
|
flag: bool,
|
|
716
885
|
guideline_key: String,
|
|
717
886
|
instructions: String,
|
|
887
|
+
?threshold: Float,
|
|
718
888
|
?id: :guideline
|
|
719
889
|
) -> void
|
|
720
890
|
|
|
@@ -722,7 +892,8 @@ module ModerationAPI
|
|
|
722
892
|
id: :guideline,
|
|
723
893
|
flag: bool,
|
|
724
894
|
guideline_key: String,
|
|
725
|
-
instructions: String
|
|
895
|
+
instructions: String,
|
|
896
|
+
threshold: Float
|
|
726
897
|
}
|
|
727
898
|
end
|
|
728
899
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moderation_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Moderation API
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-12-
|
|
11
|
+
date: 2025-12-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|