From aa53c353aa31bc66ab018486e0a09ddf9b362e60 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 30 Nov 2026 18:17:16 +0000 Subject: [PATCH] ## Python SDK Changes: * `open_router.tts.list_models()`: `response.data[].endpoints[].output_modalities[].languages` **Added** * `open_router.tts.get_model()`: `response.endpoints[].output_modalities[].languages` **Added** --- .speakeasy/gen.lock | 33 +++++++++---------- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 9 +++++ .speakeasy/workflow.lock | 10 +++--- RELEASES.md | 12 ++++++- docs/components/speechoutputmodality.mdx | 1 + pyproject.toml | 2 +- src/openrouter/_version.py | 4 +-- .../components/speechoutputmodality.py | 28 ++++++++++++++-- uv.lock | 2 +- 10 files changed, 72 insertions(+), 31 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9f95c48f..7dd03051 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: 52e6fdf4210e93487c3774e6ec33dbcf + docChecksum: 94f7f50821324b3ac69922ce4af6ab21 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.213 - configChecksum: 2e6d1442dfccfbbcb558ac1f94c48d3f + releaseVersion: 1.3.214 + configChecksum: cc04b65c73201a982f0923c2e13e9b73 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: f10649c5-fc8b-4a72-a0ed-b412b3c29290 - pristine_commit_hash: 4ab74749d9b83c6ae1502007c7cf8a93ff0d6e36 - pristine_tree_hash: 0ab90787bd4ee9eeeeadd9e5f50574115663e863 + generation_id: 4fd095ce-8400-4b40-816a-44b9e1d0cd44 + pristine_commit_hash: 702894ff28e722dcfebcd7e6d07f69b9d5d89e53 + pristine_tree_hash: 9717e3e8a0dc4ec7f959fd5044fcddf8f858b818 features: python: acceptHeaders: 3.0.0 @@ -8272,8 +8272,8 @@ trackedFiles: pristine_git_object: f1efb6365d56d846e102d1b665590f58a6899211 docs/components/speechoutputmodality.mdx: id: a3a222faacda - last_write_checksum: sha1:911465c8337674c171ca63ddb45289a60e560cd0 - pristine_git_object: e4cd60f7e5bfee0ce852d4c7c2bebb1b61e7e9cc + last_write_checksum: sha1:50b09597521fe00a0cee30215f067afceb147db1 + pristine_git_object: 9f3cff040a0c6508592bf542e3b73877506abf06 docs/components/speechoutputmodalitytype.mdx: id: bc216dcb8091 last_write_checksum: sha1:201cce4f72878e6efd47edf139626c1e02eab816 @@ -11912,8 +11912,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:3c16fd3e8fd333e1ebddb9a194c303bea6183979 - pristine_git_object: b45fa349cb5830faf062951e48ffa239051bb235 + last_write_checksum: sha1:d57054d460fc9f85987dd24e0f3a4d55a58da926 + pristine_git_object: 8220da23d66529fbeb98bbaa2d2f8b082484e434 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -11940,8 +11940,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:8b0a5753f5cdf224362aa738e73a60a18b890c19 - pristine_git_object: 6521f450b2867a860e0837785970a1b1e3050eb6 + last_write_checksum: sha1:5756e41a8aaebec6963428fa44d19c1a0e6275f8 + pristine_git_object: 99201b0e4f6b244050da1c7bc1f069c6a30a1c77 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -15388,8 +15388,8 @@ trackedFiles: pristine_git_object: e25941ae3887aa19695261e2d3e3e512363a3503 src/openrouter/components/speechoutputmodality.py: id: 3c5e674ca4df - last_write_checksum: sha1:10d6d66d75ebb5d03d334d7d0c256c3f3c9343d7 - pristine_git_object: 40509b5004357d4359679a94cfff7a4272a4b3a2 + last_write_checksum: sha1:e9a3e0911c1b6fedbcd885f1d22e2f301b5d06cb + pristine_git_object: 214b48d9188dec40058533040e252865b4d76e96 src/openrouter/components/speechrangeparameter.py: id: 304a657ec76c last_write_checksum: sha1:41173c24c432ae65c0db63825b601468e2edbe3a @@ -22119,6 +22119,5 @@ examples: examplesVersion: 1.0.2 releaseNotes: | ## Python SDK Changes: - * `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** - * `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** - * `open_router.batch.get_results()`: `response.data[].response.body.union(OpenResponsesResult).error.metadata.alignment.rejected.union(Array)[].union(tool_search_call)` **Added** + * `open_router.tts.list_models()`: `response.data[].endpoints[].output_modalities[].languages` **Added** + * `open_router.tts.get_model()`: `response.endpoints[].output_modalities[].languages` **Added** diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8a9ac030..89e1d47e 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.213 + version: 1.3.214 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c2213e8b..242559ab 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -34997,6 +34997,15 @@ components: - 'coral' type: 'speech' properties: + languages: + description: 'BCP 47 tags of the languages the provider documents for this output, for example `en`, `hi` or `pt-BR`. How the language is chosen (from the text, the voice, or a provider option) varies by provider. Absent: not described.' + example: + - 'en' + - 'fr' + - 'hi' + items: + type: 'string' + type: 'array' supported_parameters: $ref: '#/components/schemas/SpeechSupportedParameters' type: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 8efc80b3..6854b944 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:c38fba950c92790fb387ad91e97bfdc7203c77c4b6b6b33ead216e478c0235b2 - sourceBlobDigest: sha256:0fde833d5c39625cd69de36899aa9faf93ed757a45496c4bce66a0fcc31384db + sourceRevisionDigest: sha256:27093a19055b3646d74ec4944977fd2bb2088788f96d4af1f5cdb4bdadf6b305 + sourceBlobDigest: sha256:5a9e3aa76034d33fca8232200a70aaa996fbc479fa76bf557ec0b33204886fe5 tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:c38fba950c92790fb387ad91e97bfdc7203c77c4b6b6b33ead216e478c0235b2 - sourceBlobDigest: sha256:0fde833d5c39625cd69de36899aa9faf93ed757a45496c4bce66a0fcc31384db + sourceRevisionDigest: sha256:27093a19055b3646d74ec4944977fd2bb2088788f96d4af1f5cdb4bdadf6b305 + sourceBlobDigest: sha256:5a9e3aa76034d33fca8232200a70aaa996fbc479fa76bf557ec0b33204886fe5 codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:595305a918a9351fde2ed01fdf22875d09885431eaa004007d2b51a76a8c3e1f + codeSamplesRevisionDigest: sha256:69d54f1d3127bb17747b7423159e833b1285350e9e05113ed299881aa9b98c31 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index cd0212e8..686a360b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4899,4 +4899,14 @@ Based on: ### Generated - [python v1.3.213] . ### Releases -- [PyPI v1.3.213] https://pypi.org/project/openrouter/1.3.213 - . \ No newline at end of file +- [PyPI v1.3.213] https://pypi.org/project/openrouter/1.3.213 - . + +## 2026-11-30 18:14:26 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.214] . +### Releases +- [PyPI v1.3.214] https://pypi.org/project/openrouter/1.3.214 - . \ No newline at end of file diff --git a/docs/components/speechoutputmodality.mdx b/docs/components/speechoutputmodality.mdx index e4cd60f7..9f3cff04 100644 --- a/docs/components/speechoutputmodality.mdx +++ b/docs/components/speechoutputmodality.mdx @@ -6,5 +6,6 @@ title: "SpeechOutputModality" | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `languages` | List[*str*] | ➖ | BCP 47 tags of the languages the provider documents for this output, for example `en`, `hi` or `pt-BR`. How the language is chosen (from the text, the voice, or a provider option) varies by provider. Absent: not described. | [
"en",
"fr",
"hi"
] | | `supported_parameters` | [components.SpeechSupportedParameters](../components/speechsupportedparameters.mdx) | ✔️ | N/A | \{
"instructions": \{
"type": "unknown"
},
"response_format": \{
"type": "enum",
"values": [
"mp3",
"pcm"
]
},
"speed": \{
"max": 4,
"min": 0.25,
"type": "range"
},
"voice": \{
"type": "enum",
"values": [
"alloy",
"coral"
]
}
} | | `type` | [components.SpeechOutputModalityType](../components/speechoutputmodalitytype.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b45fa349..8220da23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.213" +version = "1.3.214" 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 6521f450..99201b0e 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.213" +__version__: str = "1.3.214" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.213 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.214 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/speechoutputmodality.py b/src/openrouter/components/speechoutputmodality.py index 40509b50..214b48d9 100644 --- a/src/openrouter/components/speechoutputmodality.py +++ b/src/openrouter/components/speechoutputmodality.py @@ -5,9 +5,10 @@ SpeechSupportedParameters, SpeechSupportedParametersTypedDict, ) -from openrouter.types import BaseModel -from typing import Literal -from typing_extensions import TypedDict +from openrouter.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import List, Literal, Optional +from typing_extensions import NotRequired, TypedDict SpeechOutputModalityType = Literal["speech",] @@ -16,9 +17,30 @@ class SpeechOutputModalityTypedDict(TypedDict): supported_parameters: SpeechSupportedParametersTypedDict type: SpeechOutputModalityType + languages: NotRequired[List[str]] + r"""BCP 47 tags of the languages the provider documents for this output, for example `en`, `hi` or `pt-BR`. How the language is chosen (from the text, the voice, or a provider option) varies by provider. Absent: not described.""" class SpeechOutputModality(BaseModel): supported_parameters: SpeechSupportedParameters type: SpeechOutputModalityType + + languages: Optional[List[str]] = None + r"""BCP 47 tags of the languages the provider documents for this output, for example `en`, `hi` or `pt-BR`. How the language is chosen (from the text, the voice, or a provider option) varies by provider. Absent: not described.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["languages"]) + 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)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/uv.lock b/uv.lock index 38e9c9ca..41248e02 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.213" +version = "1.3.214" source = { editable = "." } dependencies = [ { name = "httpcore" },