Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.20.0"
".": "2.21.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-cbf656f40e43acf60d9596f78204f031dc8c7205626df8f05ce8e88bcf49b597.yml
openapi_spec_hash: 23be5a56248a1a575b34833eb7e7fe49
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-9c5291067ec36cba0c9ef772c5c8eb10238fb332f1f25d0e31f3f2ad87c24e5e.yml
openapi_spec_hash: 790cc0a36d6ed693c06a285c441ab977
config_hash: 9d144cc6c49d3fd53e5b4472c1e22165
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 2.21.0 (2026-06-02)

Full Changelog: [v2.20.0...v2.21.0](https://github.com/moderation-api/sdk-ruby/compare/v2.20.0...v2.21.0)

### Features

* **api:** api update ([250e1b4](https://github.com/moderation-api/sdk-ruby/commit/250e1b4849fff5f9dfe39c267b4641c23fc46358))

## 2.20.0 (2026-06-01)

Full Changelog: [v2.19.0...v2.20.0](https://github.com/moderation-api/sdk-ruby/compare/v2.19.0...v2.20.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
moderation_api (2.20.0)
moderation_api (2.21.0)
cgi
connection_pool

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "moderation_api", "~> 2.20.0"
gem "moderation_api", "~> 2.21.0"
```

<!-- x-release-please-end -->
Expand Down
87 changes: 86 additions & 1 deletion lib/moderation_api/models/content_submit_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel
# @return [String, nil]
optional :channel, String

# @!attribute client_action
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
# third-party tool). Feeds the rules engine and can escalate or override the
# recommended action. Does not change whether our analysis flagged the content.
#
# @return [ModerationAPI::Models::ContentSubmitParams::ClientAction, nil]
optional :client_action,
-> {
ModerationAPI::ContentSubmitParams::ClientAction
},
api_name: :clientAction

# @!attribute content_id
# The unique ID of the content in your database.
#
Expand Down Expand Up @@ -70,7 +82,7 @@ class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel
# @return [Float, nil]
optional :timestamp, Float

# @!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: {})
# @!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: {})
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ContentSubmitParams} for more details.
#
Expand All @@ -80,6 +92,8 @@ class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel
#
# @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi
#
# @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a
#
# @param content_id [String] The unique ID of the content in your database.
#
# @param conversation_id [String] For example the ID of a chat room or a post
Expand Down Expand Up @@ -345,6 +359,77 @@ class Audio < ModerationAPI::Internal::Type::BaseModel
# @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)]
end

class ClientAction < ModerationAPI::Internal::Type::BaseModel
# @!attribute action
# Your recommendation for the content: allow, review, or reject.
#
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action]
required :action, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Action }

# @!attribute behavior
# How your recommendation combines with ours. Defaults to 'escalate', which only
# applies it when stricter than ours; 'override' replaces ours outright.
#
# @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior, nil]
optional :behavior, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Behavior }

# @!attribute reason
# A human-readable explanation for your recommendation.
#
# @return [String, nil]
optional :reason, String

# @!attribute source
# Where your recommendation came from, e.g. "banned-ip".
#
# @return [String, nil]
optional :source, String

# @!method initialize(action:, behavior: nil, reason: nil, source: nil)
# Some parameter documentations has been truncated, see
# {ModerationAPI::Models::ContentSubmitParams::ClientAction} for more details.
#
# A recommendation from your own client-side flagging (e.g. a banned-IP list or a
# third-party tool). Feeds the rules engine and can escalate or override the
# recommended action. Does not change whether our analysis flagged the content.
#
# @param action [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] Your recommendation for the content: allow, review, or reject.
#
# @param behavior [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a
#
# @param reason [String] A human-readable explanation for your recommendation.
#
# @param source [String] Where your recommendation came from, e.g. "banned-ip".

# Your recommendation for the content: allow, review, or reject.
#
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#action
module Action
extend ModerationAPI::Internal::Type::Enum

REVIEW = :review
ALLOW = :allow
REJECT = :reject

# @!method self.values
# @return [Array<Symbol>]
end

# How your recommendation combines with ours. Defaults to 'escalate', which only
# applies it when stricter than ours; 'override' replaces ours outright.
#
# @see ModerationAPI::Models::ContentSubmitParams::ClientAction#behavior
module Behavior
extend ModerationAPI::Internal::Type::Enum

OVERRIDE = :override
ESCALATE = :escalate

# @!method self.values
# @return [Array<Symbol>]
end
end

# The meta type of content being moderated
module MetaType
extend ModerationAPI::Internal::Type::Enum
Expand Down
1 change: 1 addition & 0 deletions lib/moderation_api/models/content_submit_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ module ReasonCode
RULE_MATCH = :rule_match
RULE_DEFAULT = :rule_default
RULE_FALLBACK = :rule_fallback
CLIENT_OVERRIDE = :client_override

# @!method self.values
# @return [Array<Symbol>]
Expand Down
Loading