diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 397c420..cdcf20e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.22.0" + ".": "1.23.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e615fc9..b80b97b 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/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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 495db9c..0d697f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 5de6975..11c51dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/moderation_api/_version.py b/src/moderation_api/_version.py index 49ec943..08811a8 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.22.0" # x-release-please-version +__version__ = "1.23.0" # x-release-please-version diff --git a/src/moderation_api/types/content_submit_params.py b/src/moderation_api/types/content_submit_params.py index 41362e8..d7274cf 100644 --- a/src/moderation_api/types/content_submit_params.py +++ b/src/moderation_api/types/content_submit_params.py @@ -42,6 +42,7 @@ "PolicySelfHarm", "PolicySpam", "PolicyLowQualityContent", + "PolicyFaceDetection", "PolicySelfPromotion", "PolicyPolitical", "PolicyReligion", @@ -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"]] @@ -489,6 +510,7 @@ class PolicyGuideline(TypedDict, total=False): PolicySelfHarm, PolicySpam, PolicyLowQualityContent, + PolicyFaceDetection, PolicySelfPromotion, PolicyPolitical, PolicyReligion, diff --git a/src/moderation_api/types/content_submit_response.py b/src/moderation_api/types/content_submit_response.py index ce9a2e2..7133c17 100644 --- a/src/moderation_api/types/content_submit_response.py +++ b/src/moderation_api/types/content_submit_response.py @@ -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."""