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.22.0"
".": "1.23.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-2a9024f55f158ede9f9d4811ab4035e470afc920d0f15513da6603d011b2bef7.yml
openapi_spec_hash: cc3275c46438bd043ac96e669e27276f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-cbf656f40e43acf60d9596f78204f031dc8c7205626df8f05ce8e88bcf49b597.yml
openapi_spec_hash: 23be5a56248a1a575b34833eb7e7fe49
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

## 1.23.0 (2026-06-01)

Full Changelog: [v1.22.0...v1.23.0](https://github.com/moderation-api/sdk-python/compare/v1.22.0...v1.23.0)

### Features

* **api:** api update ([37cd030](https://github.com/moderation-api/sdk-python/commit/37cd03077140bb42a1b16062cc8d08d5e9fe0a2f))

## 1.22.0 (2026-06-01)

Full Changelog: [v1.21.0...v1.22.0](https://github.com/moderation-api/sdk-python/compare/v1.21.0...v1.22.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.22.0"
version = "1.23.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.22.0" # x-release-please-version
__version__ = "1.23.0" # x-release-please-version
22 changes: 22 additions & 0 deletions src/moderation_api/types/content_submit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"PolicySelfHarm",
"PolicySpam",
"PolicyLowQualityContent",
"PolicyFaceDetection",
"PolicySelfPromotion",
"PolicyPolitical",
"PolicyReligion",
Expand Down Expand Up @@ -365,6 +366,26 @@ class PolicyLowQualityContent(TypedDict, total=False):
threshold: float


class PolicyFaceDetection(TypedDict, total=False):
id: Required[Literal["face_detection"]]

flag: Required[bool]

comparator: Literal["at_least", "fewer_than"]
"""
Flag images that contain "at least" or "fewer than" the configured number of
faces. Defaults to at_least.
"""

count: int
"""Number of faces the comparator applies to.

Defaults to 1, so the default rule flags any image containing a face.
"""

threshold: float


class PolicySelfPromotion(TypedDict, total=False):
id: Required[Literal["self_promotion"]]

Expand Down Expand Up @@ -489,6 +510,7 @@ class PolicyGuideline(TypedDict, total=False):
PolicySelfHarm,
PolicySpam,
PolicyLowQualityContent,
PolicyFaceDetection,
PolicySelfPromotion,
PolicyPolitical,
PolicyReligion,
Expand Down
6 changes: 6 additions & 0 deletions src/moderation_api/types/content_submit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ class PolicyClassifierOutput(BaseModel):

type: Literal["classifier"]

data: Optional[Dict[str, object]] = None
"""Optional structured data produced by the policy.

For face detection: { count, faces: [{ confidence, gender, age }] }.
"""

flagged_fields: Optional[List[str]] = None
"""The keys of the flagged fields if submitting an object."""

Expand Down
Loading