moderation_api 2.19.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 +8 -0
- data/README.md +1 -1
- data/lib/moderation_api/models/content_submit_params.rb +65 -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 +128 -0
- data/rbi/moderation_api/models/content_submit_response.rbi +13 -0
- data/rbi/moderation_api/resources/content.rbi +1 -0
- data/sig/moderation_api/models/content_submit_params.rbs +57 -0
- data/sig/moderation_api/models/content_submit_response.rbs +7 -0
- metadata +1 -1
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,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 2.19.0 (2026-06-01)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v2.18.0...v2.19.0](https://github.com/moderation-api/sdk-ruby/compare/v2.18.0...v2.19.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::LowQualityContent, 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::LowQualityContent, 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
|
#
|
|
@@ -405,6 +405,8 @@ module ModerationAPI
|
|
|
405
405
|
|
|
406
406
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::LowQualityContent }
|
|
407
407
|
|
|
408
|
+
variant -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection }
|
|
409
|
+
|
|
408
410
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::SelfPromotion }
|
|
409
411
|
|
|
410
412
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Political }
|
|
@@ -876,6 +878,66 @@ module ModerationAPI
|
|
|
876
878
|
# @param id [Symbol, :low_quality]
|
|
877
879
|
end
|
|
878
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
|
+
|
|
879
941
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
880
942
|
# @!attribute id
|
|
881
943
|
#
|
|
@@ -1150,7 +1212,7 @@ module ModerationAPI
|
|
|
1150
1212
|
end
|
|
1151
1213
|
|
|
1152
1214
|
# @!method self.variants
|
|
1153
|
-
# @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::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)]
|
|
1154
1216
|
end
|
|
1155
1217
|
end
|
|
1156
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::LowQualityContent, 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
|
#
|
|
@@ -112,6 +112,7 @@ module ModerationAPI
|
|
|
112
112
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
113
113
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
114
114
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
115
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
115
116
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
116
117
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
117
118
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -152,6 +153,7 @@ module ModerationAPI
|
|
|
152
153
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
153
154
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
154
155
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
156
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
155
157
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
156
158
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
157
159
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -214,6 +216,7 @@ module ModerationAPI
|
|
|
214
216
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
215
217
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
216
218
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
219
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
217
220
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
218
221
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
219
222
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -296,6 +299,7 @@ module ModerationAPI
|
|
|
296
299
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
297
300
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
298
301
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
302
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
299
303
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
300
304
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
301
305
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -805,6 +809,7 @@ module ModerationAPI
|
|
|
805
809
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm,
|
|
806
810
|
ModerationAPI::ContentSubmitParams::Policy::Spam,
|
|
807
811
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent,
|
|
812
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection,
|
|
808
813
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion,
|
|
809
814
|
ModerationAPI::ContentSubmitParams::Policy::Political,
|
|
810
815
|
ModerationAPI::ContentSubmitParams::Policy::Religion,
|
|
@@ -1561,6 +1566,129 @@ module ModerationAPI
|
|
|
1561
1566
|
end
|
|
1562
1567
|
end
|
|
1563
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
|
+
|
|
1564
1692
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
1565
1693
|
OrHash =
|
|
1566
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[
|
|
@@ -43,6 +43,7 @@ module ModerationAPI
|
|
|
43
43
|
ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash,
|
|
44
44
|
ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash,
|
|
45
45
|
ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash,
|
|
46
|
+
ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash,
|
|
46
47
|
ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash,
|
|
47
48
|
ModerationAPI::ContentSubmitParams::Policy::Political::OrHash,
|
|
48
49
|
ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash,
|
|
@@ -294,6 +294,7 @@ module ModerationAPI
|
|
|
294
294
|
| ModerationAPI::ContentSubmitParams::Policy::SelfHarm
|
|
295
295
|
| ModerationAPI::ContentSubmitParams::Policy::Spam
|
|
296
296
|
| ModerationAPI::ContentSubmitParams::Policy::LowQualityContent
|
|
297
|
+
| ModerationAPI::ContentSubmitParams::Policy::FaceDetection
|
|
297
298
|
| ModerationAPI::ContentSubmitParams::Policy::SelfPromotion
|
|
298
299
|
| ModerationAPI::ContentSubmitParams::Policy::Political
|
|
299
300
|
| ModerationAPI::ContentSubmitParams::Policy::Religion
|
|
@@ -712,6 +713,62 @@ module ModerationAPI
|
|
|
712
713
|
}
|
|
713
714
|
end
|
|
714
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
|
+
|
|
715
772
|
type self_promotion =
|
|
716
773
|
{ id: :self_promotion, flag: bool, threshold: Float }
|
|
717
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
|
}
|