From b6bc2c86c329084595d528ead7516b002006cd7a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:27:26 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 ++-- .../models/content_submit_response.rb | 11 ++++++++++- .../models/content_submit_response.rbi | 13 +++++++++++++ .../models/content_submit_response.rbs | 7 +++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 688c1d0..23eb088 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-7270e2afd5e9c57ffcb1b83d5eb8b549a33c471b72ab494f903473a23b3f7115.yml -openapi_spec_hash: cfd11087252e28bc7e7d4f4dbefc51ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-fb621278289bf54b9c00e8cadce0cc9fa89506ec908464fdb99d66620a953f0a.yml +openapi_spec_hash: c2a3e2de6f910fc28c7ccd88bf722e06 config_hash: 6b825a08e19dfb747c5dc1766502b789 diff --git a/lib/moderation_api/models/content_submit_response.rb b/lib/moderation_api/models/content_submit_response.rb index fca5d14..2fea42d 100644 --- a/lib/moderation_api/models/content_submit_response.rb +++ b/lib/moderation_api/models/content_submit_response.rb @@ -370,13 +370,20 @@ class Evaluation < ModerationAPI::Internal::Type::BaseModel # @return [Float] required :severity_score, Float + # @!attribute shadow_flagged + # Whether the content would have been flagged by analyze-only policies (flag: + # false). + # + # @return [Boolean, nil] + optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean + # @!attribute unicode_spoofed # Whether the content was flagged for Unicode spoofing. # # @return [Boolean, nil] optional :unicode_spoofed, ModerationAPI::Internal::Type::Boolean - # @!method initialize(flag_probability:, flagged:, severity_score:, unicode_spoofed: nil) + # @!method initialize(flag_probability:, flagged:, severity_score:, shadow_flagged: nil, unicode_spoofed: nil) # Some parameter documentations has been truncated, see # {ModerationAPI::Models::ContentSubmitResponse::Evaluation} for more details. # @@ -388,6 +395,8 @@ class Evaluation < ModerationAPI::Internal::Type::BaseModel # # @param severity_score [Float] The severity score of the content. A higher score indicates more severe content. # + # @param shadow_flagged [Boolean] Whether the content would have been flagged by analyze-only policies (flag: fals + # # @param unicode_spoofed [Boolean] Whether the content was flagged for Unicode spoofing. end diff --git a/rbi/moderation_api/models/content_submit_response.rbi b/rbi/moderation_api/models/content_submit_response.rbi index 203cff0..3407fee 100644 --- a/rbi/moderation_api/models/content_submit_response.rbi +++ b/rbi/moderation_api/models/content_submit_response.rbi @@ -721,6 +721,14 @@ module ModerationAPI sig { returns(Float) } attr_accessor :severity_score + # Whether the content would have been flagged by analyze-only policies (flag: + # false). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :shadow_flagged + + sig { params(shadow_flagged: T::Boolean).void } + attr_writer :shadow_flagged + # Whether the content was flagged for Unicode spoofing. sig { returns(T.nilable(T::Boolean)) } attr_reader :unicode_spoofed @@ -734,6 +742,7 @@ module ModerationAPI flag_probability: Float, flagged: T::Boolean, severity_score: Float, + shadow_flagged: T::Boolean, unicode_spoofed: T::Boolean ).returns(T.attached_class) end @@ -744,6 +753,9 @@ module ModerationAPI flagged:, # The severity score of the content. A higher score indicates more severe content. severity_score:, + # Whether the content would have been flagged by analyze-only policies (flag: + # false). + shadow_flagged: nil, # Whether the content was flagged for Unicode spoofing. unicode_spoofed: nil ) @@ -755,6 +767,7 @@ module ModerationAPI flag_probability: Float, flagged: T::Boolean, severity_score: Float, + shadow_flagged: T::Boolean, unicode_spoofed: T::Boolean } ) diff --git a/sig/moderation_api/models/content_submit_response.rbs b/sig/moderation_api/models/content_submit_response.rbs index 581264d..6f20819 100644 --- a/sig/moderation_api/models/content_submit_response.rbs +++ b/sig/moderation_api/models/content_submit_response.rbs @@ -245,6 +245,7 @@ module ModerationAPI flag_probability: Float, flagged: bool, severity_score: Float, + shadow_flagged: bool, unicode_spoofed: bool } @@ -255,6 +256,10 @@ module ModerationAPI attr_accessor severity_score: Float + attr_reader shadow_flagged: bool? + + def shadow_flagged=: (bool) -> bool + attr_reader unicode_spoofed: bool? def unicode_spoofed=: (bool) -> bool @@ -263,6 +268,7 @@ module ModerationAPI flag_probability: Float, flagged: bool, severity_score: Float, + ?shadow_flagged: bool, ?unicode_spoofed: bool ) -> void @@ -270,6 +276,7 @@ module ModerationAPI flag_probability: Float, flagged: bool, severity_score: Float, + shadow_flagged: bool, unicode_spoofed: bool } end From 4f3f9dffe1e8c6100ae80b33c8dd8f2e17e50b01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:27:43 +0000 Subject: [PATCH 2/2] release: 2.9.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/moderation_api/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 108509e..427b8ec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.8.1" + ".": "2.9.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b79ff0..a782967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.9.0 (2026-03-03) + +Full Changelog: [v2.8.1...v2.9.0](https://github.com/moderation-api/sdk-ruby/compare/v2.8.1...v2.9.0) + +### Features + +* **api:** api update ([b6bc2c8](https://github.com/moderation-api/sdk-ruby/commit/b6bc2c86c329084595d528ead7516b002006cd7a)) + ## 2.8.1 (2026-02-27) Full Changelog: [v2.8.0...v2.8.1](https://github.com/moderation-api/sdk-ruby/compare/v2.8.0...v2.8.1) diff --git a/Gemfile.lock b/Gemfile.lock index 711d22d..13903b1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - moderation_api (2.8.1) + moderation_api (2.9.0) cgi connection_pool diff --git a/README.md b/README.md index a624b5b..cfb129e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "moderation_api", "~> 2.8.1" +gem "moderation_api", "~> 2.9.0" ``` diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb index 7e26d10..47705cc 100644 --- a/lib/moderation_api/version.rb +++ b/lib/moderation_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModerationAPI - VERSION = "2.8.1" + VERSION = "2.9.0" end