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.8.0"
".": "1.9.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%2Fmoderation-api-422330754281be38d7919f08a9d1e7862cbdc6921602473cb07a8f2022635832.yml
openapi_spec_hash: 7e6fa61ced995dc03e0ccd3e11fb121c
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-67a3fe4439c3aa74fb2c18b207b43c790d42bab7bfd7e5e16f3e1046765ec959.yml
openapi_spec_hash: c87b33c2c72a172da02ed75d4e79eb70
config_hash: 6a52f6ae7d55cf3b4e91538cc7752aeb
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 1.9.0 (2026-02-20)

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

### Features

* **api:** api update ([3e62dda](https://github.com/moderation-api/sdk-python/commit/3e62dda30d79c73a9b4fa3b7a202f2d2a518a260))


### Chores

* format all `api.md` files ([5a7c325](https://github.com/moderation-api/sdk-python/commit/5a7c325071957fec9830ac78ca74942fc869ec58))
* **internal:** bump dependencies ([1f203f8](https://github.com/moderation-api/sdk-python/commit/1f203f8daf18535d007d7c3f1246672ab8fea1a9))
* **internal:** fix lint error on Python 3.14 ([784cacf](https://github.com/moderation-api/sdk-python/commit/784cacf3ebe73f8e83bc3e091d1d5ba385a907a7))
* **internal:** remove mock server code ([4e8ce8c](https://github.com/moderation-api/sdk-python/commit/4e8ce8c633cefb04e03fd11e9705517556d00398))

## 1.8.0 (2026-02-06)

Full Changelog: [v1.7.0...v1.8.0](https://github.com/moderation-api/sdk-python/compare/v1.7.0...v1.8.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.8.0"
version = "1.9.0"
description = "The official Python library for the moderation-api API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
18 changes: 9 additions & 9 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
-e .
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
anyio==4.12.1
# via
# httpx
# moderation-api
backports-asyncio-runner==1.2.0 ; python_full_version < '3.11'
# via pytest-asyncio
certifi==2025.11.12
certifi==2026.1.4
# via
# httpcore
# httpx
Expand All @@ -36,7 +36,7 @@ idna==3.11
# via
# anyio
# httpx
importlib-metadata==8.7.0
importlib-metadata==8.7.1
iniconfig==2.1.0 ; python_full_version < '3.10'
# via pytest
iniconfig==2.3.0 ; python_full_version >= '3.10'
Expand All @@ -50,11 +50,11 @@ mdurl==0.1.2
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
nodeenv==1.9.1
nodeenv==1.10.0
# via pyright
packaging==25.0
# via pytest
pathspec==0.12.1
pathspec==1.0.3
# via mypy
pluggy==1.6.0
# via pytest
Expand All @@ -71,7 +71,7 @@ pytest==8.4.2 ; python_full_version < '3.10'
# via
# pytest-asyncio
# pytest-xdist
pytest==9.0.1 ; python_full_version >= '3.10'
pytest==9.0.2 ; python_full_version >= '3.10'
# via
# pytest-asyncio
# pytest-xdist
Expand All @@ -82,14 +82,14 @@ python-dateutil==2.9.0.post0 ; python_full_version < '3.10'
# via time-machine
respx==0.22.0
rich==14.2.0
ruff==0.14.7
ruff==0.14.13
six==1.17.0 ; python_full_version < '3.10'
# via python-dateutil
sniffio==1.3.1
# via moderation-api
time-machine==2.19.0 ; python_full_version < '3.10'
time-machine==3.1.0 ; python_full_version >= '3.10'
tomli==2.3.0 ; python_full_version < '3.11'
time-machine==3.2.0 ; python_full_version >= '3.10'
tomli==2.4.0 ; python_full_version < '3.11'
# via
# mypy
# pytest
Expand Down
2 changes: 1 addition & 1 deletion scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ uv run ruff check --fix .
uv run ruff format

echo "==> Formatting docs"
uv run python scripts/utils/ruffen-docs.py README.md api.md
uv run python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

export DEFER_PYDANTIC_BUILD=false

Expand Down
2 changes: 1 addition & 1 deletion src/moderation_api/_utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool:
else:
import types

return tp is Union or tp is types.UnionType
return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap]


def is_typeddict(tp: Type[Any]) -> bool:
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.8.0" # x-release-please-version
__version__ = "1.9.0" # x-release-please-version
10 changes: 8 additions & 2 deletions src/moderation_api/types/content_submit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ class ContentImage(TypedDict, total=False):

type: Required[Literal["image"]]

url: Required[str]
data: str
"""Base64-encoded image data"""

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


Expand Down Expand Up @@ -143,7 +146,10 @@ class ContentObjectDataImage(TypedDict, total=False):

type: Required[Literal["image"]]

url: Required[str]
data: str
"""Base64-encoded image data"""

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


Expand Down
5 changes: 4 additions & 1 deletion src/moderation_api/types/content_submit_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObj

type: Literal["image"]

url: str
data: Optional[str] = None
"""Base64-encoded image data"""

url: Optional[str] = None
"""A public URL of the image content"""


Expand Down
Loading