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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/moderation-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'

Expand All @@ -43,10 +43,10 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/moderation-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'

Expand All @@ -61,7 +61,7 @@ jobs:
github.repository == 'stainless-sdks/moderation-api-python' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -81,10 +81,10 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/moderation-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.10.2'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
version: '0.9.13'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'moderation-api/sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
Expand Down
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.20.0"
".": "1.21.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-e864d762f50e49c0584bbf35eacc43cdb1397f805cca52cb8d4c07781739d0a3.yml
openapi_spec_hash: f511fefb34946e5878ac17f2b3056b1f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-3bb06bde0f76baa35ecc698b0c60371c9eadfd7b58c00b77cbc124d5be5dcb8b.yml
openapi_spec_hash: b4339d93d43fb725be0e98bd3bbf4f0b
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.21.0 (2026-05-19)

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

### Features

* **api:** api update ([e49c52c](https://github.com/moderation-api/sdk-python/commit/e49c52c10ea8c965578db59e6e4c28e6ff5fbc58))

## 1.20.0 (2026-05-12)

Full Changelog: [v1.19.1...v1.20.0](https://github.com/moderation-api/sdk-python/compare/v1.19.1...v1.20.0)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ client = ModerationAPI(

response = client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -63,7 +63,7 @@ client = AsyncModerationAPI(
async def main() -> None:
response = await client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -102,7 +102,7 @@ async def main() -> None:
) as client:
response = await client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -155,7 +155,7 @@ client = ModerationAPI()
try:
client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -203,7 +203,7 @@ client = ModerationAPI(
# Or, configure per-request:
client.with_options(max_retries=5).content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -231,7 +231,7 @@ client = ModerationAPI(
# Override per-request:
client.with_options(timeout=5.0).content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand Down Expand Up @@ -277,7 +277,7 @@ from moderation_api import ModerationAPI
client = ModerationAPI()
response = client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand All @@ -300,7 +300,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
```python
with client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
) as response:
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.20.0"
version = "1.21.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.20.0" # x-release-please-version
__version__ = "1.21.0" # x-release-please-version
16 changes: 8 additions & 8 deletions tests/api_resources/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestContent:
def test_method_submit(self, client: ModerationAPI) -> None:
content = client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand All @@ -33,7 +33,7 @@ def test_method_submit(self, client: ModerationAPI) -> None:
def test_method_submit_with_all_params(self, client: ModerationAPI) -> None:
content = client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
author_id="authorId",
Expand All @@ -59,7 +59,7 @@ def test_method_submit_with_all_params(self, client: ModerationAPI) -> None:
def test_raw_response_submit(self, client: ModerationAPI) -> None:
response = client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand All @@ -74,7 +74,7 @@ def test_raw_response_submit(self, client: ModerationAPI) -> None:
def test_streaming_response_submit(self, client: ModerationAPI) -> None:
with client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
) as response:
Expand All @@ -97,7 +97,7 @@ class TestAsyncContent:
async def test_method_submit(self, async_client: AsyncModerationAPI) -> None:
content = await async_client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand All @@ -108,7 +108,7 @@ async def test_method_submit(self, async_client: AsyncModerationAPI) -> None:
async def test_method_submit_with_all_params(self, async_client: AsyncModerationAPI) -> None:
content = await async_client.content.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
author_id="authorId",
Expand All @@ -134,7 +134,7 @@ async def test_method_submit_with_all_params(self, async_client: AsyncModeration
async def test_raw_response_submit(self, async_client: AsyncModerationAPI) -> None:
response = await async_client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
)
Expand All @@ -149,7 +149,7 @@ async def test_raw_response_submit(self, async_client: AsyncModerationAPI) -> No
async def test_streaming_response_submit(self, async_client: AsyncModerationAPI) -> None:
async with async_client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
) as response:
Expand Down
20 changes: 10 additions & 10 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
with pytest.raises(APITimeoutError):
client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
).__enter__()
Expand All @@ -910,7 +910,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
with pytest.raises(APIStatusError):
client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
).__enter__()
Expand Down Expand Up @@ -944,7 +944,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
)
Expand Down Expand Up @@ -973,7 +973,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
extra_headers={"x-stainless-retry-count": Omit()},
Expand Down Expand Up @@ -1002,7 +1002,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
extra_headers={"x-stainless-retry-count": "42"},
Expand Down Expand Up @@ -1863,7 +1863,7 @@ async def test_retrying_timeout_errors_doesnt_leak(
with pytest.raises(APITimeoutError):
await async_client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
).__aenter__()
Expand All @@ -1880,7 +1880,7 @@ async def test_retrying_status_errors_doesnt_leak(
with pytest.raises(APIStatusError):
await async_client.content.with_streaming_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
).__aenter__()
Expand Down Expand Up @@ -1914,7 +1914,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = await client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
}
)
Expand Down Expand Up @@ -1943,7 +1943,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = await client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
extra_headers={"x-stainless-retry-count": Omit()},
Expand Down Expand Up @@ -1972,7 +1972,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

response = await client.content.with_raw_response.submit(
content={
"text": "x",
"text": "text",
"type": "text",
},
extra_headers={"x-stainless-retry-count": "42"},
Expand Down
Loading