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 @@
{
".": "1.35.0"
".": "1.36.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: 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-249bb8b527da76961b59a5b6c7d38ce38b3f02d8b79bcb2ee50e371f6a546e59.yml
openapi_spec_hash: 8dbdf350a026301960c74d8045398ea2
config_hash: 6e090a71f4d354167d93b4534a0e7f05
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/moderation_api/_version.py
Original file line number Diff line number Diff line change
@@ -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
63 changes: 63 additions & 0 deletions src/moderation_api/types/content_submit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"Author",
"AuthorBlock",
"AuthorTrustLevel",
"Casebook",
"CasebookTopic",
"Content",
"ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItem",
"ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText",
Expand Down Expand Up @@ -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"""

Expand Down Expand Up @@ -364,6 +417,7 @@ class Recommendation(BaseModel):
"rule_default",
"rule_fallback",
"client_override",
"casebook_match",
],
str,
]
Expand Down Expand Up @@ -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."""

Expand Down
Loading