diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 8f88644f..786f26e9 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: d1b96abffbe70fe9d18a0e68456bf0e3 + docChecksum: a1ed014346c4f16464ab5ecc262875cb docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.3.27 - configChecksum: 8e1aa111f5eedd150d7163d092dbc596 + releaseVersion: 1.3.28 + configChecksum: 159e30e365bd518e9eea5cd75396f1d6 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: aea6cfba-febf-4944-8c59-559d33ca5796 - pristine_commit_hash: ce959dc03b41e9baed4c595c1d79f62117ec79cd - pristine_tree_hash: 8f75aaeffc4d498b2b0b09bd5f19af073549fd86 + generation_id: 742d5c87-8e20-4e12-ab1e-a69ceb017371 + pristine_commit_hash: b7d1f00d41b7f010d81639d40dc384a64705f3c1 + pristine_tree_hash: 286d16e187346cc60f3ced032f9e9ca4498b24a3 features: python: acceptHeaders: 3.0.0 @@ -5312,8 +5312,8 @@ trackedFiles: pristine_git_object: 17a39e683c5db9dd5934de2baf6c76af44cb6a58 docs/components/outputapplypatchservertoolitem.mdx: id: c73fb5b689f4 - last_write_checksum: sha1:9237c757ba0ebd1735b00fbb362d0f2ed22d0e63 - pristine_git_object: b27640e16c2d47f021d1ad704079b50b70ce4c5a + last_write_checksum: sha1:8f025f08a5738d5e60e7ff91ba94fc69cefe3592 + pristine_git_object: d8e965bb7d94e1d54da8cd9f149c399cbf73b7b8 docs/components/outputapplypatchservertoolitemtype.mdx: id: 8819a4128df7 last_write_checksum: sha1:cbfca03c03b33ab4a6d7e382664b14a8fe7eaa4c @@ -5392,8 +5392,8 @@ trackedFiles: pristine_git_object: 9bf4d0f91880fb15d6156859b8ac2afd5df9594e docs/components/outputdatetimeitem.mdx: id: 470853c662d9 - last_write_checksum: sha1:16024ed7fffacfd86308b168c7c3a0c8c85be750 - pristine_git_object: c698d7e6556b968190e9ba7e122aa23ed648d2e5 + last_write_checksum: sha1:80541ccfcfa3bd4bfe66d7335ebd1a2622025b95 + pristine_git_object: a3abcac186469b48968887e7c6a695a697fb3762 docs/components/outputdatetimeitemtype.mdx: id: a8219ea3cbbe last_write_checksum: sha1:7eb09027b473e745dee4f4fb533c6e3cc2ed7321 @@ -5472,8 +5472,8 @@ trackedFiles: pristine_git_object: bb97b950d2d81aae3c143d43ad562f820ed49e65 docs/components/outputimagegenerationservertoolitem.mdx: id: 0084a32d49a2 - last_write_checksum: sha1:da5f8f52d7184fc509389988bcbef19b15483c29 - pristine_git_object: 707bc634972cfa205b67e1a451b57b4371430eb5 + last_write_checksum: sha1:2bdb7b1623a165f428c72d9e686f0ea7ced4b050 + pristine_git_object: 4b522ce89f7fbce26932b2b71f59efdfb3a42003 docs/components/outputimagegenerationservertoolitemtype.mdx: id: 7a776acb2987 last_write_checksum: sha1:eead9d15e523ad237d238d4070708fee85716ed7 @@ -5760,8 +5760,8 @@ trackedFiles: pristine_git_object: 241c03053c7755774953081a52b76746ca01b52d docs/components/outputsearchmodelsservertoolitem.mdx: id: c0cc08dcfe8c - last_write_checksum: sha1:759d8a4da3c1230747bd19ccdce9b88e9f7551dd - pristine_git_object: bb1946a0ea7acbacdcd5263b97cb681abb6bcc5e + last_write_checksum: sha1:2ce113b3cd0edcde6ed52aac33a510eb25ef7f80 + pristine_git_object: 0ee05cf72be169cd432120e79b902350b566d604 docs/components/outputsearchmodelsservertoolitemtype.mdx: id: 3c077010a876 last_write_checksum: sha1:fa3bbc7841d41adbebfb43246bfb9d7404280a1b @@ -5836,8 +5836,8 @@ trackedFiles: pristine_git_object: 9c9b6d5923e87acc8d5abcd3ab587324fcda9cdc docs/components/outputtoolsearchservertoolitem.mdx: id: 7106fbb89729 - last_write_checksum: sha1:8001d2a20f8a6cb262cd06cf9926034af39c4b2c - pristine_git_object: af768f21a1d5357ae5e038de9ac0c49cc120fdda + last_write_checksum: sha1:ca50deb8179a0e3c28352bdb1c558b32d209bb4a + pristine_git_object: 7af4c29ce6343c26c09ba9335e4e7c12258f25de docs/components/outputtoolsearchservertoolitemtype.mdx: id: 2b67e805a2ae last_write_checksum: sha1:7d4b330d471721610a9ac7d9f44684fd1a099f7b @@ -5888,8 +5888,8 @@ trackedFiles: pristine_git_object: b98da542c8dc19fe51b8afa402515aaf353e74cb docs/components/outputwebsearchservertoolitem.mdx: id: 0b0f98b9ac54 - last_write_checksum: sha1:e405bff48ef850c2d3fe416f857cf83b69596d23 - pristine_git_object: b7fb42bba9891044ab52955ae6aee6c0d84bc776 + last_write_checksum: sha1:0d006bdd420b2c953346cd5e19955206f391fcc0 + pristine_git_object: 0b1a60766898c5a4a03bdaf134b52ef29bae3b9d docs/components/outputwebsearchservertoolitemaction.mdx: id: a0269d265fbe last_write_checksum: sha1:a5ffa656a464af15548437c19e92be6aef7bfdad @@ -9976,8 +9976,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:984fcd4d70ebc92db6939d878585d9fe80107f49 - pristine_git_object: 87f61eaba85b92fd2eea6d10bbc228f35dbb386c + last_write_checksum: sha1:79a03a25a2956efbd3e42a1ca16e7836905a1174 + pristine_git_object: b93d38f21aa2598da457d1dad3df4be1778587f9 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10004,8 +10004,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:8a2efb73d913c481db11b1295cf358c8a81e7e71 - pristine_git_object: 550534f0e7ae6c001bba40e7a172e4735106f628 + last_write_checksum: sha1:34b48de79f405cabf4d9321e0dced5e487b67f04 + pristine_git_object: f8805030dd9c4d775b5958b00fd0efb2e3a08ee1 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:30f55a360f41376ab194b9ea725fe4e001a5ae1a @@ -11672,8 +11672,8 @@ trackedFiles: pristine_git_object: f499cbbb546232f5cfbfe2c44fb41aefb306c87f src/openrouter/components/inputs_union.py: id: 17d6239cb6a7 - last_write_checksum: sha1:e7216b0014bd1650565f9610d4ba5d8b5b7adf3c - pristine_git_object: 8d4f5d6af0e647677d01ec98dd25c2093705df0b + last_write_checksum: sha1:b1fef5d0b2d02dbee579e83bb43ac8c183a58dc4 + pristine_git_object: fb8db7b12531efc2b6fa21c999b3a9c3c5b83b46 src/openrouter/components/inputtext.py: id: a995ae96be99 last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021 @@ -12288,8 +12288,8 @@ trackedFiles: pristine_git_object: 183c5517cc49967e483846fde66a888334aa4383 src/openrouter/components/outputapplypatchservertoolitem.py: id: e38119e7e094 - last_write_checksum: sha1:898c5619f737c6d387df5ad4b389d1a24780274c - pristine_git_object: 919f2bb6ec91d62dcb223c15e2a25d2830b75ac9 + last_write_checksum: sha1:ec83a93b5c2e800b4f64453356692b3dd63588a3 + pristine_git_object: 3d84fad12beecbc693faaa0ffc8a74608987f8bc src/openrouter/components/outputbashservertoolitem.py: id: 39d03767e214 last_write_checksum: sha1:4be4f57d65fc6954087c0fee1ccc22c8813084a0 @@ -12316,8 +12316,8 @@ trackedFiles: pristine_git_object: ac17f033f87b2ea353705570407c0c8da231bb12 src/openrouter/components/outputdatetimeitem.py: id: d7784d04fba3 - last_write_checksum: sha1:aa341f4d24991cfb5bd596707852b99d6336c95e - pristine_git_object: 379dd07b98d04f3279b933965133bd78f774fa6a + last_write_checksum: sha1:7cbd39d999c5cc9eb090d2c76c651cabf20cd7a2 + pristine_git_object: 905cec9b1c2ecc2dee98833e4e3447a9c19bde56 src/openrouter/components/outputfilesearchcallitem.py: id: 61b88e4356a3 last_write_checksum: sha1:432848dedf66c315d4b443f48514aa017acd7aa4 @@ -12344,8 +12344,8 @@ trackedFiles: pristine_git_object: 47a577f4ccb3fbcc31d67a0871d99eaf28f67ebf src/openrouter/components/outputimagegenerationservertoolitem.py: id: cb34639447d7 - last_write_checksum: sha1:1239baf1204777a7ef0d6ef21fc5c616abd84c41 - pristine_git_object: 7ff53e38d486ce4c2cb663dca0892f0a3cde45be + last_write_checksum: sha1:d678d680b628a0a9e54a81d91d8072c4b354a1e2 + pristine_git_object: 701ad3ba4c28f70015f580e952e558eaa0e82744 src/openrouter/components/outputitemapplypatchcall.py: id: 856499dbec07 last_write_checksum: sha1:4b9865c4c01a5349bb8a81f7b060d7d0f4022ff3 @@ -12376,8 +12376,8 @@ trackedFiles: pristine_git_object: 616b0f5112e106777b4c096aeea6fef58ff32020 src/openrouter/components/outputitems.py: id: 90f107de3116 - last_write_checksum: sha1:600acf9bb535c3568f9aa3e63c4e3a11f13c152c - pristine_git_object: b66de81d533aabb08ee0fc31ca2653fc59773bf2 + last_write_checksum: sha1:d76bcccc67a6e35b740ffa6be3d33c7de00c15b3 + pristine_git_object: 17c17357d85bff6a3cd783e66ef4d3f368b0eae2 src/openrouter/components/outputitemwebsearchcall.py: id: bac8732aecb9 last_write_checksum: sha1:00d5b67226d6ff2c6a5497e6e01c764aeede496e @@ -12412,8 +12412,8 @@ trackedFiles: pristine_git_object: 46e8472bd73ac53a7362d86f8c7ec2ad0414e7c7 src/openrouter/components/outputsearchmodelsservertoolitem.py: id: ba87dc220c62 - last_write_checksum: sha1:ab0ce5d348f099e4ff76f6b49f5007bd480eff3c - pristine_git_object: b9f5ac2a2c060ebf5f4e348a8ad7523757f37b2d + last_write_checksum: sha1:dc9f802d1fd6fa9482bcaaeb5bb07832bb6bd2e9 + pristine_git_object: d35cb6ed18ae5373eed79eab4aef02bdea684b50 src/openrouter/components/outputshellcallitem.py: id: 9c6a586d3cac last_write_checksum: sha1:eee70e899ef087183c4124266941fe2b4894cc9d @@ -12436,8 +12436,8 @@ trackedFiles: pristine_git_object: bec8c97af1334b3cfe4631b5bf725e801720bcb1 src/openrouter/components/outputtoolsearchservertoolitem.py: id: fb4ec737039d - last_write_checksum: sha1:63915305498f6bc6e2617ac0a0d42dc30a1b7470 - pristine_git_object: e9d0b14d646329a6d366939dd8c628245c8b3a0b + last_write_checksum: sha1:2c5103df28975ab65e9d3fca97bee7039cf85c90 + pristine_git_object: 98c3a6b5b0f886e7500259b56c7786c983a66b66 src/openrouter/components/outputwebfetchservertoolitem.py: id: 2b12eb287cdf last_write_checksum: sha1:60ec6ef59d691699c092120ea7dffed824197872 @@ -12448,8 +12448,8 @@ trackedFiles: pristine_git_object: 9c5918a4282d33f435f263e0308570ac5b436777 src/openrouter/components/outputwebsearchservertoolitem.py: id: b1fcca0b3fd3 - last_write_checksum: sha1:fe18ea4e95294b30c6c22efd3941cd0cf660b94b - pristine_git_object: 15fb96b79c77ff9798139470e3d26df0b119a89f + last_write_checksum: sha1:6161004d31122e0b15933c8b1b758649ab2cc1e3 + pristine_git_object: c685e720f8dc63be4660d3e6ba3699a4c4bd0411 src/openrouter/components/parameter.py: id: d76aede00388 last_write_checksum: sha1:8b9c7afc4794748a8fc89fe5bba65bb8cdf5c62a @@ -18280,6 +18280,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.tts.create_speech()`: `request` **Changed** (Breaking ⚠️) +releaseNotes: "## Python SDK Changes:\n* `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[]` **Changed**\n* `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[]` **Changed**\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed**\n* `open_router.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f7b70146..44fea072 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.27 + version: 1.3.28 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c819c46f..b7021131 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -22871,12 +22871,16 @@ components: properties: call_id: type: 'string' + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' operation: $ref: '#/components/schemas/ApplyPatchCallOperation' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' type: enum: - 'openrouter:apply_patch' @@ -23131,10 +23135,14 @@ components: datetime: description: 'ISO 8601 datetime string' type: 'string' + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' timezone: description: 'IANA timezone name' type: 'string' @@ -23342,6 +23350,10 @@ components: status: 'completed' type: 'openrouter:image_generation' properties: + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' imageB64: @@ -23359,7 +23371,7 @@ components: revisedPrompt: type: 'string' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' type: enum: - 'openrouter:image_generation' @@ -24082,12 +24094,16 @@ components: arguments: description: 'The JSON arguments submitted to the search tool (e.g. {"query":"Claude"})' type: 'string' + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' query: type: 'string' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' type: enum: - 'openrouter:experimental__search_models' @@ -24400,12 +24416,16 @@ components: status: 'completed' type: 'openrouter:tool_search' properties: + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' query: type: 'string' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' type: enum: - 'openrouter:tool_search' @@ -24495,10 +24515,14 @@ components: - 'type' - 'query' type: 'object' + error: + description: 'The error message when the tool call failed before producing a result. Set together with `status: ''failed''`; absent on a successful call.' + example: 'Tool execution failed' + type: 'string' id: type: 'string' status: - $ref: '#/components/schemas/ToolCallStatus' + $ref: '#/components/schemas/FailableToolCallStatus' type: enum: - 'openrouter:web_search' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ee10e56d..ee79d00b 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:aa4988cf1340b9b4c45d0f7d34c1d80884016b955e99381c9aea52f38e355aa8 - sourceBlobDigest: sha256:4828d7d1d7a9927d3268b7bede7018480aa9c23f2a8231ae6bac8eb6dc9bc811 + sourceRevisionDigest: sha256:aa391b8c4aad11822ac1ddc5404f21a901db665e30e4786cb92b3245658f6139 + sourceBlobDigest: sha256:fc70bf188a3a66c3b30d82f14c9cf9ab6b8db52c6a136a0626ac8a393fd32e3c tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:aa4988cf1340b9b4c45d0f7d34c1d80884016b955e99381c9aea52f38e355aa8 - sourceBlobDigest: sha256:4828d7d1d7a9927d3268b7bede7018480aa9c23f2a8231ae6bac8eb6dc9bc811 + sourceRevisionDigest: sha256:aa391b8c4aad11822ac1ddc5404f21a901db665e30e4786cb92b3245658f6139 + sourceBlobDigest: sha256:fc70bf188a3a66c3b30d82f14c9cf9ab6b8db52c6a136a0626ac8a393fd32e3c codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:0aafecfc542610744e021605d5923576663463046651088762e8cf5b1ab55d95 + codeSamplesRevisionDigest: sha256:ecc5d3ff536b62133fa6836014d93d36446d75603e10bb91c8181f9dbd030532 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index 2bab81e4..39db1be9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3039,4 +3039,14 @@ Based on: ### Generated - [python v1.3.27] . ### Releases -- [PyPI v1.3.27] https://pypi.org/project/openrouter/1.3.27 - . \ No newline at end of file +- [PyPI v1.3.27] https://pypi.org/project/openrouter/1.3.27 - . + +## 2026-10-07 04:18:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.28] . +### Releases +- [PyPI v1.3.28] https://pypi.org/project/openrouter/1.3.28 - . \ No newline at end of file diff --git a/docs/components/outputapplypatchservertoolitem.mdx b/docs/components/outputapplypatchservertoolitem.mdx index 8dba5025..2a6f0995 100644 --- a/docs/components/outputapplypatchservertoolitem.mdx +++ b/docs/components/outputapplypatchservertoolitem.mdx @@ -7,10 +7,11 @@ An openrouter:apply_patch server tool output item. The turn halts when validatio ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `call_id` | *Optional[str]* | ➖ | N/A | | -| `id` | *Optional[str]* | ➖ | N/A | | -| `operation` | [Optional[components.ApplyPatchCallOperation]](../components/applypatchcalloperation.mdx) | ➖ | The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. | \{
"diff": "@@ function main() \{\n+ console.log(\"hi\");\n }",
"path": "/src/main.ts",
"type": "update_file"
} | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | -| `type` | [components.OutputApplyPatchServerToolItemType](../components/outputapplypatchservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `call_id` | *Optional[str]* | ➖ | N/A | | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `id` | *Optional[str]* | ➖ | N/A | | +| `operation` | [Optional[components.ApplyPatchCallOperation]](../components/applypatchcalloperation.mdx) | ➖ | The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it. | \{
"diff": "@@ function main() \{\n+ console.log(\"hi\");\n }",
"path": "/src/main.ts",
"type": "update_file"
} | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | +| `type` | [components.OutputApplyPatchServerToolItemType](../components/outputapplypatchservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputdatetimeitem.mdx b/docs/components/outputdatetimeitem.mdx index 1d824daa..eb8558d4 100644 --- a/docs/components/outputdatetimeitem.mdx +++ b/docs/components/outputdatetimeitem.mdx @@ -7,10 +7,11 @@ An openrouter:datetime server tool output item ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `datetime_` | *str* | ✅ | ISO 8601 datetime string | | -| `id` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | -| `timezone` | *str* | ✅ | IANA timezone name | | -| `type` | [components.OutputDatetimeItemType](../components/outputdatetimeitemtype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `datetime_` | *str* | ✅ | ISO 8601 datetime string | | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `id` | *Optional[str]* | ➖ | N/A | | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | +| `timezone` | *str* | ✅ | IANA timezone name | | +| `type` | [components.OutputDatetimeItemType](../components/outputdatetimeitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputimagegenerationservertoolitem.mdx b/docs/components/outputimagegenerationservertoolitem.mdx index 3c697d6e..a3dd0aec 100644 --- a/docs/components/outputimagegenerationservertoolitem.mdx +++ b/docs/components/outputimagegenerationservertoolitem.mdx @@ -7,13 +7,14 @@ An openrouter:image_generation server tool output item ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `id` | *Optional[str]* | ➖ | N/A | | -| `image_b64` | *Optional[str]* | ➖ | N/A | | -| `image_url` | *Optional[str]* | ➖ | N/A | | -| `prompt` | *Optional[str]* | ➖ | The prompt (possibly rewritten) that the image was generated from. | | -| `result` | *OptionalNullable[str]* | ➖ | The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format | | -| `revised_prompt` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | -| `type` | [components.OutputImageGenerationServerToolItemType](../components/outputimagegenerationservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `id` | *Optional[str]* | ➖ | N/A | | +| `image_b64` | *Optional[str]* | ➖ | N/A | | +| `image_url` | *Optional[str]* | ➖ | N/A | | +| `prompt` | *Optional[str]* | ➖ | The prompt (possibly rewritten) that the image was generated from. | | +| `result` | *OptionalNullable[str]* | ➖ | The generated image as a base64-encoded string or URL, matching OpenAI image_generation_call format | | +| `revised_prompt` | *Optional[str]* | ➖ | N/A | | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | +| `type` | [components.OutputImageGenerationServerToolItemType](../components/outputimagegenerationservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputsearchmodelsservertoolitem.mdx b/docs/components/outputsearchmodelsservertoolitem.mdx index 8fa77521..07583af4 100644 --- a/docs/components/outputsearchmodelsservertoolitem.mdx +++ b/docs/components/outputsearchmodelsservertoolitem.mdx @@ -7,10 +7,11 @@ An openrouter:experimental__search_models server tool output item ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `arguments` | *Optional[str]* | ➖ | The JSON arguments submitted to the search tool (e.g. \{"query":"Claude"}) | | -| `id` | *Optional[str]* | ➖ | N/A | | -| `query` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | -| `type` | [components.OutputSearchModelsServerToolItemType](../components/outputsearchmodelsservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `arguments` | *Optional[str]* | ➖ | The JSON arguments submitted to the search tool (e.g. \{"query":"Claude"}) | | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `id` | *Optional[str]* | ➖ | N/A | | +| `query` | *Optional[str]* | ➖ | N/A | | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | +| `type` | [components.OutputSearchModelsServerToolItemType](../components/outputsearchmodelsservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputtoolsearchservertoolitem.mdx b/docs/components/outputtoolsearchservertoolitem.mdx index c8b2c90f..aa7bf887 100644 --- a/docs/components/outputtoolsearchservertoolitem.mdx +++ b/docs/components/outputtoolsearchservertoolitem.mdx @@ -7,9 +7,10 @@ An openrouter:tool_search server tool output item ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `id` | *Optional[str]* | ➖ | N/A | | -| `query` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | -| `type` | [components.OutputToolSearchServerToolItemType](../components/outputtoolsearchservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | +| `id` | *Optional[str]* | ➖ | N/A | | +| `query` | *Optional[str]* | ➖ | N/A | | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | +| `type` | [components.OutputToolSearchServerToolItemType](../components/outputtoolsearchservertoolitemtype.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/docs/components/outputwebsearchservertoolitem.mdx b/docs/components/outputwebsearchservertoolitem.mdx index 51bcef86..2e1dc4a0 100644 --- a/docs/components/outputwebsearchservertoolitem.mdx +++ b/docs/components/outputwebsearchservertoolitem.mdx @@ -10,6 +10,7 @@ An openrouter:web_search server tool output item | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `action` | [Optional[components.OutputWebSearchServerToolItemAction]](../components/outputwebsearchservertoolitemaction.mdx) | ➖ | The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider. | | +| `error` | *Optional[str]* | ➖ | The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call. | Tool execution failed | | `id` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✅ | N/A | completed | +| `status` | [components.FailableToolCallStatus](../components/failabletoolcallstatus.mdx) | ✅ | N/A | completed | | `type` | [components.OutputWebSearchServerToolItemTypeOpenrouterWebSearch](../components/outputwebsearchservertoolitemtypeopenrouterwebsearch.mdx) | ✅ | N/A | | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 87f61eab..b93d38f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.27" +version = "1.3.28" 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 550534f0..f8805030 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.27" +__version__: str = "1.3.28" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.3.27 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.28 2.914.0 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py index 8d4f5d6a..fb8db7b1 100644 --- a/src/openrouter/components/inputs_union.py +++ b/src/openrouter/components/inputs_union.py @@ -377,34 +377,34 @@ def serialize_model(self, handler): Union[ ItemReferenceItemTypedDict, ConfigurationUpdateItemTypedDict, - CustomToolCallOutputItemTypedDict, - InputMessageItemTypedDict, - LocalShellCallOutputItemTypedDict, - OutputToolSearchServerToolItemTypedDict, - OutputWebSearchServerToolItemTypedDict, CompactionItemTypedDict, - AdditionalToolsItemTypedDict, - OutputFileSearchServerToolItemTypedDict, OutputFileSearchCallItemTypedDict, + CustomToolCallOutputItemTypedDict, + OutputFileSearchServerToolItemTypedDict, ContextCompactionItemTypedDict, EasyInputMessageTypedDict, - OutputTextEditorServerToolItemTypedDict, - OutputMcpServerToolItemTypedDict, + AdditionalToolsItemTypedDict, + InputMessageItemTypedDict, + LocalShellCallOutputItemTypedDict, FunctionCallOutputItemTypedDict, - OutputImageGenerationCallItemTypedDict, + McpApprovalResponseItemTypedDict, + LocalShellCallItemTypedDict, OutputWebSearchCallItemTypedDict, - McpListToolsItemTypedDict, + OutputWebSearchServerToolItemTypedDict, + OutputImageGenerationCallItemTypedDict, OutputBrowserUseServerToolItemTypedDict, - ApplyPatchCallOutputItemTypedDict, - LocalShellCallItemTypedDict, - OutputApplyPatchServerToolItemTypedDict, - McpApprovalResponseItemTypedDict, + OutputMcpServerToolItemTypedDict, + McpListToolsItemTypedDict, ApplyPatchCallItemTypedDict, + OutputTextEditorServerToolItemTypedDict, McpApprovalRequestItemTypedDict, - OutputDatetimeItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, - OutputMemoryServerToolItemTypedDict, + ApplyPatchCallOutputItemTypedDict, + OutputToolSearchServerToolItemTypedDict, InputsMessageTypedDict, + OutputMemoryServerToolItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, + OutputApplyPatchServerToolItemTypedDict, + OutputDatetimeItemTypedDict, OutputComputerCallItemTypedDict, OutputCodeInterpreterCallItemTypedDict, ShellCallItemTypedDict, @@ -415,8 +415,8 @@ def serialize_model(self, handler): OutputAdvisorServerToolItemTypedDict, InputsReasoningTypedDict, OutputWebFetchServerToolItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, CustomToolCallItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, ShellCallOutputItemTypedDict, OutputFusionServerToolItemTypedDict, OutputShellServerToolItemTypedDict, @@ -433,34 +433,34 @@ def serialize_model(self, handler): Union[ ItemReferenceItem, ConfigurationUpdateItem, - CustomToolCallOutputItem, - InputMessageItem, - LocalShellCallOutputItem, - OutputToolSearchServerToolItem, - OutputWebSearchServerToolItem, CompactionItem, - AdditionalToolsItem, - OutputFileSearchServerToolItem, OutputFileSearchCallItem, + CustomToolCallOutputItem, + OutputFileSearchServerToolItem, ContextCompactionItem, EasyInputMessage, - OutputTextEditorServerToolItem, - OutputMcpServerToolItem, + AdditionalToolsItem, + InputMessageItem, + LocalShellCallOutputItem, FunctionCallOutputItem, - OutputImageGenerationCallItem, + McpApprovalResponseItem, + LocalShellCallItem, OutputWebSearchCallItem, - McpListToolsItem, + OutputWebSearchServerToolItem, + OutputImageGenerationCallItem, OutputBrowserUseServerToolItem, - ApplyPatchCallOutputItem, - LocalShellCallItem, - OutputApplyPatchServerToolItem, - McpApprovalResponseItem, + OutputMcpServerToolItem, + McpListToolsItem, ApplyPatchCallItem, + OutputTextEditorServerToolItem, McpApprovalRequestItem, - OutputDatetimeItem, - OutputSearchModelsServerToolItem, - OutputMemoryServerToolItem, + ApplyPatchCallOutputItem, + OutputToolSearchServerToolItem, InputsMessage, + OutputMemoryServerToolItem, + OutputSearchModelsServerToolItem, + OutputApplyPatchServerToolItem, + OutputDatetimeItem, OutputComputerCallItem, OutputCodeInterpreterCallItem, ShellCallItem, @@ -471,8 +471,8 @@ def serialize_model(self, handler): OutputAdvisorServerToolItem, InputsReasoning, OutputWebFetchServerToolItem, - OutputImageGenerationServerToolItem, CustomToolCallItem, + OutputImageGenerationServerToolItem, ShellCallOutputItem, OutputFusionServerToolItem, OutputShellServerToolItem, diff --git a/src/openrouter/components/outputapplypatchservertoolitem.py b/src/openrouter/components/outputapplypatchservertoolitem.py index 919f2bb6..3d84fad1 100644 --- a/src/openrouter/components/outputapplypatchservertoolitem.py +++ b/src/openrouter/components/outputapplypatchservertoolitem.py @@ -5,7 +5,7 @@ ApplyPatchCallOperation, ApplyPatchCallOperationTypedDict, ) -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import Literal, Optional @@ -18,9 +18,11 @@ class OutputApplyPatchServerToolItemTypedDict(TypedDict): r"""An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn.""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputApplyPatchServerToolItemType call_id: NotRequired[str] + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] operation: NotRequired[ApplyPatchCallOperationTypedDict] r"""The patch operation requested by an `apply_patch_call`. `create_file` and `update_file` carry a V4A diff; `delete_file` omits it.""" @@ -29,12 +31,15 @@ class OutputApplyPatchServerToolItemTypedDict(TypedDict): class OutputApplyPatchServerToolItem(BaseModel): r"""An openrouter:apply_patch server tool output item. The turn halts when validation succeeds so the client can apply the patch and echo an `apply_patch_call_output` on the next turn.""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputApplyPatchServerToolItemType call_id: Optional[str] = None + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None operation: Optional[ApplyPatchCallOperation] = None @@ -42,7 +47,7 @@ class OutputApplyPatchServerToolItem(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["call_id", "id", "operation"]) + optional_fields = set(["call_id", "error", "id", "operation"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/outputdatetimeitem.py b/src/openrouter/components/outputdatetimeitem.py index 379dd07b..905cec9b 100644 --- a/src/openrouter/components/outputdatetimeitem.py +++ b/src/openrouter/components/outputdatetimeitem.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import BaseModel, UNSET_SENTINEL import pydantic from pydantic import model_serializer @@ -17,10 +17,12 @@ class OutputDatetimeItemTypedDict(TypedDict): datetime_: str r"""ISO 8601 datetime string""" - status: ToolCallStatus + status: FailableToolCallStatus timezone: str r"""IANA timezone name""" type: OutputDatetimeItemType + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] @@ -30,18 +32,21 @@ class OutputDatetimeItem(BaseModel): datetime_: Annotated[str, pydantic.Field(alias="datetime")] r"""ISO 8601 datetime string""" - status: ToolCallStatus + status: FailableToolCallStatus timezone: str r"""IANA timezone name""" type: OutputDatetimeItemType + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["id"]) + optional_fields = set(["error", "id"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/outputimagegenerationservertoolitem.py b/src/openrouter/components/outputimagegenerationservertoolitem.py index 7ff53e38..701ad3ba 100644 --- a/src/openrouter/components/outputimagegenerationservertoolitem.py +++ b/src/openrouter/components/outputimagegenerationservertoolitem.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import ( BaseModel, Nullable, @@ -21,8 +21,10 @@ class OutputImageGenerationServerToolItemTypedDict(TypedDict): r"""An openrouter:image_generation server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputImageGenerationServerToolItemType + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] image_b64: NotRequired[str] image_url: NotRequired[str] @@ -36,10 +38,13 @@ class OutputImageGenerationServerToolItemTypedDict(TypedDict): class OutputImageGenerationServerToolItem(BaseModel): r"""An openrouter:image_generation server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputImageGenerationServerToolItemType + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None image_b64: Annotated[Optional[str], pydantic.Field(alias="imageB64")] = None @@ -59,7 +64,7 @@ class OutputImageGenerationServerToolItem(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["id", "imageB64", "imageUrl", "prompt", "result", "revisedPrompt"] + ["error", "id", "imageB64", "imageUrl", "prompt", "result", "revisedPrompt"] ) nullable_fields = set(["result"]) serialized = handler(self) diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py index b66de81d..17c17357 100644 --- a/src/openrouter/components/outputitems.py +++ b/src/openrouter/components/outputitems.py @@ -125,31 +125,31 @@ OutputItemsTypedDict = TypeAliasType( "OutputItemsTypedDict", Union[ - OutputToolSearchServerToolItemTypedDict, OutputFileSearchCallItemTypedDict, OutputFileSearchServerToolItemTypedDict, - OutputWebSearchServerToolItemTypedDict, - OutputBrowserUseServerToolItemTypedDict, + OutputToolSearchServerToolItemTypedDict, + OutputWebSearchCallItemTypedDict, OutputMcpServerToolItemTypedDict, + OutputImageGenerationCallItemTypedDict, OutputApplyPatchCallItemTypedDict, - OutputApplyPatchServerToolItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, OutputTextEditorServerToolItemTypedDict, - OutputWebSearchCallItemTypedDict, - OutputImageGenerationCallItemTypedDict, - OutputDatetimeItemTypedDict, + OutputBrowserUseServerToolItemTypedDict, + OutputWebSearchServerToolItemTypedDict, OutputShellCallItemTypedDict, - OutputMessageItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, OutputMemoryServerToolItemTypedDict, + OutputDatetimeItemTypedDict, + OutputMessageItemTypedDict, OutputComputerCallItemTypedDict, + OutputApplyPatchServerToolItemTypedDict, OutputCodeInterpreterCallItemTypedDict, OutputWebFetchServerToolItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, OutputCodeInterpreterServerToolItemTypedDict, OutputReasoningItemTypedDict, OutputAdvisorServerToolItemTypedDict, OutputCustomToolCallItemTypedDict, OutputShellCallOutputItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, OutputFusionServerToolItemTypedDict, OutputShellServerToolItemTypedDict, OutputFunctionCallItemTypedDict, diff --git a/src/openrouter/components/outputsearchmodelsservertoolitem.py b/src/openrouter/components/outputsearchmodelsservertoolitem.py index b9f5ac2a..d35cb6ed 100644 --- a/src/openrouter/components/outputsearchmodelsservertoolitem.py +++ b/src/openrouter/components/outputsearchmodelsservertoolitem.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import Literal, Optional @@ -16,10 +16,12 @@ class OutputSearchModelsServerToolItemTypedDict(TypedDict): r"""An openrouter:experimental__search_models server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputSearchModelsServerToolItemType arguments: NotRequired[str] r"""The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})""" + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] query: NotRequired[str] @@ -27,20 +29,23 @@ class OutputSearchModelsServerToolItemTypedDict(TypedDict): class OutputSearchModelsServerToolItem(BaseModel): r"""An openrouter:experimental__search_models server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputSearchModelsServerToolItemType arguments: Optional[str] = None r"""The JSON arguments submitted to the search tool (e.g. {\"query\":\"Claude\"})""" + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None query: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["arguments", "id", "query"]) + optional_fields = set(["arguments", "error", "id", "query"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/outputtoolsearchservertoolitem.py b/src/openrouter/components/outputtoolsearchservertoolitem.py index e9d0b14d..98c3a6b5 100644 --- a/src/openrouter/components/outputtoolsearchservertoolitem.py +++ b/src/openrouter/components/outputtoolsearchservertoolitem.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import Literal, Optional @@ -14,8 +14,10 @@ class OutputToolSearchServerToolItemTypedDict(TypedDict): r"""An openrouter:tool_search server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputToolSearchServerToolItemType + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] query: NotRequired[str] @@ -23,17 +25,20 @@ class OutputToolSearchServerToolItemTypedDict(TypedDict): class OutputToolSearchServerToolItem(BaseModel): r"""An openrouter:tool_search server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputToolSearchServerToolItemType + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None query: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["id", "query"]) + optional_fields = set(["error", "id", "query"]) serialized = handler(self) m = {} diff --git a/src/openrouter/components/outputwebsearchservertoolitem.py b/src/openrouter/components/outputwebsearchservertoolitem.py index 15fb96b7..c685e720 100644 --- a/src/openrouter/components/outputwebsearchservertoolitem.py +++ b/src/openrouter/components/outputwebsearchservertoolitem.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .failabletoolcallstatus import FailableToolCallStatus from openrouter.types import BaseModel, UNSET_SENTINEL from pydantic import model_serializer from typing import List, Literal, Optional @@ -65,28 +65,33 @@ def serialize_model(self, handler): class OutputWebSearchServerToolItemTypedDict(TypedDict): r"""An openrouter:web_search server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputWebSearchServerToolItemTypeOpenrouterWebSearch action: NotRequired[OutputWebSearchServerToolItemActionTypedDict] r"""The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider.""" + error: NotRequired[str] + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" id: NotRequired[str] class OutputWebSearchServerToolItem(BaseModel): r"""An openrouter:web_search server tool output item""" - status: ToolCallStatus + status: FailableToolCallStatus type: OutputWebSearchServerToolItemTypeOpenrouterWebSearch action: Optional[OutputWebSearchServerToolItemAction] = None r"""The search action performed, matching OpenAI web_search_call.action shape. Includes the query the model issued and optional source URLs returned by the search provider.""" + error: Optional[str] = None + r"""The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.""" + id: Optional[str] = None @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["action", "id"]) + optional_fields = set(["action", "error", "id"]) serialized = handler(self) m = {} diff --git a/uv.lock b/uv.lock index 2f4e8623..bf005517 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.27" +version = "1.3.28" source = { editable = "." } dependencies = [ { name = "httpcore" },