diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index fb64c457..d6af9c3d 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: d549f1f1851d3b8566a88c2c51dca446 + docChecksum: 391051bbe72c2ad9d26d4bcc8bdc9a54 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.111 - configChecksum: 644f7660e9e2fb0ebeee1312909073a7 + releaseVersion: 1.1.112 + configChecksum: 51428b5e8a27ddf2788d8d5c76bb9db2 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 7ebc9620-c5b3-4fdc-b549-4e222b9db662 - pristine_commit_hash: a7776ac3a07a59ba746e8d4accb93f38725ed124 - pristine_tree_hash: 947f90afadc7b47906211180266c3e331a0827cd + generation_id: b2dd422a-ced6-4187-ab9a-62ac3c0e5087 + pristine_commit_hash: 253ef389d0a7f9e472554be901e41616bba27ddc + pristine_tree_hash: 5b7a07d09178eb51eb08b64ebc9b0cd0a1636eb1 features: python: acceptHeaders: 3.0.0 @@ -438,8 +438,8 @@ trackedFiles: pristine_git_object: 6f1e9ce880a0c3173ce7af4d14c8508b686b8ebc docs/components/anthropicsystemclearat.mdx: id: 02e08e8b03f3 - last_write_checksum: sha1:c82d55e50f6a6325fc10eee08812ec0394396b83 - pristine_git_object: 5e433be8b857cc468d41d4e0a6e260b807fe9ab0 + last_write_checksum: sha1:218693075e1fbef7a5771edf41cd93ee7eb430d4 + pristine_git_object: 5634634926c7a09342c219cd0d865234c262baa5 docs/components/anthropictextblockparam.mdx: id: bded5d409e91 last_write_checksum: sha1:ab2ebb14dd5e54bbadf4db4aa919d1b380b844b5 @@ -450,8 +450,8 @@ trackedFiles: pristine_git_object: b6b0d6f9022f2046c713d768125927e22ecc9431 docs/components/anthropicthinkingblockbinding.mdx: id: a1c1acf8200e - last_write_checksum: sha1:56022206d75726c7abc59971c9abcbce45107bfb - pristine_git_object: c5364b3c8a19aca6d9ebc03392a1e62c16c8c98f + last_write_checksum: sha1:7e7df17828f861d85a1bee793b32931eb99769e7 + pristine_git_object: 48a032d0e9eac4798c8c4903880873f967f5dfec docs/components/anthropicthinkingdisplay.mdx: id: e068ddf6374f last_write_checksum: sha1:49fd044eb4759b0f447964cc276b0681ff73a3ec @@ -4330,8 +4330,8 @@ trackedFiles: pristine_git_object: 9b965b8127ff716f9bac7efc3ef89f4a9727795e docs/components/prefixmismatchbehavior.mdx: id: 73d2444913c6 - last_write_checksum: sha1:6f49bdd934501dc4a153fd645e668cae8b0e701f - pristine_git_object: d679a28e6f0aa4b2a398a8ea8f7f77acb0a5454f + last_write_checksum: sha1:9192b93e919ccc08f739324db6d1417f49471d2b + pristine_git_object: bb61620d909ce1c0e4df191e8570184b794ae164 docs/components/preset.mdx: id: 9069cdfaddbc last_write_checksum: sha1:87eebf424e40efb670c2bc0f617c903a6f9d3da5 @@ -7458,8 +7458,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:efbcdc29ac4bfee3f46ae11671b08559d41130fb - pristine_git_object: 1ed6cdf52cf082be603cab094955982904ff9ea9 + last_write_checksum: sha1:22be002a440c13f8a9a4ac3df57128b2120cdb71 + pristine_git_object: b06eb5aba73cf71602d0a12055e249e4d48678eb scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7486,8 +7486,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:cb3f1aedcbfc00d2af7b97c32d0e14a2899ef8d0 - pristine_git_object: 6edf25f6e9267720fa61ef6382d2972490018d1f + last_write_checksum: sha1:a6466e2fb6b09ffa28b5a3039bd0ee92eed793dc + pristine_git_object: acf7031462e82a81914ac31b23acf7fb36d856aa src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:1e0004d8d1d5d797e2b54cd1cabeb7f9489d08e9 @@ -7682,16 +7682,16 @@ trackedFiles: pristine_git_object: 4f9c2bc739541b12c381e3d6265184af879cc1ff src/openrouter/components/anthropicsystemclearat.py: id: 1b0f42791a44 - last_write_checksum: sha1:ddcf1a86c46a4b3ccc974cfae354820e1e638686 - pristine_git_object: 057eb16d600e93a6c675e1a64fbd71212900db1b + last_write_checksum: sha1:d145b38d9f24946a9b96df823b68dc8d89bca935 + pristine_git_object: bbbf46b31d8f513ed5fc5cb1960c0f99e49cbdb2 src/openrouter/components/anthropictextblockparam.py: id: f387daeeb940 last_write_checksum: sha1:d07d4bef39b0f763604a58604da6aa4cb7979590 pristine_git_object: 31a1df2ee27149c8862fb8709f4898ef0535360f src/openrouter/components/anthropicthinkingblockbinding.py: id: e3f9c1ae04b6 - last_write_checksum: sha1:a4d531705224b35ec9be29ca7b832f14218c914a - pristine_git_object: a9eb602db8b20489c47f2da1ef8f0cffd6e79279 + last_write_checksum: sha1:be6fab20c77d4b9cddd70969f09370bdbde3f6a4 + pristine_git_object: fd2bb4ce3210a4ca2e6e2ad6dd0e82d0e11193c0 src/openrouter/components/anthropicthinkingdisplay.py: id: 5d63f1a15f67 last_write_checksum: sha1:a1f845787a9e8bc3d7b4dddfe8a4adad288b16db @@ -12549,3 +12549,6 @@ examples: "503": application/json: {"error": {"code": 503, "message": "Service temporarily unavailable"}} examplesVersion: 1.0.2 +releaseNotes: | + ## Python SDK Changes: + * `open_router.presets.create_presets_messages()`: `request` **Changed** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 880d742d..95ad8fee 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.111 + version: 1.1.112 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 55ac2033..d557d19b 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -1224,17 +1224,46 @@ components: example: expires_at: '2026-04-08T00:00:00Z' id: 'ctr_01abc' + skills: null properties: expires_at: type: 'string' id: type: 'string' + skills: + default: null + items: + $ref: '#/components/schemas/AnthropicContainerSkill' + type: + - 'array' + - 'null' required: - 'id' - 'expires_at' type: - 'object' - 'null' + AnthropicContainerSkill: + example: + skill_id: 'pdf' + type: 'anthropic' + version: 'latest' + properties: + skill_id: + type: 'string' + type: + enum: + - 'anthropic' + - 'custom' + type: 'string' + x-speakeasy-unknown-values: allow + version: + type: 'string' + required: + - 'skill_id' + - 'type' + - 'version' + type: 'object' AnthropicContainerUpload: example: file_id: 'file_01abc' @@ -1855,6 +1884,7 @@ components: AnthropicSystemClearAt: enum: - 'next_user_message' + - 'never' - null example: 'next_user_message' type: @@ -2142,10 +2172,13 @@ components: properties: prefix_mismatch_behavior: enum: + - 'error' - 'drop_block' - type: 'string' - required: - - 'prefix_mismatch_behavior' + - null + type: + - 'string' + - 'null' + x-speakeasy-unknown-values: allow type: - 'object' - 'null' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8e621e59..39919240 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:3aba076b4407c0cc88e6ad82c88b599ff63c04523aa833dafaa633110284a608 - sourceBlobDigest: sha256:8b34e54f118e69e069dc211b1efb1eafed44aa7df8173192a1763f301934f3f1 + sourceRevisionDigest: sha256:3938ad2e3c92f8987a92156cab37108879cd9a562f632d7e879510073773f644 + sourceBlobDigest: sha256:f3d63f1beba255b5508085865039251cc3b27078e7c6c794ad385f1a7100406c tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:3aba076b4407c0cc88e6ad82c88b599ff63c04523aa833dafaa633110284a608 - sourceBlobDigest: sha256:8b34e54f118e69e069dc211b1efb1eafed44aa7df8173192a1763f301934f3f1 + sourceRevisionDigest: sha256:3938ad2e3c92f8987a92156cab37108879cd9a562f632d7e879510073773f644 + sourceBlobDigest: sha256:f3d63f1beba255b5508085865039251cc3b27078e7c6c794ad385f1a7100406c codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:3feac6de4e8259cd5d354fbcb39c304e73504d746c4b7acd80b52dc04cd3e9b5 + codeSamplesRevisionDigest: sha256:95852bded8c80af34c4659490932163f1964d4639ae466559ca1ec0715a34040 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index ef339e86..dade8223 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1899,4 +1899,14 @@ Based on: ### Generated - [python v1.1.111] . ### Releases -- [PyPI v1.1.111] https://pypi.org/project/openrouter/1.1.111 - . \ No newline at end of file +- [PyPI v1.1.111] https://pypi.org/project/openrouter/1.1.111 - . + +## 2026-09-02 00:32:23 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.112] . +### Releases +- [PyPI v1.1.112] https://pypi.org/project/openrouter/1.1.112 - . \ No newline at end of file diff --git a/docs/components/anthropicsystemclearat.mdx b/docs/components/anthropicsystemclearat.mdx index 5e433be8..56346349 100644 --- a/docs/components/anthropicsystemclearat.mdx +++ b/docs/components/anthropicsystemclearat.mdx @@ -17,3 +17,4 @@ value: AnthropicSystemClearAt = "next_user_message" This is an open enum. Unrecognized values will not fail type checks. - `"next_user_message"` +- `"never"` diff --git a/docs/components/anthropicthinkingblockbinding.mdx b/docs/components/anthropicthinkingblockbinding.mdx index c5364b3c..48a032d0 100644 --- a/docs/components/anthropicthinkingblockbinding.mdx +++ b/docs/components/anthropicthinkingblockbinding.mdx @@ -4,6 +4,6 @@ title: "AnthropicThinkingBlockBinding" ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `prefix_mismatch_behavior` | [components.PrefixMismatchBehavior](../components/prefixmismatchbehavior.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `prefix_mismatch_behavior` | [OptionalNullable[components.PrefixMismatchBehavior]](../components/prefixmismatchbehavior.mdx) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/components/prefixmismatchbehavior.mdx b/docs/components/prefixmismatchbehavior.mdx index d679a28e..bb61620d 100644 --- a/docs/components/prefixmismatchbehavior.mdx +++ b/docs/components/prefixmismatchbehavior.mdx @@ -6,10 +6,15 @@ title: "PrefixMismatchBehavior" ```python from openrouter.components import PrefixMismatchBehavior -value: PrefixMismatchBehavior = "drop_block" + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: PrefixMismatchBehavior = "error" ``` ## Values +This is an open enum. Unrecognized values will not fail type checks. + +- `"error"` - `"drop_block"` diff --git a/pyproject.toml b/pyproject.toml index 1ed6cdf5..b06eb5ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.111" +version = "1.1.112" 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 6edf25f6..acf70314 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.111" +__version__: str = "1.1.112" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.111 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.112 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/anthropicsystemclearat.py b/src/openrouter/components/anthropicsystemclearat.py index 057eb16d..bbbf46b3 100644 --- a/src/openrouter/components/anthropicsystemclearat.py +++ b/src/openrouter/components/anthropicsystemclearat.py @@ -5,4 +5,10 @@ from typing import Literal, Union -AnthropicSystemClearAt = Union[Literal["next_user_message",], UnrecognizedStr] +AnthropicSystemClearAt = Union[ + Literal[ + "next_user_message", + "never", + ], + UnrecognizedStr, +] diff --git a/src/openrouter/components/anthropicthinkingblockbinding.py b/src/openrouter/components/anthropicthinkingblockbinding.py index a9eb602d..fd2bb4ce 100644 --- a/src/openrouter/components/anthropicthinkingblockbinding.py +++ b/src/openrouter/components/anthropicthinkingblockbinding.py @@ -1,17 +1,56 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) +from pydantic import model_serializer +from typing import Literal, Union +from typing_extensions import NotRequired, TypedDict -PrefixMismatchBehavior = Literal["drop_block",] +PrefixMismatchBehavior = Union[ + Literal[ + "error", + "drop_block", + ], + UnrecognizedStr, +] class AnthropicThinkingBlockBindingTypedDict(TypedDict): - prefix_mismatch_behavior: PrefixMismatchBehavior + prefix_mismatch_behavior: NotRequired[Nullable[PrefixMismatchBehavior]] class AnthropicThinkingBlockBinding(BaseModel): - prefix_mismatch_behavior: PrefixMismatchBehavior + prefix_mismatch_behavior: OptionalNullable[PrefixMismatchBehavior] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["prefix_mismatch_behavior"]) + nullable_fields = set(["prefix_mismatch_behavior"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/uv.lock b/uv.lock index 4ffa773e..d256c405 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.111" +version = "1.1.112" source = { editable = "." } dependencies = [ { name = "httpcore" },