From 22104adf309107768e73c661ad2f472a99b68a02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Aug 2026 12:13:22 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 97520a7..a6e02b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-407f949d64421d5454ec0f4b518a19c14daa41312b6efa370eac631e495ca44a.yml -openapi_spec_hash: 7bcba0df8e8cb1c5a2d02efc3d6c0fa5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-c71ba49247240f25460ea025f4cabbee8032cb2e30bbd04b52dd10853fabb3bf.yml +openapi_spec_hash: 6f03994848e51532cb4d268d9542958d config_hash: 6e090a71f4d354167d93b4534a0e7f05 From f3e8b80f6b3cdf30307a9cd77c4fa84c647864a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 11:13:15 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- .../types/content_submit_response.py | 63 +++++++++++++++++++ 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a6e02b4..baa944d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-c71ba49247240f25460ea025f4cabbee8032cb2e30bbd04b52dd10853fabb3bf.yml -openapi_spec_hash: 6f03994848e51532cb4d268d9542958d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-249bb8b527da76961b59a5b6c7d38ce38b3f02d8b79bcb2ee50e371f6a546e59.yml +openapi_spec_hash: 8dbdf350a026301960c74d8045398ea2 config_hash: 6e090a71f4d354167d93b4534a0e7f05 diff --git a/src/moderation_api/types/content_submit_response.py b/src/moderation_api/types/content_submit_response.py index f5e83ce..1016880 100644 --- a/src/moderation_api/types/content_submit_response.py +++ b/src/moderation_api/types/content_submit_response.py @@ -12,6 +12,8 @@ "Author", "AuthorBlock", "AuthorTrustLevel", + "Casebook", + "CasebookTopic", "Content", "ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItem", "ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText", @@ -75,6 +77,57 @@ class Author(BaseModel): """The author's ID from your system""" +class CasebookTopic(BaseModel): + """ + The topic the closest matching case is filed under, or null when it has not been grouped into one yet. + """ + + id: str + + label: str + + +class Casebook(BaseModel): + """ + What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first. + """ + + agreement: float + """ + How unanimous the matching cases are, from 0 to 1: the share of them that + decided this way, ignoring how many there are. Always at least 0.8 when a ruling + is returned — below that the casebook reports a disagreement instead of picking + a side — so it tells you how clean the consensus was, and is not a threshold to + re-apply yourself. + """ + + case_count: float + """How many of your past cases backed this ruling.""" + + confidence: float + """ + How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled + by how much evidence backs it, so a handful of close, recent cases outweighs one + distant one. Older cases count for less, halving in weight roughly every 180 + days. This is the number to use in rules when you want a strength condition. + """ + + similarity: float + """How close the nearest matching case is, from 0 to 1. + + 1 means the content is identical to something you have already decided. + """ + + topic: Optional[CasebookTopic] = None + """ + The topic the closest matching case is filed under, or null when it has not been + grouped into one yet. + """ + + verdict: Literal["allow", "reject"] + """The ruling your past decisions point to for this content.""" + + class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText(BaseModel): """Text""" @@ -364,6 +417,7 @@ class Recommendation(BaseModel): "rule_default", "rule_fallback", "client_override", + "casebook_match", ], str, ] @@ -391,6 +445,15 @@ class ContentSubmitResponse(BaseModel): Requires you to send authorId when submitting content. """ + casebook: Optional[Casebook] = None + """ + What your casebook — the record of your past moderation decisions — found for + this content, or null when it had nothing close enough to say, when the matching + cases disagreed, or when casebook lookups are not switched on for this channel. + Reports what the casebook found; whether it decided the outcome is shown in + `recommendation`, where a higher-priority rule may have settled the item first. + """ + content: Content """Potentially modified content.""" From 287e2d3d42a3b6d5f366a28e39788ac1f2406f43 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 11:13:40 +0000 Subject: [PATCH 3/3] release: 1.36.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 44959ac..f29e96b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.35.0" + ".": "1.36.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cd1a61..8ceecb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.36.0 (2026-08-21) + +Full Changelog: [v1.35.0...v1.36.0](https://github.com/moderation-api/sdk-python/compare/v1.35.0...v1.36.0) + +### Features + +* **api:** api update ([f3e8b80](https://github.com/moderation-api/sdk-python/commit/f3e8b80f6b3cdf30307a9cd77c4fa84c647864a5)) + ## 1.35.0 (2026-08-20) Full Changelog: [v1.34.0...v1.35.0](https://github.com/moderation-api/sdk-python/compare/v1.34.0...v1.35.0) diff --git a/pyproject.toml b/pyproject.toml index 4e756b9..9968d89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "moderation_api" -version = "1.35.0" +version = "1.36.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 ba231c7..daf7e7c 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.35.0" # x-release-please-version +__version__ = "1.36.0" # x-release-please-version