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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 827c90a7b9d7506f91a748ff015ecf9390bdd34299130a663fdd475167e9ea7b
|
|
4
|
+
data.tar.gz: 88f007cd6ecce1115e012c624a75329b1d196a14625a293c9eca26c81d9ad815
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b1592f0d49584f0e4ff057c5d3e6e4e326b9ecc677252cecad62550227cce438d5b461066339296e18ef49d6a91c0db220d840fce8cea88988a5a35c8840d6f
|
|
7
|
+
data.tar.gz: fc0916efaf0d817ead73857d4b9949ea17e5d14c17362e82f68269620b702211df85b297b0c727a64ae3a7ba3a155ccc7ff6bed3f1ef9f96f3466a0fed971fb4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.2.0 (2025-12-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.1.1...v2.2.0](https://github.com/moderation-api/sdk-ruby/compare/v2.1.1...v2.2.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([37d5a3d](https://github.com/moderation-api/sdk-ruby/commit/37d5a3d6185eaddfce7a79d9b4799568d694782a))
|
|
10
|
+
|
|
11
|
+
## 2.1.1 (2025-12-17)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v2.1.0...v2.1.1](https://github.com/moderation-api/sdk-ruby/compare/v2.1.0...v2.1.1)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* calling `break` out of streams should be instantaneous ([eda0e72](https://github.com/moderation-api/sdk-ruby/commit/eda0e7289053ab2cd25c0c065c5df69d30d0831f))
|
|
18
|
+
|
|
3
19
|
## 2.1.0 (2025-12-06)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v2.0.1...v2.1.0](https://github.com/moderation-api/sdk-ruby/compare/v2.0.1...v2.1.0)
|
data/README.md
CHANGED
|
@@ -153,17 +153,19 @@ module ModerationAPI
|
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
::Kernel.catch(:jump) do
|
|
157
|
+
conn.request(req) do |rsp|
|
|
158
|
+
y << [req, rsp]
|
|
159
|
+
::Kernel.throw(:jump) if finished
|
|
160
|
+
|
|
161
|
+
rsp.read_body do |bytes|
|
|
162
|
+
y << bytes.force_encoding(Encoding::BINARY)
|
|
163
|
+
::Kernel.throw(:jump) if finished
|
|
164
|
+
|
|
165
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
166
|
+
end
|
|
167
|
+
eof = true
|
|
165
168
|
end
|
|
166
|
-
eof = true
|
|
167
169
|
end
|
|
168
170
|
end
|
|
169
171
|
ensure
|
|
@@ -388,8 +388,14 @@ module ModerationAPI
|
|
|
388
388
|
# @return [Boolean]
|
|
389
389
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
390
390
|
|
|
391
|
-
# @!
|
|
391
|
+
# @!attribute threshold
|
|
392
|
+
#
|
|
393
|
+
# @return [Float, nil]
|
|
394
|
+
optional :threshold, Float
|
|
395
|
+
|
|
396
|
+
# @!method initialize(flag:, threshold: nil, id: :toxicity)
|
|
392
397
|
# @param flag [Boolean]
|
|
398
|
+
# @param threshold [Float]
|
|
393
399
|
# @param id [Symbol, :toxicity]
|
|
394
400
|
end
|
|
395
401
|
|
|
@@ -404,8 +410,14 @@ module ModerationAPI
|
|
|
404
410
|
# @return [Boolean]
|
|
405
411
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
406
412
|
|
|
407
|
-
# @!
|
|
413
|
+
# @!attribute threshold
|
|
414
|
+
#
|
|
415
|
+
# @return [Float, nil]
|
|
416
|
+
optional :threshold, Float
|
|
417
|
+
|
|
418
|
+
# @!method initialize(flag:, threshold: nil, id: :personal_information)
|
|
408
419
|
# @param flag [Boolean]
|
|
420
|
+
# @param threshold [Float]
|
|
409
421
|
# @param id [Symbol, :personal_information]
|
|
410
422
|
end
|
|
411
423
|
|
|
@@ -420,8 +432,14 @@ module ModerationAPI
|
|
|
420
432
|
# @return [Boolean]
|
|
421
433
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
422
434
|
|
|
423
|
-
# @!
|
|
435
|
+
# @!attribute threshold
|
|
436
|
+
#
|
|
437
|
+
# @return [Float, nil]
|
|
438
|
+
optional :threshold, Float
|
|
439
|
+
|
|
440
|
+
# @!method initialize(flag:, threshold: nil, id: :toxicity_severe)
|
|
424
441
|
# @param flag [Boolean]
|
|
442
|
+
# @param threshold [Float]
|
|
425
443
|
# @param id [Symbol, :toxicity_severe]
|
|
426
444
|
end
|
|
427
445
|
|
|
@@ -436,8 +454,14 @@ module ModerationAPI
|
|
|
436
454
|
# @return [Boolean]
|
|
437
455
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
438
456
|
|
|
439
|
-
# @!
|
|
457
|
+
# @!attribute threshold
|
|
458
|
+
#
|
|
459
|
+
# @return [Float, nil]
|
|
460
|
+
optional :threshold, Float
|
|
461
|
+
|
|
462
|
+
# @!method initialize(flag:, threshold: nil, id: :hate)
|
|
440
463
|
# @param flag [Boolean]
|
|
464
|
+
# @param threshold [Float]
|
|
441
465
|
# @param id [Symbol, :hate]
|
|
442
466
|
end
|
|
443
467
|
|
|
@@ -452,8 +476,14 @@ module ModerationAPI
|
|
|
452
476
|
# @return [Boolean]
|
|
453
477
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
454
478
|
|
|
455
|
-
# @!
|
|
479
|
+
# @!attribute threshold
|
|
480
|
+
#
|
|
481
|
+
# @return [Float, nil]
|
|
482
|
+
optional :threshold, Float
|
|
483
|
+
|
|
484
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit)
|
|
456
485
|
# @param flag [Boolean]
|
|
486
|
+
# @param threshold [Float]
|
|
457
487
|
# @param id [Symbol, :illicit]
|
|
458
488
|
end
|
|
459
489
|
|
|
@@ -468,8 +498,14 @@ module ModerationAPI
|
|
|
468
498
|
# @return [Boolean]
|
|
469
499
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
470
500
|
|
|
471
|
-
# @!
|
|
501
|
+
# @!attribute threshold
|
|
502
|
+
#
|
|
503
|
+
# @return [Float, nil]
|
|
504
|
+
optional :threshold, Float
|
|
505
|
+
|
|
506
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit_drugs)
|
|
472
507
|
# @param flag [Boolean]
|
|
508
|
+
# @param threshold [Float]
|
|
473
509
|
# @param id [Symbol, :illicit_drugs]
|
|
474
510
|
end
|
|
475
511
|
|
|
@@ -484,8 +520,14 @@ module ModerationAPI
|
|
|
484
520
|
# @return [Boolean]
|
|
485
521
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
486
522
|
|
|
487
|
-
# @!
|
|
523
|
+
# @!attribute threshold
|
|
524
|
+
#
|
|
525
|
+
# @return [Float, nil]
|
|
526
|
+
optional :threshold, Float
|
|
527
|
+
|
|
528
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit_alcohol)
|
|
488
529
|
# @param flag [Boolean]
|
|
530
|
+
# @param threshold [Float]
|
|
489
531
|
# @param id [Symbol, :illicit_alcohol]
|
|
490
532
|
end
|
|
491
533
|
|
|
@@ -500,8 +542,14 @@ module ModerationAPI
|
|
|
500
542
|
# @return [Boolean]
|
|
501
543
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
502
544
|
|
|
503
|
-
# @!
|
|
545
|
+
# @!attribute threshold
|
|
546
|
+
#
|
|
547
|
+
# @return [Float, nil]
|
|
548
|
+
optional :threshold, Float
|
|
549
|
+
|
|
550
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit_firearms)
|
|
504
551
|
# @param flag [Boolean]
|
|
552
|
+
# @param threshold [Float]
|
|
505
553
|
# @param id [Symbol, :illicit_firearms]
|
|
506
554
|
end
|
|
507
555
|
|
|
@@ -516,8 +564,14 @@ module ModerationAPI
|
|
|
516
564
|
# @return [Boolean]
|
|
517
565
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
518
566
|
|
|
519
|
-
# @!
|
|
567
|
+
# @!attribute threshold
|
|
568
|
+
#
|
|
569
|
+
# @return [Float, nil]
|
|
570
|
+
optional :threshold, Float
|
|
571
|
+
|
|
572
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit_tobacco)
|
|
520
573
|
# @param flag [Boolean]
|
|
574
|
+
# @param threshold [Float]
|
|
521
575
|
# @param id [Symbol, :illicit_tobacco]
|
|
522
576
|
end
|
|
523
577
|
|
|
@@ -532,8 +586,14 @@ module ModerationAPI
|
|
|
532
586
|
# @return [Boolean]
|
|
533
587
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
534
588
|
|
|
535
|
-
# @!
|
|
589
|
+
# @!attribute threshold
|
|
590
|
+
#
|
|
591
|
+
# @return [Float, nil]
|
|
592
|
+
optional :threshold, Float
|
|
593
|
+
|
|
594
|
+
# @!method initialize(flag:, threshold: nil, id: :illicit_gambling)
|
|
536
595
|
# @param flag [Boolean]
|
|
596
|
+
# @param threshold [Float]
|
|
537
597
|
# @param id [Symbol, :illicit_gambling]
|
|
538
598
|
end
|
|
539
599
|
|
|
@@ -548,8 +608,14 @@ module ModerationAPI
|
|
|
548
608
|
# @return [Boolean]
|
|
549
609
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
550
610
|
|
|
551
|
-
# @!
|
|
611
|
+
# @!attribute threshold
|
|
612
|
+
#
|
|
613
|
+
# @return [Float, nil]
|
|
614
|
+
optional :threshold, Float
|
|
615
|
+
|
|
616
|
+
# @!method initialize(flag:, threshold: nil, id: :sexual)
|
|
552
617
|
# @param flag [Boolean]
|
|
618
|
+
# @param threshold [Float]
|
|
553
619
|
# @param id [Symbol, :sexual]
|
|
554
620
|
end
|
|
555
621
|
|
|
@@ -564,8 +630,14 @@ module ModerationAPI
|
|
|
564
630
|
# @return [Boolean]
|
|
565
631
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
566
632
|
|
|
567
|
-
# @!
|
|
633
|
+
# @!attribute threshold
|
|
634
|
+
#
|
|
635
|
+
# @return [Float, nil]
|
|
636
|
+
optional :threshold, Float
|
|
637
|
+
|
|
638
|
+
# @!method initialize(flag:, threshold: nil, id: :flirtation)
|
|
568
639
|
# @param flag [Boolean]
|
|
640
|
+
# @param threshold [Float]
|
|
569
641
|
# @param id [Symbol, :flirtation]
|
|
570
642
|
end
|
|
571
643
|
|
|
@@ -580,8 +652,14 @@ module ModerationAPI
|
|
|
580
652
|
# @return [Boolean]
|
|
581
653
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
582
654
|
|
|
583
|
-
# @!
|
|
655
|
+
# @!attribute threshold
|
|
656
|
+
#
|
|
657
|
+
# @return [Float, nil]
|
|
658
|
+
optional :threshold, Float
|
|
659
|
+
|
|
660
|
+
# @!method initialize(flag:, threshold: nil, id: :profanity)
|
|
584
661
|
# @param flag [Boolean]
|
|
662
|
+
# @param threshold [Float]
|
|
585
663
|
# @param id [Symbol, :profanity]
|
|
586
664
|
end
|
|
587
665
|
|
|
@@ -596,8 +674,14 @@ module ModerationAPI
|
|
|
596
674
|
# @return [Boolean]
|
|
597
675
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
598
676
|
|
|
599
|
-
# @!
|
|
677
|
+
# @!attribute threshold
|
|
678
|
+
#
|
|
679
|
+
# @return [Float, nil]
|
|
680
|
+
optional :threshold, Float
|
|
681
|
+
|
|
682
|
+
# @!method initialize(flag:, threshold: nil, id: :violence)
|
|
600
683
|
# @param flag [Boolean]
|
|
684
|
+
# @param threshold [Float]
|
|
601
685
|
# @param id [Symbol, :violence]
|
|
602
686
|
end
|
|
603
687
|
|
|
@@ -612,8 +696,14 @@ module ModerationAPI
|
|
|
612
696
|
# @return [Boolean]
|
|
613
697
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
614
698
|
|
|
615
|
-
# @!
|
|
699
|
+
# @!attribute threshold
|
|
700
|
+
#
|
|
701
|
+
# @return [Float, nil]
|
|
702
|
+
optional :threshold, Float
|
|
703
|
+
|
|
704
|
+
# @!method initialize(flag:, threshold: nil, id: :self_harm)
|
|
616
705
|
# @param flag [Boolean]
|
|
706
|
+
# @param threshold [Float]
|
|
617
707
|
# @param id [Symbol, :self_harm]
|
|
618
708
|
end
|
|
619
709
|
|
|
@@ -628,8 +718,14 @@ module ModerationAPI
|
|
|
628
718
|
# @return [Boolean]
|
|
629
719
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
630
720
|
|
|
631
|
-
# @!
|
|
721
|
+
# @!attribute threshold
|
|
722
|
+
#
|
|
723
|
+
# @return [Float, nil]
|
|
724
|
+
optional :threshold, Float
|
|
725
|
+
|
|
726
|
+
# @!method initialize(flag:, threshold: nil, id: :spam)
|
|
632
727
|
# @param flag [Boolean]
|
|
728
|
+
# @param threshold [Float]
|
|
633
729
|
# @param id [Symbol, :spam]
|
|
634
730
|
end
|
|
635
731
|
|
|
@@ -644,8 +740,14 @@ module ModerationAPI
|
|
|
644
740
|
# @return [Boolean]
|
|
645
741
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
646
742
|
|
|
647
|
-
# @!
|
|
743
|
+
# @!attribute threshold
|
|
744
|
+
#
|
|
745
|
+
# @return [Float, nil]
|
|
746
|
+
optional :threshold, Float
|
|
747
|
+
|
|
748
|
+
# @!method initialize(flag:, threshold: nil, id: :self_promotion)
|
|
648
749
|
# @param flag [Boolean]
|
|
750
|
+
# @param threshold [Float]
|
|
649
751
|
# @param id [Symbol, :self_promotion]
|
|
650
752
|
end
|
|
651
753
|
|
|
@@ -660,8 +762,14 @@ module ModerationAPI
|
|
|
660
762
|
# @return [Boolean]
|
|
661
763
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
662
764
|
|
|
663
|
-
# @!
|
|
765
|
+
# @!attribute threshold
|
|
766
|
+
#
|
|
767
|
+
# @return [Float, nil]
|
|
768
|
+
optional :threshold, Float
|
|
769
|
+
|
|
770
|
+
# @!method initialize(flag:, threshold: nil, id: :political)
|
|
664
771
|
# @param flag [Boolean]
|
|
772
|
+
# @param threshold [Float]
|
|
665
773
|
# @param id [Symbol, :political]
|
|
666
774
|
end
|
|
667
775
|
|
|
@@ -676,8 +784,14 @@ module ModerationAPI
|
|
|
676
784
|
# @return [Boolean]
|
|
677
785
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
678
786
|
|
|
679
|
-
# @!
|
|
787
|
+
# @!attribute threshold
|
|
788
|
+
#
|
|
789
|
+
# @return [Float, nil]
|
|
790
|
+
optional :threshold, Float
|
|
791
|
+
|
|
792
|
+
# @!method initialize(flag:, threshold: nil, id: :religion)
|
|
680
793
|
# @param flag [Boolean]
|
|
794
|
+
# @param threshold [Float]
|
|
681
795
|
# @param id [Symbol, :religion]
|
|
682
796
|
end
|
|
683
797
|
|
|
@@ -692,8 +806,14 @@ module ModerationAPI
|
|
|
692
806
|
# @return [Boolean]
|
|
693
807
|
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
694
808
|
|
|
695
|
-
# @!
|
|
809
|
+
# @!attribute threshold
|
|
810
|
+
#
|
|
811
|
+
# @return [Float, nil]
|
|
812
|
+
optional :threshold, Float
|
|
813
|
+
|
|
814
|
+
# @!method initialize(flag:, threshold: nil, id: :code_abuse)
|
|
696
815
|
# @param flag [Boolean]
|
|
816
|
+
# @param threshold [Float]
|
|
697
817
|
# @param id [Symbol, :code_abuse]
|
|
698
818
|
end
|
|
699
819
|
|
|
@@ -856,10 +976,16 @@ module ModerationAPI
|
|
|
856
976
|
# @return [String]
|
|
857
977
|
required :instructions, String
|
|
858
978
|
|
|
859
|
-
# @!
|
|
979
|
+
# @!attribute threshold
|
|
980
|
+
#
|
|
981
|
+
# @return [Float, nil]
|
|
982
|
+
optional :threshold, Float
|
|
983
|
+
|
|
984
|
+
# @!method initialize(flag:, guideline_key:, instructions:, threshold: nil, id: :guideline)
|
|
860
985
|
# @param flag [Boolean]
|
|
861
986
|
# @param guideline_key [String]
|
|
862
987
|
# @param instructions [String]
|
|
988
|
+
# @param threshold [Float]
|
|
863
989
|
# @param id [Symbol, :guideline]
|
|
864
990
|
end
|
|
865
991
|
|