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.0.1"
".": "1.0.2"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.0.2 (2025-12-09)

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

### Chores

* add missing docstrings ([02bdf8f](https://github.com/moderation-api/sdk-python/commit/02bdf8ffdef877fdb38df5c8215f241c0af2936e))

## 1.0.1 (2025-12-09)

Full Changelog: [v1.0.0...v1.0.1](https://github.com/moderation-api/sdk-python/compare/v1.0.0...v1.0.1)
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.0.1"
version = "1.0.2"
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.0.1" # x-release-please-version
__version__ = "1.0.2" # x-release-please-version
2 changes: 2 additions & 0 deletions src/moderation_api/types/actions/execute_execute_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@


class ExecuteExecuteResponse(BaseModel):
"""Execution result"""

success: bool
"""Whether the action was executed successfully"""
5 changes: 5 additions & 0 deletions src/moderation_api/types/author_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class AuthorCreateParams(TypedDict, total=False):


class MetadataTyped(TypedDict, total=False):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool]
"""Whether the author's email is verified"""

Expand Down
9 changes: 9 additions & 0 deletions src/moderation_api/types/author_create_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class Block(BaseModel):
"""Block or suspension details, if applicable. Null if the author is enabled."""

reason: Optional[str] = None
"""The moderators reason why the author was blocked or suspended."""

Expand All @@ -19,6 +21,11 @@ class Block(BaseModel):


class Metadata(BaseModel):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool] = None
"""Whether the author's email is verified"""

Expand Down Expand Up @@ -59,6 +66,8 @@ class Metrics(BaseModel):


class RiskEvaluation(BaseModel):
"""Risk assessment details, if available."""

risk_level: Optional[float] = None
"""Calculated risk level based on more than 10 behavioral signals."""

Expand Down
9 changes: 9 additions & 0 deletions src/moderation_api/types/author_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@


class AuthorBlock(BaseModel):
"""Block or suspension details, if applicable. Null if the author is enabled."""

reason: Optional[str] = None
"""The moderators reason why the author was blocked or suspended."""

Expand All @@ -28,6 +30,11 @@ class AuthorBlock(BaseModel):


class AuthorMetadata(BaseModel):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool] = None
"""Whether the author's email is verified"""

Expand Down Expand Up @@ -68,6 +75,8 @@ class AuthorMetrics(BaseModel):


class AuthorRiskEvaluation(BaseModel):
"""Risk assessment details, if available."""

risk_level: Optional[float] = None
"""Calculated risk level based on more than 10 behavioral signals."""

Expand Down
9 changes: 9 additions & 0 deletions src/moderation_api/types/author_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class Block(BaseModel):
"""Block or suspension details, if applicable. Null if the author is enabled."""

reason: Optional[str] = None
"""The moderators reason why the author was blocked or suspended."""

Expand All @@ -19,6 +21,11 @@ class Block(BaseModel):


class Metadata(BaseModel):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool] = None
"""Whether the author's email is verified"""

Expand Down Expand Up @@ -59,6 +66,8 @@ class Metrics(BaseModel):


class RiskEvaluation(BaseModel):
"""Risk assessment details, if available."""

risk_level: Optional[float] = None
"""Calculated risk level based on more than 10 behavioral signals."""

Expand Down
5 changes: 5 additions & 0 deletions src/moderation_api/types/author_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class AuthorUpdateParams(TypedDict, total=False):


class MetadataTyped(TypedDict, total=False):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool]
"""Whether the author's email is verified"""

Expand Down
9 changes: 9 additions & 0 deletions src/moderation_api/types/author_update_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class Block(BaseModel):
"""Block or suspension details, if applicable. Null if the author is enabled."""

reason: Optional[str] = None
"""The moderators reason why the author was blocked or suspended."""

Expand All @@ -19,6 +21,11 @@ class Block(BaseModel):


class Metadata(BaseModel):
"""Additional metadata provided by your system.

We recommend including any relevant information that may assist in the moderation process.
"""

email_verified: Optional[bool] = None
"""Whether the author's email is verified"""

Expand Down Expand Up @@ -59,6 +66,8 @@ class Metrics(BaseModel):


class RiskEvaluation(BaseModel):
"""Risk assessment details, if available."""

risk_level: Optional[float] = None
"""Calculated risk level based on more than 10 behavioral signals."""

Expand Down
18 changes: 18 additions & 0 deletions src/moderation_api/types/content_submit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,55 +85,71 @@ class ContentSubmitParams(TypedDict, total=False):


class ContentText(TypedDict, total=False):
"""Text"""

text: Required[str]
"""The content text"""

type: Required[Literal["text"]]


class ContentImage(TypedDict, total=False):
"""Image"""

type: Required[Literal["image"]]

url: Required[str]
"""A public URL of the image content"""


class ContentVideo(TypedDict, total=False):
"""Video"""

type: Required[Literal["video"]]

url: Required[str]
"""A public URL of the video content"""


class ContentAudio(TypedDict, total=False):
"""Audio"""

type: Required[Literal["audio"]]

url: Required[str]
"""The URL of the audio content"""


class ContentObjectDataText(TypedDict, total=False):
"""Text"""

text: Required[str]
"""The content text"""

type: Required[Literal["text"]]


class ContentObjectDataImage(TypedDict, total=False):
"""Image"""

type: Required[Literal["image"]]

url: Required[str]
"""A public URL of the image content"""


class ContentObjectDataVideo(TypedDict, total=False):
"""Video"""

type: Required[Literal["video"]]

url: Required[str]
"""A public URL of the video content"""


class ContentObjectDataAudio(TypedDict, total=False):
"""Audio"""

type: Required[Literal["audio"]]

url: Required[str]
Expand All @@ -146,6 +162,8 @@ class ContentObjectDataAudio(TypedDict, total=False):


class ContentObject(TypedDict, total=False):
"""Object"""

data: Required[Dict[str, ContentObjectData]]
"""Values in the object. Can be mixed content types."""

Expand Down
31 changes: 31 additions & 0 deletions src/moderation_api/types/content_submit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@


class AuthorBlock(BaseModel):
"""Block or suspension details, if applicable. Null if the author is enabled."""

reason: Optional[str] = None
"""The moderators reason why the author was blocked or suspended."""

Expand All @@ -48,6 +50,11 @@ class AuthorTrustLevel(BaseModel):


class Author(BaseModel):
"""The author of the content if your account has authors enabled.

Requires you to send authorId when submitting content.
"""

id: str
"""Author ID in Moderation API"""

Expand All @@ -64,27 +71,35 @@ class Author(BaseModel):


class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText(BaseModel):
"""Text"""

text: str
"""The content text"""

type: Literal["text"]


class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemImage(BaseModel):
"""Image"""

type: Literal["image"]

url: str
"""A public URL of the image content"""


class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemVideo(BaseModel):
"""Video"""

type: Literal["video"]

url: str
"""A public URL of the video content"""


class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemAudio(BaseModel):
"""Audio"""

type: Literal["audio"]

url: str
Expand All @@ -100,6 +115,8 @@ class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObj


class Content(BaseModel):
"""Potentially modified content."""

id: str
"""The unique identifier for the content.

Expand All @@ -119,6 +136,8 @@ class Content(BaseModel):


class Evaluation(BaseModel):
"""The evaluation of the content after running the channel policies."""

flag_probability: float
"""The probability that the content should be flagged."""

Expand All @@ -136,6 +155,8 @@ class Evaluation(BaseModel):


class InsightSentimentInsight(BaseModel):
"""Sentiment insight"""

id: Literal["sentiment"]

probability: float
Expand All @@ -146,6 +167,8 @@ class InsightSentimentInsight(BaseModel):


class InsightLanguageInsight(BaseModel):
"""Language insight"""

id: Literal["language"]

probability: float
Expand All @@ -159,6 +182,8 @@ class InsightLanguageInsight(BaseModel):


class Meta(BaseModel):
"""Metadata about the moderation request"""

channel_key: str
"""The unique key of the channel where the content was handled.

Expand All @@ -183,6 +208,8 @@ class PolicyClassifierOutputLabel(BaseModel):


class PolicyClassifierOutput(BaseModel):
"""Classifier policy."""

id: str
"""The unique identifier for the classifier output."""

Expand All @@ -207,6 +234,8 @@ class PolicyEntityMatcherOutputMatch(BaseModel):


class PolicyEntityMatcherOutput(BaseModel):
"""Entity matcher policy."""

id: str

flagged: bool
Expand All @@ -224,6 +253,8 @@ class PolicyEntityMatcherOutput(BaseModel):


class Recommendation(BaseModel):
"""The recommendation for the content based on the evaluation."""

action: Literal["review", "allow", "reject"]
"""The action to take based on the recommendation"""

Expand Down
Loading