From 20a861b7b3eb2befcba207af0ae424e050a6643f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:16:44 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 ++-- .../types/content_submit_response.py | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ccd7c79..5019f81 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-c8e66e827fc2b1465b740a29e87da71c3b1ddca1a4bdb1023aa96c569b80e9be.yml -openapi_spec_hash: 35fdc3e34feb56cafaf4de2834201978 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-5cee858ce17e48e25e7503767dd979c6570a485511274e48129a1922eae67098.yml +openapi_spec_hash: 54c716ac4e888bfddc2c6402192bb33a config_hash: 13d10207114afb65f7ac4e21f4c0e358 diff --git a/src/moderation_api/types/content_submit_response.py b/src/moderation_api/types/content_submit_response.py index 1ef3017..ce9a2e2 100644 --- a/src/moderation_api/types/content_submit_response.py +++ b/src/moderation_api/types/content_submit_response.py @@ -29,6 +29,7 @@ "PolicyEntityMatcherOutputMatchSignals", "PolicyEntityMatcherOutputMatchSignalsBrandImpersonation", "Recommendation", + "RecommendationMatchedRule", "Error", ] @@ -321,6 +322,12 @@ class PolicyEntityMatcherOutput(BaseModel): Policy: TypeAlias = Union[PolicyClassifierOutput, PolicyEntityMatcherOutput] +class RecommendationMatchedRule(BaseModel): + key: str + + name: str + + class Recommendation(BaseModel): """The recommendation for the content based on the evaluation.""" @@ -328,13 +335,26 @@ class Recommendation(BaseModel): """The action to take based on the recommendation""" reason_codes: List[ - Literal["severity_reject", "severity_review", "author_block", "dry_run", "trusted_allow", "untrusted_severity"] + Literal[ + "severity_reject", + "severity_review", + "author_block", + "dry_run", + "trusted_allow", + "untrusted_severity", + "rule_match", + "rule_default", + "rule_fallback", + ] ] """The reason code for the recommendation. Can be used to display a reason to the user. """ + matched_rules: Optional[List[RecommendationMatchedRule]] = None + """Rules that matched during evaluation, if rules engine is active.""" + class Error(BaseModel): id: str From eaceeaf0e9615cbdeab33b259af3a5f646d85676 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:17:08 +0000 Subject: [PATCH 2/2] release: 1.17.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/moderation_api/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bc845f3..6a197be 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.16.0" + ".": "1.17.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 18bdd90..9b802ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.17.0 (2026-04-29) + +Full Changelog: [v1.16.0...v1.17.0](https://github.com/moderation-api/sdk-python/compare/v1.16.0...v1.17.0) + +### Features + +* **api:** api update ([20a861b](https://github.com/moderation-api/sdk-python/commit/20a861b7b3eb2befcba207af0ae424e050a6643f)) + ## 1.16.0 (2026-04-28) Full Changelog: [v1.15.0...v1.16.0](https://github.com/moderation-api/sdk-python/compare/v1.15.0...v1.16.0) diff --git a/pyproject.toml b/pyproject.toml index 9d0d24c..922c4a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "moderation_api" -version = "1.16.0" +version = "1.17.0" description = "The official Python library for the moderation-api API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/moderation_api/_version.py b/src/moderation_api/_version.py index 9f6c6bb..4e6e834 100644 --- a/src/moderation_api/_version.py +++ b/src/moderation_api/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "moderation_api" -__version__ = "1.16.0" # x-release-please-version +__version__ = "1.17.0" # x-release-please-version