diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 503c84f5..dfc564e5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: c48cf606-fb42-4a45-9c23-8f0555307828 management: - docChecksum: 2d73f38a6297fd40409ad34c6be52a2c + docChecksum: 178b6484b9116efe8e2d2fb1e571d038 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 0.11.43 - configChecksum: 04bad7a65b1d6cf7e30945bf93de36e9 + releaseVersion: 0.11.44 + configChecksum: ca6d256e81bc9b0bcbf4a9852a8ee6fd repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: f7b92d31-5ac0-46bc-bd4c-70de8794b24a - pristine_commit_hash: 1f2d7491b5f0bea6854b2213e40cfcf0df43c470 - pristine_tree_hash: 5a98bdca11935ecb26075a6694c125daad346bad + generation_id: cb7fe95e-b30b-4e7c-9a6e-197bf5b852a5 + pristine_commit_hash: a1d9ea833931b9fbaf638eb9e2773585163d23ee + pristine_tree_hash: 2c2952dd80f418431c91969ceb539c0b24e05d6f features: python: acceptHeaders: 3.0.0 @@ -1258,8 +1258,8 @@ trackedFiles: pristine_git_object: 450638f0c28d1a9097b687476fe5ccaa554ed8c4 docs/components/contentfilteraction.mdx: id: 11728ebb9679 - last_write_checksum: sha1:c2e70a8136e1af5a9a0e2abd930e5cd3bdb880a1 - pristine_git_object: 8419defc10e832b66662ad7a87e56f57c3c691e2 + last_write_checksum: sha1:7229d738394684c0cb32a45230469d182ca08520 + pristine_git_object: 55e6d46227f6686d52c1d09268ec6eca8ffb32b8 docs/components/contentfilterbuiltinaction.mdx: id: 08bebf2def2b last_write_checksum: sha1:74b4771533db4f1dedb3403d6b5ea9bf0486f55d @@ -1430,8 +1430,8 @@ trackedFiles: pristine_git_object: 67494d04412539e0cb0b406ef4e4cce61b3a6c87 docs/components/createguardrailrequest.mdx: id: c1a768f054c0 - last_write_checksum: sha1:4be348500854ec5c2cb903ad498730b1893de714 - pristine_git_object: 1c7c87df72d92253b110e550066407bcd057ef87 + last_write_checksum: sha1:05ec4369595f00c26c880f2164733bb390e0b268 + pristine_git_object: efdd55195f2edaa9190b6ceada406c559bb58101 docs/components/createguardrailresponse.mdx: id: 1477eebdf505 last_write_checksum: sha1:15a74cf2abd149416117cc525e6fad918d536afc @@ -5034,8 +5034,8 @@ trackedFiles: pristine_git_object: 335feb18256a83af9c732525307d1432a718f3a1 docs/components/updateguardrailrequest.mdx: id: 450912b18db6 - last_write_checksum: sha1:fe895becd42233f628907590d8cde52a7a0c2499 - pristine_git_object: be349dd72e39c127967315f3914d3f7fc6c6b71f + last_write_checksum: sha1:a5cd2646205fcd077ac20b5fcddfc3c7b8f64353 + pristine_git_object: aa280145e50df5b76f5c9fcc63b335dd8158799b docs/components/updateguardrailresponse.mdx: id: e00dc0a0c6e0 last_write_checksum: sha1:9fa2b237c77138fad34fce39a922eeafb11964a8 @@ -6634,8 +6634,8 @@ trackedFiles: pristine_git_object: f262b34982a18293f5ae22bfbbf385010bfcdc9c docs/sdks/guardrails/README.mdx: id: a0cd4218b8fa - last_write_checksum: sha1:0bd55d09aafcf999783a1d433dcb4f3273831a18 - pristine_git_object: b24fc1614a849b48277db5b8a2adf6a4c2651db3 + last_write_checksum: sha1:f527fd75a617e0bd58bb500dee9e60319585b183 + pristine_git_object: 2b3bb1cef3ad1ba8a6d7bee3b2fa5b5034124a18 docs/sdks/images/README.mdx: id: 534a6c102c4f last_write_checksum: sha1:1c0a9c704bdd9090f5a0a74f4d9ae0c4360707bb @@ -6694,8 +6694,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:4f942e5ae36efbfec1c317c36882c2cc7dc0ce97 - pristine_git_object: 0550df9d19a39b71e93fea21c147124ca7d4dd3d + last_write_checksum: sha1:8f308c768d57d16801bfe842805796a35082e090 + pristine_git_object: 4dd89d3a936829f278fe3d6964a579b0621000b9 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -6722,8 +6722,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:bbc75e6e7598078a7f2e39732eb64f613a04d096 - pristine_git_object: f7e0c7d9702f6dfb83f6121f357f0d1041d7253f + last_write_checksum: sha1:1ff83aa8ae9205e5fef8b0e380cf79a35801f075 + pristine_git_object: 60ed9d8d7e57659294cf9952dab9f6a1d40a8c93 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:9e709b71dd0611056dc0cec6150b578defe32841 @@ -7322,8 +7322,8 @@ trackedFiles: pristine_git_object: 30240faf4ac0c14701e9c0216960898351affa4f src/openrouter/components/contentfilteraction.py: id: 55792ae75016 - last_write_checksum: sha1:450250c8a4cf3f24f3a6c2208a7d8be348b54b37 - pristine_git_object: 55c559ec7a453e6aefa58dcb43738b7577ea79ae + last_write_checksum: sha1:cba4f155efe30819eea009eaf90bdbf0a497b7b0 + pristine_git_object: ffd05130f2c13fe856a7b08965b6fdd9ec5bc3ea src/openrouter/components/contentfilterbuiltinaction.py: id: a7fbc29e9e94 last_write_checksum: sha1:da020541530a08c0e94babe42c024d53fac8e8c2 @@ -7402,8 +7402,8 @@ trackedFiles: pristine_git_object: fcfd9d646f216fdbb715cbbaefa4382d75750b79 src/openrouter/components/createguardrailrequest.py: id: 34d69149fb33 - last_write_checksum: sha1:de39a253f2045f0185536b24c8a4983b9f96fb74 - pristine_git_object: 83ee2b358b34064762f7560d3c3c9fded954f8d4 + last_write_checksum: sha1:215f5ffbadd7bbbac96d8881ea58cbb277dd9249 + pristine_git_object: 946ca50747810ad90f4381637d863250b4cbc012 src/openrouter/components/createguardrailresponse.py: id: b4e1bdf1de5b last_write_checksum: sha1:ae20a5e7425510c240e5697d847b1cae65940bd6 @@ -8866,8 +8866,8 @@ trackedFiles: pristine_git_object: a3664695c9722c531f7694851da76e51c2efe4fb src/openrouter/components/updateguardrailrequest.py: id: 6a557cd822a0 - last_write_checksum: sha1:b5377f5f986039b0ff74b9f5d1b8a45247b6c4b1 - pristine_git_object: 22e9f13f221efafeb7c2828e22c63cdc30cd86c4 + last_write_checksum: sha1:4f9ddb5185fa7e7c51324ee517d8da7306b62e50 + pristine_git_object: 077f83f37f4aca144accd15e36a5ed9b4e15bf98 src/openrouter/components/updateguardrailresponse.py: id: 7b068d26ce31 last_write_checksum: sha1:2b63cbb90747f07f775d9a22e80f74c67221fea8 @@ -9118,8 +9118,8 @@ trackedFiles: pristine_git_object: f6dbf5440466ba6b1d92442cad1b91e2b3587c52 src/openrouter/guardrails.py: id: 705839f34e66 - last_write_checksum: sha1:1f26fa2b59f6b779763d6b7041ca44c46899aa4d - pristine_git_object: 6a7bc4ab1e1f7b30ea28790781b64fac0dbde138 + last_write_checksum: sha1:0cfd3f3cab5c34d33c425aab439fa1e4a4599e54 + pristine_git_object: e80ca9d5d26f8048f96c4a14b56e3568c5694d60 src/openrouter/httpclient.py: id: e9311185443d last_write_checksum: sha1:5e55338d6ee9f01ab648cad4380201a8a3da7dd7 @@ -11189,3 +11189,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: "## Python SDK Changes:\n* `open_router.guardrails.list()`: `response.data[].content_filters[].action.enum(flag)` **Added**\n* `open_router.guardrails.create()`: \n * `request.content_filters[].action.enum(flag)` **Added**\n * `response.data.content_filters[].action.enum(flag)` **Added**\n* `open_router.guardrails.get()`: `response.data.content_filters[].action.enum(flag)` **Added**\n* `open_router.guardrails.update()`: \n * `request.content_filters[].action.enum(flag)` **Added**\n * `response.data.content_filters[].action.enum(flag)` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 76e163c5..61cd1a1d 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 0.11.43 + version: 0.11.44 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 8cfa3f8c..cb20d1fc 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -6302,6 +6302,7 @@ components: enum: - 'redact' - 'block' + - 'flag' example: 'block' type: 'string' x-speakeasy-unknown-values: allow @@ -6787,7 +6788,7 @@ components: - 'array' - 'null' content_filter_builtins: - description: 'Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.' + description: 'Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action.' example: - action: 'block' slug: 'regex-prompt-injection' @@ -22817,7 +22818,7 @@ components: - 'array' - 'null' content_filter_builtins: - description: 'Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only.' + description: 'Builtin content filters to apply. Set to null to remove. Every builtin slug supports "block", "redact", and the detect-only "flag" action.' example: - action: 'block' slug: 'regex-prompt-injection' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 59b0e5bc..4f4bb389 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.787.0 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:98c4376653e15b751051ed9de63ec84d169dba7e115bddb5946d61bf910c21ac - sourceBlobDigest: sha256:87ebfc99dbc00ea606e7f0b8474a8c5e925b4c3a4451059269e28dffb48823f5 + sourceRevisionDigest: sha256:d2dfc095c4f3dfd7b0004a11dde8372d5f137cffa8ebd3fe019f14c08b2a6880 + sourceBlobDigest: sha256:43e46fc77ef28504e55ffb04ac6a711f13931339b4c208ae9bb82080fe176c3b tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:98c4376653e15b751051ed9de63ec84d169dba7e115bddb5946d61bf910c21ac - sourceBlobDigest: sha256:87ebfc99dbc00ea606e7f0b8474a8c5e925b4c3a4451059269e28dffb48823f5 + sourceRevisionDigest: sha256:d2dfc095c4f3dfd7b0004a11dde8372d5f137cffa8ebd3fe019f14c08b2a6880 + sourceBlobDigest: sha256:43e46fc77ef28504e55ffb04ac6a711f13931339b4c208ae9bb82080fe176c3b codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:44e2eb4e1bd1198ffd6daa5d7dc97770b6f8366c2bb5bc16dc55deafd2384aa4 + codeSamplesRevisionDigest: sha256:9f3dffc725d7495d12b4e88e3876780fe261ca17c9903d8e3e441010fb2d7fce workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 77ae4520..1d8d3c84 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -538,4 +538,14 @@ Based on: ### Generated - [python v0.11.43] . ### Releases -- [PyPI v0.11.43] https://pypi.org/project/openrouter/0.11.43 - . \ No newline at end of file +- [PyPI v0.11.43] https://pypi.org/project/openrouter/0.11.43 - . + +## 2026-07-17 20:53:08 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.11.44] . +### Releases +- [PyPI v0.11.44] https://pypi.org/project/openrouter/0.11.44 - . \ No newline at end of file diff --git a/docs/components/contentfilteraction.mdx b/docs/components/contentfilteraction.mdx index 8419defc..55e6d462 100644 --- a/docs/components/contentfilteraction.mdx +++ b/docs/components/contentfilteraction.mdx @@ -20,3 +20,4 @@ This is an open enum. Unrecognized values will not fail type checks. - `"redact"` - `"block"` +- `"flag"` diff --git a/docs/components/createguardrailrequest.mdx b/docs/components/createguardrailrequest.mdx index 1c7c87df..efdd5519 100644 --- a/docs/components/createguardrailrequest.mdx +++ b/docs/components/createguardrailrequest.mdx @@ -8,7 +8,7 @@ title: "CreateGuardrailRequest" | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | | `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | | ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | diff --git a/docs/components/updateguardrailrequest.mdx b/docs/components/updateguardrailrequest.mdx index be349dd7..aa280145 100644 --- a/docs/components/updateguardrailrequest.mdx +++ b/docs/components/updateguardrailrequest.mdx @@ -8,7 +8,7 @@ title: "UpdateGuardrailRequest" | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. Every builtin slug supports "block", "redact", and the detect-only "flag" action. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | | `content_filters` | List[[components.ContentFilterEntry](../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | | ~~`enforce_zdr`~~ | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | diff --git a/docs/sdks/guardrails/README.mdx b/docs/sdks/guardrails/README.mdx index b24fc161..2b3bb1ce 100644 --- a/docs/sdks/guardrails/README.mdx +++ b/docs/sdks/guardrails/README.mdx @@ -113,7 +113,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2",
"anthropic/claude-4.5-opus-20251124",
"deepseek/deepseek-r1-0528:free"
] | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | List of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Every builtin slug supports "block", "redact", and the detect-only "flag" action. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | | `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply to request messages | [
\{
"action": "redact",
"label": "[API_KEY]",
"pattern": "\\b(sk-[a-zA-Z0-9]\{48})\\b"
}
] | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the guardrail | A guardrail for limiting API usage | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false | @@ -274,7 +274,7 @@ with OpenRouter( | `x_open_router_categories` | *Optional[str]* | :heavy_minus_sign: | Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
| | | `allowed_models` | List[*str*] | :heavy_minus_sign: | Array of model identifiers (slug or canonical_slug accepted) | [
"openai/gpt-5.2"
] | | `allowed_providers` | List[*str*] | :heavy_minus_sign: | New list of allowed provider IDs | [
"openai",
"anthropic",
"deepseek"
] | -| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. The "flag" action is only supported for "regex-prompt-injection"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept "block" or "redact" only. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | +| `content_filter_builtins` | List[[components.ContentFilterBuiltinEntryInput](../../components/contentfilterbuiltinentryinput.mdx)] | :heavy_minus_sign: | Builtin content filters to apply. Set to null to remove. Every builtin slug supports "block", "redact", and the detect-only "flag" action. | [
\{
"action": "block",
"slug": "regex-prompt-injection"
}
] | | `content_filters` | List[[components.ContentFilterEntry](../../components/contentfilterentry.mdx)] | :heavy_minus_sign: | Custom regex content filters to apply. Set to null to remove. | null | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | New description for the guardrail | Updated description | | `enforce_zdr` | *OptionalNullable[bool]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | true | diff --git a/pyproject.toml b/pyproject.toml index 0550df9d..4dd89d3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "0.11.43" +version = "0.11.44" description = "Official Python Client SDK for OpenRouter." authors = [{ name = "OpenRouter" },] readme = "README-PYPI.md" diff --git a/src/openrouter/_version.py b/src/openrouter/_version.py index f7e0c7d9..60ed9d8d 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "0.11.43" +__version__: str = "0.11.44" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 0.11.43 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 0.11.44 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/contentfilteraction.py b/src/openrouter/components/contentfilteraction.py index 55c559ec..ffd05130 100644 --- a/src/openrouter/components/contentfilteraction.py +++ b/src/openrouter/components/contentfilteraction.py @@ -9,6 +9,7 @@ Literal[ "redact", "block", + "flag", ], UnrecognizedStr, ] diff --git a/src/openrouter/components/createguardrailrequest.py b/src/openrouter/components/createguardrailrequest.py index 83ee2b35..946ca507 100644 --- a/src/openrouter/components/createguardrailrequest.py +++ b/src/openrouter/components/createguardrailrequest.py @@ -30,7 +30,7 @@ class CreateGuardrailRequestTypedDict(TypedDict): content_filter_builtins: NotRequired[ Nullable[List[ContentFilterBuiltinEntryInputTypedDict]] ] - r"""Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only.""" + r"""Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.""" content_filters: NotRequired[Nullable[List[ContentFilterEntryTypedDict]]] r"""Custom regex content filters to apply to request messages""" description: NotRequired[Nullable[str]] @@ -72,7 +72,7 @@ class CreateGuardrailRequest(BaseModel): content_filter_builtins: OptionalNullable[List[ContentFilterBuiltinEntryInput]] = ( UNSET ) - r"""Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only.""" + r"""Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.""" content_filters: OptionalNullable[List[ContentFilterEntry]] = UNSET r"""Custom regex content filters to apply to request messages""" diff --git a/src/openrouter/components/updateguardrailrequest.py b/src/openrouter/components/updateguardrailrequest.py index 22e9f13f..077f83f3 100644 --- a/src/openrouter/components/updateguardrailrequest.py +++ b/src/openrouter/components/updateguardrailrequest.py @@ -28,7 +28,7 @@ class UpdateGuardrailRequestTypedDict(TypedDict): content_filter_builtins: NotRequired[ Nullable[List[ContentFilterBuiltinEntryInputTypedDict]] ] - r"""Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only.""" + r"""Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.""" content_filters: NotRequired[Nullable[List[ContentFilterEntryTypedDict]]] r"""Custom regex content filters to apply. Set to null to remove.""" description: NotRequired[Nullable[str]] @@ -67,7 +67,7 @@ class UpdateGuardrailRequest(BaseModel): content_filter_builtins: OptionalNullable[List[ContentFilterBuiltinEntryInput]] = ( UNSET ) - r"""Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only.""" + r"""Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action.""" content_filters: OptionalNullable[List[ContentFilterEntry]] = UNSET r"""Custom regex content filters to apply. Set to null to remove.""" diff --git a/src/openrouter/guardrails.py b/src/openrouter/guardrails.py index 6a7bc4ab..e80ca9d5 100644 --- a/src/openrouter/guardrails.py +++ b/src/openrouter/guardrails.py @@ -392,7 +392,7 @@ def create( :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param allowed_providers: List of allowed provider IDs - :param content_filter_builtins: Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. + :param content_filter_builtins: Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action. :param content_filters: Custom regex content filters to apply to request messages :param description: Description of the guardrail :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. @@ -606,7 +606,7 @@ async def create_async( :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param allowed_providers: List of allowed provider IDs - :param content_filter_builtins: Builtin content filters to apply. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. + :param content_filter_builtins: Builtin content filters to apply. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action. :param content_filters: Custom regex content filters to apply to request messages :param description: Description of the guardrail :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. @@ -1332,7 +1332,7 @@ def update( :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param allowed_providers: New list of allowed provider IDs - :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. + :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action. :param content_filters: Custom regex content filters to apply. Set to null to remove. :param description: New description for the guardrail :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. @@ -1546,7 +1546,7 @@ async def update_async( :param allowed_models: Array of model identifiers (slug or canonical_slug accepted) :param allowed_providers: New list of allowed provider IDs - :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. The \"flag\" action is only supported for \"regex-prompt-injection\"; PII slugs (email, phone, ssn, credit-card, ip-address, person-name, address) accept \"block\" or \"redact\" only. + :param content_filter_builtins: Builtin content filters to apply. Set to null to remove. Every builtin slug supports \"block\", \"redact\", and the detect-only \"flag\" action. :param content_filters: Custom regex content filters to apply. Set to null to remove. :param description: New description for the guardrail :param enforce_zdr: Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, and enforce_zdr_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. diff --git a/uv.lock b/uv.lock index 5b3e5e55..1ca52a3a 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "0.11.43" +version = "0.11.44" source = { editable = "." } dependencies = [ { name = "httpcore" },