moderation_api 2.19.0 → 2.21.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 +151 -4
- data/lib/moderation_api/models/content_submit_response.rb +15 -1
- data/lib/moderation_api/models/webhook_event.rb +340 -4
- data/lib/moderation_api/resources/content.rb +4 -2
- data/lib/moderation_api/version.rb +1 -1
- data/rbi/moderation_api/models/content_submit_params.rbi +319 -0
- data/rbi/moderation_api/models/content_submit_response.rbi +18 -0
- data/rbi/moderation_api/models/webhook_event.rbi +784 -0
- data/rbi/moderation_api/resources/content.rbi +7 -0
- data/sig/moderation_api/models/content_submit_params.rbs +129 -0
- data/sig/moderation_api/models/content_submit_response.rbs +9 -0
- data/sig/moderation_api/models/webhook_event.rbs +272 -0
- data/sig/moderation_api/resources/content.rbs +1 -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: 547864fb63b08b0a2b9f6a917a87c37987466412e68df8d2d590d79443960126
|
|
4
|
+
data.tar.gz: 171fd0eab7ed0d611f8ae8568e4f1901393c890eb41246f70aa882363d960c1d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f4b4033ca81af4592e37b7b42d22058dbc7f2599c5e7824c34846f3196b69aac3e211555826c98d27a6c33d2bbe233ae0ef94918936313e50b56a3e084ffb1af
|
|
7
|
+
data.tar.gz: dd338f50d8e682d74d2010aa7a4727dd6e1ae1458c7399f921b7ad08ccc39545ccf53959e1d473d60a85dfd401590285cb725027d140a58cbdddd61f3485bb5a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.21.0 (2026-06-02)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.20.0...v2.21.0](https://github.com/moderation-api/sdk-ruby/compare/v2.20.0...v2.21.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([250e1b4](https://github.com/moderation-api/sdk-ruby/commit/250e1b4849fff5f9dfe39c267b4641c23fc46358))
|
|
10
|
+
|
|
11
|
+
## 2.20.0 (2026-06-01)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v2.19.0...v2.20.0](https://github.com/moderation-api/sdk-ruby/compare/v2.19.0...v2.20.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** api update ([8ec8a3d](https://github.com/moderation-api/sdk-ruby/commit/8ec8a3dcbca0c79346a06743395b61214f299bb4))
|
|
18
|
+
|
|
3
19
|
## 2.19.0 (2026-06-01)
|
|
4
20
|
|
|
5
21
|
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
|
@@ -26,6 +26,18 @@ module ModerationAPI
|
|
|
26
26
|
# @return [String, nil]
|
|
27
27
|
optional :channel, String
|
|
28
28
|
|
|
29
|
+
# @!attribute client_action
|
|
30
|
+
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
31
|
+
# third-party tool). Feeds the rules engine and can escalate or override the
|
|
32
|
+
# recommended action. Does not change whether our analysis flagged the content.
|
|
33
|
+
#
|
|
34
|
+
# @return [ModerationAPI::Models::ContentSubmitParams::ClientAction, nil]
|
|
35
|
+
optional :client_action,
|
|
36
|
+
-> {
|
|
37
|
+
ModerationAPI::ContentSubmitParams::ClientAction
|
|
38
|
+
},
|
|
39
|
+
api_name: :clientAction
|
|
40
|
+
|
|
29
41
|
# @!attribute content_id
|
|
30
42
|
# The unique ID of the content in your database.
|
|
31
43
|
#
|
|
@@ -59,7 +71,7 @@ module ModerationAPI
|
|
|
59
71
|
# @!attribute policies
|
|
60
72
|
# (Enterprise) override the channel policies for this moderation request only.
|
|
61
73
|
#
|
|
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]
|
|
74
|
+
# @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
75
|
optional :policies,
|
|
64
76
|
-> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::ContentSubmitParams::Policy] }
|
|
65
77
|
|
|
@@ -70,7 +82,7 @@ module ModerationAPI
|
|
|
70
82
|
# @return [Float, nil]
|
|
71
83
|
optional :timestamp, Float
|
|
72
84
|
|
|
73
|
-
# @!method initialize(content:, author_id: nil, channel: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
85
|
+
# @!method initialize(content:, author_id: nil, channel: nil, client_action: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {})
|
|
74
86
|
# Some parameter documentations has been truncated, see
|
|
75
87
|
# {ModerationAPI::Models::ContentSubmitParams} for more details.
|
|
76
88
|
#
|
|
@@ -80,6 +92,8 @@ module ModerationAPI
|
|
|
80
92
|
#
|
|
81
93
|
# @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi
|
|
82
94
|
#
|
|
95
|
+
# @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
96
|
+
#
|
|
83
97
|
# @param content_id [String] The unique ID of the content in your database.
|
|
84
98
|
#
|
|
85
99
|
# @param conversation_id [String] For example the ID of a chat room or a post
|
|
@@ -90,7 +104,7 @@ module ModerationAPI
|
|
|
90
104
|
#
|
|
91
105
|
# @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated
|
|
92
106
|
#
|
|
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.
|
|
107
|
+
# @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
108
|
#
|
|
95
109
|
# @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content
|
|
96
110
|
#
|
|
@@ -345,6 +359,77 @@ module ModerationAPI
|
|
|
345
359
|
# @return [Array(ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object)]
|
|
346
360
|
end
|
|
347
361
|
|
|
362
|
+
class ClientAction < ModerationAPI::Internal::Type::BaseModel
|
|
363
|
+
# @!attribute action
|
|
364
|
+
# Your recommendation for the content: allow, review, or reject.
|
|
365
|
+
#
|
|
366
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action]
|
|
367
|
+
required :action, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Action }
|
|
368
|
+
|
|
369
|
+
# @!attribute behavior
|
|
370
|
+
# How your recommendation combines with ours. Defaults to 'escalate', which only
|
|
371
|
+
# applies it when stricter than ours; 'override' replaces ours outright.
|
|
372
|
+
#
|
|
373
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior, nil]
|
|
374
|
+
optional :behavior, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Behavior }
|
|
375
|
+
|
|
376
|
+
# @!attribute reason
|
|
377
|
+
# A human-readable explanation for your recommendation.
|
|
378
|
+
#
|
|
379
|
+
# @return [String, nil]
|
|
380
|
+
optional :reason, String
|
|
381
|
+
|
|
382
|
+
# @!attribute source
|
|
383
|
+
# Where your recommendation came from, e.g. "banned-ip".
|
|
384
|
+
#
|
|
385
|
+
# @return [String, nil]
|
|
386
|
+
optional :source, String
|
|
387
|
+
|
|
388
|
+
# @!method initialize(action:, behavior: nil, reason: nil, source: nil)
|
|
389
|
+
# Some parameter documentations has been truncated, see
|
|
390
|
+
# {ModerationAPI::Models::ContentSubmitParams::ClientAction} for more details.
|
|
391
|
+
#
|
|
392
|
+
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
|
|
393
|
+
# third-party tool). Feeds the rules engine and can escalate or override the
|
|
394
|
+
# recommended action. Does not change whether our analysis flagged the content.
|
|
395
|
+
#
|
|
396
|
+
# @param action [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
|
|
397
|
+
#
|
|
398
|
+
# @param behavior [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
|
|
399
|
+
#
|
|
400
|
+
# @param reason [String] A human-readable explanation for your recommendation.
|
|
401
|
+
#
|
|
402
|
+
# @param source [String] Where your recommendation came from, e.g. "banned-ip".
|
|
403
|
+
|
|
404
|
+
# Your recommendation for the content: allow, review, or reject.
|
|
405
|
+
#
|
|
406
|
+
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#action
|
|
407
|
+
module Action
|
|
408
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
409
|
+
|
|
410
|
+
REVIEW = :review
|
|
411
|
+
ALLOW = :allow
|
|
412
|
+
REJECT = :reject
|
|
413
|
+
|
|
414
|
+
# @!method self.values
|
|
415
|
+
# @return [Array<Symbol>]
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
# How your recommendation combines with ours. Defaults to 'escalate', which only
|
|
419
|
+
# applies it when stricter than ours; 'override' replaces ours outright.
|
|
420
|
+
#
|
|
421
|
+
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#behavior
|
|
422
|
+
module Behavior
|
|
423
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
424
|
+
|
|
425
|
+
OVERRIDE = :override
|
|
426
|
+
ESCALATE = :escalate
|
|
427
|
+
|
|
428
|
+
# @!method self.values
|
|
429
|
+
# @return [Array<Symbol>]
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
|
|
348
433
|
# The meta type of content being moderated
|
|
349
434
|
module MetaType
|
|
350
435
|
extend ModerationAPI::Internal::Type::Enum
|
|
@@ -405,6 +490,8 @@ module ModerationAPI
|
|
|
405
490
|
|
|
406
491
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::LowQualityContent }
|
|
407
492
|
|
|
493
|
+
variant -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection }
|
|
494
|
+
|
|
408
495
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::SelfPromotion }
|
|
409
496
|
|
|
410
497
|
variant -> { ModerationAPI::ContentSubmitParams::Policy::Political }
|
|
@@ -876,6 +963,66 @@ module ModerationAPI
|
|
|
876
963
|
# @param id [Symbol, :low_quality]
|
|
877
964
|
end
|
|
878
965
|
|
|
966
|
+
class FaceDetection < ModerationAPI::Internal::Type::BaseModel
|
|
967
|
+
# @!attribute id
|
|
968
|
+
#
|
|
969
|
+
# @return [Symbol, :face_detection]
|
|
970
|
+
required :id, const: :face_detection
|
|
971
|
+
|
|
972
|
+
# @!attribute flag
|
|
973
|
+
#
|
|
974
|
+
# @return [Boolean]
|
|
975
|
+
required :flag, ModerationAPI::Internal::Type::Boolean
|
|
976
|
+
|
|
977
|
+
# @!attribute comparator
|
|
978
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
979
|
+
# faces. Defaults to at_least.
|
|
980
|
+
#
|
|
981
|
+
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator, nil]
|
|
982
|
+
optional :comparator, enum: -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator }
|
|
983
|
+
|
|
984
|
+
# @!attribute count
|
|
985
|
+
# Number of faces the comparator applies to. Defaults to 1, so the default rule
|
|
986
|
+
# flags any image containing a face.
|
|
987
|
+
#
|
|
988
|
+
# @return [Integer, nil]
|
|
989
|
+
optional :count, Integer
|
|
990
|
+
|
|
991
|
+
# @!attribute threshold
|
|
992
|
+
#
|
|
993
|
+
# @return [Float, nil]
|
|
994
|
+
optional :threshold, Float
|
|
995
|
+
|
|
996
|
+
# @!method initialize(flag:, comparator: nil, count: nil, threshold: nil, id: :face_detection)
|
|
997
|
+
# Some parameter documentations has been truncated, see
|
|
998
|
+
# {ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection} for more
|
|
999
|
+
# details.
|
|
1000
|
+
#
|
|
1001
|
+
# @param flag [Boolean]
|
|
1002
|
+
#
|
|
1003
|
+
# @param comparator [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator] Flag images that contain "at least" or "fewer than" the configured number of fac
|
|
1004
|
+
#
|
|
1005
|
+
# @param count [Integer] Number of faces the comparator applies to. Defaults to 1, so the default rule fl
|
|
1006
|
+
#
|
|
1007
|
+
# @param threshold [Float]
|
|
1008
|
+
#
|
|
1009
|
+
# @param id [Symbol, :face_detection]
|
|
1010
|
+
|
|
1011
|
+
# Flag images that contain "at least" or "fewer than" the configured number of
|
|
1012
|
+
# faces. Defaults to at_least.
|
|
1013
|
+
#
|
|
1014
|
+
# @see ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection#comparator
|
|
1015
|
+
module Comparator
|
|
1016
|
+
extend ModerationAPI::Internal::Type::Enum
|
|
1017
|
+
|
|
1018
|
+
AT_LEAST = :at_least
|
|
1019
|
+
FEWER_THAN = :fewer_than
|
|
1020
|
+
|
|
1021
|
+
# @!method self.values
|
|
1022
|
+
# @return [Array<Symbol>]
|
|
1023
|
+
end
|
|
1024
|
+
end
|
|
1025
|
+
|
|
879
1026
|
class SelfPromotion < ModerationAPI::Internal::Type::BaseModel
|
|
880
1027
|
# @!attribute id
|
|
881
1028
|
#
|
|
@@ -1150,7 +1297,7 @@ module ModerationAPI
|
|
|
1150
1297
|
end
|
|
1151
1298
|
|
|
1152
1299
|
# @!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)]
|
|
1300
|
+
# @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
1301
|
end
|
|
1155
1302
|
end
|
|
1156
1303
|
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>]
|
|
@@ -894,6 +907,7 @@ module ModerationAPI
|
|
|
894
907
|
RULE_MATCH = :rule_match
|
|
895
908
|
RULE_DEFAULT = :rule_default
|
|
896
909
|
RULE_FALLBACK = :rule_fallback
|
|
910
|
+
CLIENT_OVERRIDE = :client_override
|
|
897
911
|
|
|
898
912
|
# @!method self.values
|
|
899
913
|
# @return [Array<Symbol>]
|