moderation_api 2.18.0 → 2.20.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/models/content_submit_params.rb +104 -3
- data/lib/moderation_api/models/content_submit_response.rb +14 -1
- data/lib/moderation_api/resources/content.rb +1 -1
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +194 -0
- data/rbi/moderation_api/models/content_submit_response.rbi +13 -0
- data/rbi/moderation_api/resources/content.rbi +2 -0
- data/sig/moderation_api/models/content_submit_params.rbs +89 -0
- data/sig/moderation_api/models/content_submit_response.rbs +7 -0
- 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: bb51c2dd8cbf252b7777f03017d7d3b4b3afc2a204113f917a40704e8789b5e3
|
|
4
|
+
data.tar.gz: 67a4613735a19a3c93b42a75f74d5468c29760ee6902e2147d56878d94d79008
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e0af9a126dcf53dd8d3a33a8a1f7f22c3ec1bbde86b735404d7954c9ff07a799b721b5785212c01d1403eb8f861b2786d52d5bf6e352e555aa2f29fefb114c7
|
|
7
|
+
data.tar.gz: bb6320deed400febf5e17485a176a0e3acf0ac0d3a4715e664de2a7215d5c5d74294c26dc4d47987982db6a3ebbfe980acb0ef30bec2cdb77c1364d3a67b16ef
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.20.0 (2026-06-01)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.19.0...v2.20.0](https://github.com/moderation-api/sdk-ruby/compare/v2.19.0...v2.20.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([8ec8a3d](https://github.com/moderation-api/sdk-ruby/commit/8ec8a3dcbca0c79346a06743395b61214f299bb4))
|
|
10
|
+
|
|
11
|
+
## 2.19.0 (2026-06-01)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v2.18.0...v2.19.0](https://github.com/moderation-api/sdk-ruby/compare/v2.18.0...v2.19.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([c97f9da](https://github.com/moderation-api/sdk-ruby/commit/c97f9da47da0c1ce96b1ef07836273e1ba398ac8))
|
|
18
|
+
|
|
3
19
|
## 2.18.0 (2026-05-19)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v2.17.1...v2.18.0](https://github.com/moderation-api/sdk-ruby/compare/v2.17.1...v2.18.0)
|
data/README.md
CHANGED
|
@@ -59,7 +59,7 @@ module ModerationAPI
|
|
|
59
59
|
# @!attribute policies
|
|
60
60
|
# (Enterprise) override the channel policies for this moderation request only.
|
|
61
61
|
#
|
|
62
|
-
# @return [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>, nil]
|
|
62
|
+
# @return [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>, nil]
|
|
63
63
|
optional :policies,
|
|
64
64
|
-> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::ContentSubmitParams::Policy] }
|
|
65
65
|
|
|
@@ -90,7 +90,7 @@ module ModerationAPI
|
|
|
90
90
|
#
|
|
91
91
|
# @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated
|
|
92
92
|
#
|
|
93
|
-
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
93
|
+
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
94
94
|
#
|
|
95
95
|
# @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
96
96
|
#
|
|
@@ -403,6 +403,10 @@ module ModerationAPI
|
|
|
403
403
|
|
|
404
404
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Spam }
|
|
405
405
|
|
|
406
|
+
variant -> { ModerationAPI::ContentSubmitParams::Policy::LowQualityContent }
|
|
407
|
+
|
|
408
|
+
variant -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection }
|
|
409
|
+
|
|
406
410
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::SelfPromotion }
|
|
407
411
|
|
|
408
412
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Political }
|
|
@@ -837,6 +841,103 @@ module ModerationAPI
|
|
|
837
841
|
# @param id [Symbol, :spam]
|
|
838
842
|
end
|
|
839
843
|
|
|
844
|
+
class LowQualityContent < ModerationAPI::Internal::Type::BaseModel
|
|
845
|
+
# @!attribute id
|
|
846
|
+
#
|
|
847
|
+
# @return [Symbol, :low_quality]
|
|
848
|
+
required :id, const: :low_quality
|
|
849
|
+
|
|
850
|
+
# @!attribute flag
|
|
851
|
+
#
|
|
852
|
+
# @return [Boolean]
|
|
853
|
+
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
854
|
+
|
|
855
|
+
# @!attribute min_words
|
|
856
|
+
# Flag content with fewer than this many words as low-effort. Defaults to 3. Set
|
|
857
|
+
# to disable by omitting.
|
|
858
|
+
#
|
|
859
|
+
# @return [Integer, nil]
|
|
860
|
+
optional :min_words, Integer, api_name: :minWords
|
|
861
|
+
|
|
862
|
+
# @!attribute threshold
|
|
863
|
+
#
|
|
864
|
+
# @return [Float, nil]
|
|
865
|
+
optional :threshold, Float
|
|
866
|
+
|
|
867
|
+
# @!method initialize(flag:, min_words: nil, threshold: nil, id: :low_quality)
|
|
868
|
+
# Some parameter documentations has been truncated, see
|
|
869
|
+
# {ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent} for more
|
|
870
|
+
# details.
|
|
871
|
+
#
|
|
872
|
+
# @param flag [Boolean]
|
|
873
|
+
#
|
|
874
|
+
# @param min_words [Integer] Flag content with fewer than this many words as low-effort. Defaults to 3. Set t
|
|
875
|
+
#
|
|
876
|
+
# @param threshold [Float]
|
|
877
|
+
#
|
|
878
|
+
# @param id [Symbol, :low_quality]
|
|
879
|
+
end
|
|
880
|
+
|
|
881
|
+
class FaceDetection < ModerationAPI::Internal::Type::BaseModel
|
|
882
|
+
# @!attribute id
|
|
883
|
+
#
|
|
884
|
+
# @return [Symbol, :face_detection]
|
|
885
|
+
required :id, const: :face_detection
|
|
886
|
+
|
|
887
|
+
# @!attribute flag
|
|
888
|
+
#
|
|
889
|
+
# @return [Boolean]
|
|
890
|
+
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
891
|
+
|
|
892
|
+
# @!attribute comparator
|
|
893
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
894
|
+
# faces. Defaults to at_least.
|
|
895
|
+
#
|
|
896
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator, nil]
|
|
897
|
+
optional :comparator, enum: -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator }
|
|
898
|
+
|
|
899
|
+
# @!attribute count
|
|
900
|
+
# Number of faces the comparator applies to. Defaults to 1, so the default rule
|
|
901
|
+
# flags any image containing a face.
|
|
902
|
+
#
|
|
903
|
+
# @return [Integer, nil]
|
|
904
|
+
optional :count, Integer
|
|
905
|
+
|
|
906
|
+
# @!attribute threshold
|
|
907
|
+
#
|
|
908
|
+
# @return [Float, nil]
|
|
909
|
+
optional :threshold, Float
|
|
910
|
+
|
|
911
|
+
# @!method initialize(flag:, comparator: nil, count: nil, threshold: nil, id: :face_detection)
|
|
912
|
+
# Some parameter documentations has been truncated, see
|
|
913
|
+
# {ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection} for more
|
|
914
|
+
# details.
|
|
915
|
+
#
|
|
916
|
+
# @param flag [Boolean]
|
|
917
|
+
#
|
|
918
|
+
# @param comparator [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator] Flag images that contain "at least" or "fewer than" the configured number of fac
|
|
919
|
+
#
|
|
920
|
+
# @param count [Integer] Number of faces the comparator applies to. Defaults to 1, so the default rule fl
|
|
921
|
+
#
|
|
922
|
+
# @param threshold [Float]
|
|
923
|
+
#
|
|
924
|
+
# @param id [Symbol, :face_detection]
|
|
925
|
+
|
|
926
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
927
|
+
# faces. Defaults to at_least.
|
|
928
|
+
#
|
|
929
|
+
# @see ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection#comparator
|
|
930
|
+
module Comparator
|
|
931
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
932
|
+
|
|
933
|
+
AT_LEAST = :at_least
|
|
934
|
+
FEWER_THAN = :fewer_than
|
|
935
|
+
|
|
936
|
+
# @!method self.values
|
|
937
|
+
# @return [Array<Symbol>]
|
|
938
|
+
end
|
|
939
|
+
end
|
|
940
|
+
|
|
840
941
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
841
942
|
# @!attribute id
|
|
842
943
|
#
|
|
@@ -1111,7 +1212,7 @@ module ModerationAPI
|
|
|
1111
1212
|
end
|
|
1112
1213
|
|
|
1113
1214
|
# @!method self.variants
|
|
1114
|
-
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline)]
|
|
1215
|
+
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline)]
|
|
1115
1216
|
end
|
|
1116
1217
|
end
|
|
1117
1218
|
end
|
|
@@ -586,6 +586,13 @@ module ModerationAPI
|
|
|
586
586
|
# @return [Symbol, :classifier]
|
|
587
587
|
required :type, const: :classifier
|
|
588
588
|
|
|
589
|
+
# @!attribute data
|
|
590
|
+
# Optional structured data produced by the policy. For face detection: { count,
|
|
591
|
+
# faces: [{ confidence, gender, age }] }.
|
|
592
|
+
#
|
|
593
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
594
|
+
optional :data, ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown]
|
|
595
|
+
|
|
589
596
|
# @!attribute flagged_fields
|
|
590
597
|
# The keys of the flagged fields if submitting an object.
|
|
591
598
|
#
|
|
@@ -598,7 +605,11 @@ module ModerationAPI
|
|
|
598
605
|
optional :labels,
|
|
599
606
|
-> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] }
|
|
600
607
|
|
|
601
|
-
# @!method initialize(id:, flagged:, probability:, flagged_fields: nil, labels: nil, type: :classifier)
|
|
608
|
+
# @!method initialize(id:, flagged:, probability:, data: nil, flagged_fields: nil, labels: nil, type: :classifier)
|
|
609
|
+
# Some parameter documentations has been truncated, see
|
|
610
|
+
# {ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput} for
|
|
611
|
+
# more details.
|
|
612
|
+
#
|
|
602
613
|
# Classifier policy.
|
|
603
614
|
#
|
|
604
615
|
# @param id [String] The unique identifier for the classifier output.
|
|
@@ -607,6 +618,8 @@ module ModerationAPI
|
|
|
607
618
|
#
|
|
608
619
|
# @param probability [Float]
|
|
609
620
|
#
|
|
621
|
+
# @param data [Hash{Symbol=>Object}] Optional structured data produced by the policy. For face detection: { count, fa
|
|
622
|
+
#
|
|
610
623
|
# @param flagged_fields [Array<String>] The keys of the flagged fields if submitting an object.
|
|
611
624
|
#
|
|
612
625
|
# @param labels [Array<ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label>]
|
|
@@ -24,7 +24,7 @@ module ModerationAPI
|
|
|
24
24
|
#
|
|
25
25
|
# @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated
|
|
26
26
|
#
|
|
27
|
-
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
27
|
+
# @param policies [Array<ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline>] (Enterprise) override the channel policies for this moderation request only.
|
|
28
28
|
#
|
|
29
29
|
# @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
30
30
|
#
|
|
@@ -111,6 +111,8 @@ module ModerationAPI
|
|
|
111
111
|
ModerationAPI::ContentSubmitParams::Policy::Violence,
|
|
112
112
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
113
113
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
114
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
115
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
114
116
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
115
117
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
116
118
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -150,6 +152,8 @@ module ModerationAPI
|
|
|
150
152
|
ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash,
|
|
151
153
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
152
154
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
155
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
156
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
153
157
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
154
158
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
155
159
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -211,6 +215,8 @@ module ModerationAPI
|
|
|
211
215
|
ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash,
|
|
212
216
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
213
217
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
218
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
219
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
214
220
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
215
221
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
216
222
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -292,6 +298,8 @@ module ModerationAPI
|
|
|
292
298
|
ModerationAPI::ContentSubmitParams::Policy::Violence,
|
|
293
299
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
294
300
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
301
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
302
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
295
303
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
296
304
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
297
305
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -800,6 +808,8 @@ module ModerationAPI
|
|
|
800
808
|
ModerationAPI::ContentSubmitParams::Policy::Violence,
|
|
801
809
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
802
810
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
811
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
812
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
803
813
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
804
814
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
805
815
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -1495,6 +1505,190 @@ module ModerationAPI
|
|
|
1495
1505
|
end
|
|
1496
1506
|
end
|
|
1497
1507
|
|
|
1508
|
+
class LowQualityContent < ModerationAPI::Internal::Type::BaseModel
|
|
1509
|
+
OrHash =
|
|
1510
|
+
T.type_alias do
|
|
1511
|
+
T.any(
|
|
1512
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
1513
|
+
ModerationAPI::Internal::AnyHash
|
|
1514
|
+
)
|
|
1515
|
+
end
|
|
1516
|
+
|
|
1517
|
+
sig { returns(Symbol) }
|
|
1518
|
+
attr_accessor :id
|
|
1519
|
+
|
|
1520
|
+
sig { returns(T::Boolean) }
|
|
1521
|
+
attr_accessor :flag
|
|
1522
|
+
|
|
1523
|
+
# Flag content with fewer than this many words as low-effort. Defaults to 3. Set
|
|
1524
|
+
# to disable by omitting.
|
|
1525
|
+
sig { returns(T.nilable(Integer)) }
|
|
1526
|
+
attr_reader :min_words
|
|
1527
|
+
|
|
1528
|
+
sig { params(min_words: Integer).void }
|
|
1529
|
+
attr_writer :min_words
|
|
1530
|
+
|
|
1531
|
+
sig { returns(T.nilable(Float)) }
|
|
1532
|
+
attr_reader :threshold
|
|
1533
|
+
|
|
1534
|
+
sig { params(threshold: Float).void }
|
|
1535
|
+
attr_writer :threshold
|
|
1536
|
+
|
|
1537
|
+
sig do
|
|
1538
|
+
params(
|
|
1539
|
+
flag: T::Boolean,
|
|
1540
|
+
min_words: Integer,
|
|
1541
|
+
threshold: Float,
|
|
1542
|
+
id: Symbol
|
|
1543
|
+
).returns(T.attached_class)
|
|
1544
|
+
end
|
|
1545
|
+
def self.new(
|
|
1546
|
+
flag:,
|
|
1547
|
+
# Flag content with fewer than this many words as low-effort. Defaults to 3. Set
|
|
1548
|
+
# to disable by omitting.
|
|
1549
|
+
min_words: nil,
|
|
1550
|
+
threshold: nil,
|
|
1551
|
+
id: :low_quality
|
|
1552
|
+
)
|
|
1553
|
+
end
|
|
1554
|
+
|
|
1555
|
+
sig do
|
|
1556
|
+
override.returns(
|
|
1557
|
+
{
|
|
1558
|
+
id: Symbol,
|
|
1559
|
+
flag: T::Boolean,
|
|
1560
|
+
min_words: Integer,
|
|
1561
|
+
threshold: Float
|
|
1562
|
+
}
|
|
1563
|
+
)
|
|
1564
|
+
end
|
|
1565
|
+
def to_hash
|
|
1566
|
+
end
|
|
1567
|
+
end
|
|
1568
|
+
|
|
1569
|
+
class FaceDetection < ModerationAPI::Internal::Type::BaseModel
|
|
1570
|
+
OrHash =
|
|
1571
|
+
T.type_alias do
|
|
1572
|
+
T.any(
|
|
1573
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
1574
|
+
ModerationAPI::Internal::AnyHash
|
|
1575
|
+
)
|
|
1576
|
+
end
|
|
1577
|
+
|
|
1578
|
+
sig { returns(Symbol) }
|
|
1579
|
+
attr_accessor :id
|
|
1580
|
+
|
|
1581
|
+
sig { returns(T::Boolean) }
|
|
1582
|
+
attr_accessor :flag
|
|
1583
|
+
|
|
1584
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
1585
|
+
# faces. Defaults to at_least.
|
|
1586
|
+
sig do
|
|
1587
|
+
returns(
|
|
1588
|
+
T.nilable(
|
|
1589
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol
|
|
1590
|
+
)
|
|
1591
|
+
)
|
|
1592
|
+
end
|
|
1593
|
+
attr_reader :comparator
|
|
1594
|
+
|
|
1595
|
+
sig do
|
|
1596
|
+
params(
|
|
1597
|
+
comparator:
|
|
1598
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol
|
|
1599
|
+
).void
|
|
1600
|
+
end
|
|
1601
|
+
attr_writer :comparator
|
|
1602
|
+
|
|
1603
|
+
# Number of faces the comparator applies to. Defaults to 1, so the default rule
|
|
1604
|
+
# flags any image containing a face.
|
|
1605
|
+
sig { returns(T.nilable(Integer)) }
|
|
1606
|
+
attr_reader :count
|
|
1607
|
+
|
|
1608
|
+
sig { params(count: Integer).void }
|
|
1609
|
+
attr_writer :count
|
|
1610
|
+
|
|
1611
|
+
sig { returns(T.nilable(Float)) }
|
|
1612
|
+
attr_reader :threshold
|
|
1613
|
+
|
|
1614
|
+
sig { params(threshold: Float).void }
|
|
1615
|
+
attr_writer :threshold
|
|
1616
|
+
|
|
1617
|
+
sig do
|
|
1618
|
+
params(
|
|
1619
|
+
flag: T::Boolean,
|
|
1620
|
+
comparator:
|
|
1621
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol,
|
|
1622
|
+
count: Integer,
|
|
1623
|
+
threshold: Float,
|
|
1624
|
+
id: Symbol
|
|
1625
|
+
).returns(T.attached_class)
|
|
1626
|
+
end
|
|
1627
|
+
def self.new(
|
|
1628
|
+
flag:,
|
|
1629
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
1630
|
+
# faces. Defaults to at_least.
|
|
1631
|
+
comparator: nil,
|
|
1632
|
+
# Number of faces the comparator applies to. Defaults to 1, so the default rule
|
|
1633
|
+
# flags any image containing a face.
|
|
1634
|
+
count: nil,
|
|
1635
|
+
threshold: nil,
|
|
1636
|
+
id: :face_detection
|
|
1637
|
+
)
|
|
1638
|
+
end
|
|
1639
|
+
|
|
1640
|
+
sig do
|
|
1641
|
+
override.returns(
|
|
1642
|
+
{
|
|
1643
|
+
id: Symbol,
|
|
1644
|
+
flag: T::Boolean,
|
|
1645
|
+
comparator:
|
|
1646
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol,
|
|
1647
|
+
count: Integer,
|
|
1648
|
+
threshold: Float
|
|
1649
|
+
}
|
|
1650
|
+
)
|
|
1651
|
+
end
|
|
1652
|
+
def to_hash
|
|
1653
|
+
end
|
|
1654
|
+
|
|
1655
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
1656
|
+
# faces. Defaults to at_least.
|
|
1657
|
+
module Comparator
|
|
1658
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
1659
|
+
|
|
1660
|
+
TaggedSymbol =
|
|
1661
|
+
T.type_alias do
|
|
1662
|
+
T.all(
|
|
1663
|
+
Symbol,
|
|
1664
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator
|
|
1665
|
+
)
|
|
1666
|
+
end
|
|
1667
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1668
|
+
|
|
1669
|
+
AT_LEAST =
|
|
1670
|
+
T.let(
|
|
1671
|
+
:at_least,
|
|
1672
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol
|
|
1673
|
+
)
|
|
1674
|
+
FEWER_THAN =
|
|
1675
|
+
T.let(
|
|
1676
|
+
:fewer_than,
|
|
1677
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol
|
|
1678
|
+
)
|
|
1679
|
+
|
|
1680
|
+
sig do
|
|
1681
|
+
override.returns(
|
|
1682
|
+
T::Array[
|
|
1683
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol
|
|
1684
|
+
]
|
|
1685
|
+
)
|
|
1686
|
+
end
|
|
1687
|
+
def self.values
|
|
1688
|
+
end
|
|
1689
|
+
end
|
|
1690
|
+
end
|
|
1691
|
+
|
|
1498
1692
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
1499
1693
|
OrHash =
|
|
1500
1694
|
T.type_alias do
|
|
@@ -1093,6 +1093,14 @@ module ModerationAPI
|
|
|
1093
1093
|
sig { returns(Symbol) }
|
|
1094
1094
|
attr_accessor :type
|
|
1095
1095
|
|
|
1096
|
+
# Optional structured data produced by the policy. For face detection: { count,
|
|
1097
|
+
# faces: [{ confidence, gender, age }] }.
|
|
1098
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
1099
|
+
attr_reader :data
|
|
1100
|
+
|
|
1101
|
+
sig { params(data: T::Hash[Symbol, T.anything]).void }
|
|
1102
|
+
attr_writer :data
|
|
1103
|
+
|
|
1096
1104
|
# The keys of the flagged fields if submitting an object.
|
|
1097
1105
|
sig { returns(T.nilable(T::Array[String])) }
|
|
1098
1106
|
attr_reader :flagged_fields
|
|
@@ -1127,6 +1135,7 @@ module ModerationAPI
|
|
|
1127
1135
|
id: String,
|
|
1128
1136
|
flagged: T::Boolean,
|
|
1129
1137
|
probability: Float,
|
|
1138
|
+
data: T::Hash[Symbol, T.anything],
|
|
1130
1139
|
flagged_fields: T::Array[String],
|
|
1131
1140
|
labels:
|
|
1132
1141
|
T::Array[
|
|
@@ -1140,6 +1149,9 @@ module ModerationAPI
|
|
|
1140
1149
|
id:,
|
|
1141
1150
|
flagged:,
|
|
1142
1151
|
probability:,
|
|
1152
|
+
# Optional structured data produced by the policy. For face detection: { count,
|
|
1153
|
+
# faces: [{ confidence, gender, age }] }.
|
|
1154
|
+
data: nil,
|
|
1143
1155
|
# The keys of the flagged fields if submitting an object.
|
|
1144
1156
|
flagged_fields: nil,
|
|
1145
1157
|
labels: nil,
|
|
@@ -1154,6 +1166,7 @@ module ModerationAPI
|
|
|
1154
1166
|
flagged: T::Boolean,
|
|
1155
1167
|
probability: Float,
|
|
1156
1168
|
type: Symbol,
|
|
1169
|
+
data: T::Hash[Symbol, T.anything],
|
|
1157
1170
|
flagged_fields: T::Array[String],
|
|
1158
1171
|
labels:
|
|
1159
1172
|
T::Array[
|
|
@@ -42,6 +42,8 @@ module ModerationAPI
|
|
|
42
42
|
ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash,
|
|
43
43
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
44
44
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
45
|
+
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
46
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
45
47
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
46
48
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
47
49
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -293,6 +293,8 @@ module ModerationAPI
|
|
|
293
293
|
| ModerationAPI::ContentSubmitParams::Policy::Violence
|
|
294
294
|
| ModerationAPI::ContentSubmitParams::Policy::SelfHarm
|
|
295
295
|
| ModerationAPI::ContentSubmitParams::Policy::Spam
|
|
296
|
+
| ModerationAPI::ContentSubmitParams::Policy::LowQualityContent
|
|
297
|
+
| ModerationAPI::ContentSubmitParams::Policy::FaceDetection
|
|
296
298
|
| ModerationAPI::ContentSubmitParams::Policy::SelfPromotion
|
|
297
299
|
| ModerationAPI::ContentSubmitParams::Policy::Political
|
|
298
300
|
| ModerationAPI::ContentSubmitParams::Policy::Religion
|
|
@@ -680,6 +682,93 @@ module ModerationAPI
|
|
|
680
682
|
def to_hash: -> { id: :spam, flag: bool, threshold: Float }
|
|
681
683
|
end
|
|
682
684
|
|
|
685
|
+
type low_quality_content =
|
|
686
|
+
{ id: :low_quality, flag: bool, min_words: Integer, threshold: Float }
|
|
687
|
+
|
|
688
|
+
class LowQualityContent < ModerationAPI::Internal::Type::BaseModel
|
|
689
|
+
attr_accessor id: :low_quality
|
|
690
|
+
|
|
691
|
+
attr_accessor flag: bool
|
|
692
|
+
|
|
693
|
+
attr_reader min_words: Integer?
|
|
694
|
+
|
|
695
|
+
def min_words=: (Integer) -> Integer
|
|
696
|
+
|
|
697
|
+
attr_reader threshold: Float?
|
|
698
|
+
|
|
699
|
+
def threshold=: (Float) -> Float
|
|
700
|
+
|
|
701
|
+
def initialize: (
|
|
702
|
+
flag: bool,
|
|
703
|
+
?min_words: Integer,
|
|
704
|
+
?threshold: Float,
|
|
705
|
+
?id: :low_quality
|
|
706
|
+
) -> void
|
|
707
|
+
|
|
708
|
+
def to_hash: -> {
|
|
709
|
+
id: :low_quality,
|
|
710
|
+
flag: bool,
|
|
711
|
+
min_words: Integer,
|
|
712
|
+
threshold: Float
|
|
713
|
+
}
|
|
714
|
+
end
|
|
715
|
+
|
|
716
|
+
type face_detection =
|
|
717
|
+
{
|
|
718
|
+
id: :face_detection,
|
|
719
|
+
flag: bool,
|
|
720
|
+
comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator,
|
|
721
|
+
count: Integer,
|
|
722
|
+
threshold: Float
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
class FaceDetection < ModerationAPI::Internal::Type::BaseModel
|
|
726
|
+
attr_accessor id: :face_detection
|
|
727
|
+
|
|
728
|
+
attr_accessor flag: bool
|
|
729
|
+
|
|
730
|
+
attr_reader comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator?
|
|
731
|
+
|
|
732
|
+
def comparator=: (
|
|
733
|
+
ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator
|
|
734
|
+
) -> ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator
|
|
735
|
+
|
|
736
|
+
attr_reader count: Integer?
|
|
737
|
+
|
|
738
|
+
def count=: (Integer) -> Integer
|
|
739
|
+
|
|
740
|
+
attr_reader threshold: Float?
|
|
741
|
+
|
|
742
|
+
def threshold=: (Float) -> Float
|
|
743
|
+
|
|
744
|
+
def initialize: (
|
|
745
|
+
flag: bool,
|
|
746
|
+
?comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator,
|
|
747
|
+
?count: Integer,
|
|
748
|
+
?threshold: Float,
|
|
749
|
+
?id: :face_detection
|
|
750
|
+
) -> void
|
|
751
|
+
|
|
752
|
+
def to_hash: -> {
|
|
753
|
+
id: :face_detection,
|
|
754
|
+
flag: bool,
|
|
755
|
+
comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator,
|
|
756
|
+
count: Integer,
|
|
757
|
+
threshold: Float
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
type comparator = :at_least | :fewer_than
|
|
761
|
+
|
|
762
|
+
module Comparator
|
|
763
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
764
|
+
|
|
765
|
+
AT_LEAST: :at_least
|
|
766
|
+
FEWER_THAN: :fewer_than
|
|
767
|
+
|
|
768
|
+
def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator]
|
|
769
|
+
end
|
|
770
|
+
end
|
|
771
|
+
|
|
683
772
|
type self_promotion =
|
|
684
773
|
{ id: :self_promotion, flag: bool, threshold: Float }
|
|
685
774
|
|
|
@@ -430,6 +430,7 @@ module ModerationAPI
|
|
|
430
430
|
flagged: bool,
|
|
431
431
|
probability: Float,
|
|
432
432
|
type: :classifier,
|
|
433
|
+
data: ::Hash[Symbol, top],
|
|
433
434
|
flagged_fields: ::Array[String],
|
|
434
435
|
labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label]
|
|
435
436
|
}
|
|
@@ -443,6 +444,10 @@ module ModerationAPI
|
|
|
443
444
|
|
|
444
445
|
attr_accessor type: :classifier
|
|
445
446
|
|
|
447
|
+
attr_reader data: ::Hash[Symbol, top]?
|
|
448
|
+
|
|
449
|
+
def data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
|
450
|
+
|
|
446
451
|
attr_reader flagged_fields: ::Array[String]?
|
|
447
452
|
|
|
448
453
|
def flagged_fields=: (::Array[String]) -> ::Array[String]
|
|
@@ -457,6 +462,7 @@ module ModerationAPI
|
|
|
457
462
|
id: String,
|
|
458
463
|
flagged: bool,
|
|
459
464
|
probability: Float,
|
|
465
|
+
?data: ::Hash[Symbol, top],
|
|
460
466
|
?flagged_fields: ::Array[String],
|
|
461
467
|
?labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label],
|
|
462
468
|
?type: :classifier
|
|
@@ -467,6 +473,7 @@ module ModerationAPI
|
|
|
467
473
|
flagged: bool,
|
|
468
474
|
probability: Float,
|
|
469
475
|
type: :classifier,
|
|
476
|
+
data: ::Hash[Symbol, top],
|
|
470
477
|
flagged_fields: ::Array[String],
|
|
471
478
|
labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label]
|
|
472
479
|
}
|
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.20.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: 2026-
|
|
11
|
+
date: 2026-06-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|