diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65bc55d..6f41ac1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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' @@ -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' @@ -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()); @@ -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' diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 77300d3..fac4999 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -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' diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 8c5f0e4..28dd0fe 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -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: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 69eb19a..ba231b0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.20.0" + ".": "1.21.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 7fc4abc..ec34a10 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-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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 550e093..51c9241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/README.md b/README.md index a3d8831..1fbce18 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ client = ModerationAPI( response = client.content.submit( content={ - "text": "x", + "text": "text", "type": "text", }, ) @@ -63,7 +63,7 @@ client = AsyncModerationAPI( async def main() -> None: response = await client.content.submit( content={ - "text": "x", + "text": "text", "type": "text", }, ) @@ -102,7 +102,7 @@ async def main() -> None: ) as client: response = await client.content.submit( content={ - "text": "x", + "text": "text", "type": "text", }, ) @@ -155,7 +155,7 @@ client = ModerationAPI() try: client.content.submit( content={ - "text": "x", + "text": "text", "type": "text", }, ) @@ -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", }, ) @@ -231,7 +231,7 @@ client = ModerationAPI( # Override per-request: client.with_options(timeout=5.0).content.submit( content={ - "text": "x", + "text": "text", "type": "text", }, ) @@ -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", }, ) @@ -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: diff --git a/pyproject.toml b/pyproject.toml index a1e7d27..4168580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/moderation_api/_version.py b/src/moderation_api/_version.py index 2838e64..7586f49 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.20.0" # x-release-please-version +__version__ = "1.21.0" # x-release-please-version diff --git a/tests/api_resources/test_content.py b/tests/api_resources/test_content.py index 228d58d..fbf989e 100644 --- a/tests/api_resources/test_content.py +++ b/tests/api_resources/test_content.py @@ -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", }, ) @@ -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", @@ -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", }, ) @@ -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: @@ -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", }, ) @@ -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", @@ -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", }, ) @@ -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: diff --git a/tests/test_client.py b/tests/test_client.py index 3e1b849..a327d51 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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__() @@ -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__() @@ -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", } ) @@ -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()}, @@ -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"}, @@ -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__() @@ -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__() @@ -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", } ) @@ -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()}, @@ -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"},