diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 07a7122c..b41b0c77 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: f25038f43a2bb37a03dea228084d93b0 + docChecksum: 694dd5d1dd96513bd5eaf38e8a40e6f3 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.235 - configChecksum: 08a36653100ebbea06c0befe1dd4f33f + releaseVersion: 1.3.236 + configChecksum: 7371050a0159a49ea601da86ca7eeabd repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 728b59d5-72fe-48eb-99bc-f216625a6c99 - pristine_commit_hash: b9e112d64eade464794b205a6a85ccb67fdf7132 - pristine_tree_hash: 6980e382eb7d3761c703eb87affde9e639b55ea1 + generation_id: 2a52e8ee-16d9-4dbf-84c4-21f3a27af910 + pristine_commit_hash: 2f387cb98ce76931e9d91b5a86feb83f915b5532 + pristine_tree_hash: b0df64bc131794207ec32fe0d3edb24b59e73926 features: python: acceptHeaders: 3.0.0 @@ -4284,8 +4284,8 @@ trackedFiles: pristine_git_object: 8ffc4761a733f96d93202839aca18a612d2398e8 docs/components/generationresponsedata.mdx: id: 5c92bc415596 - last_write_checksum: sha1:8248b01b87403fa3206486adc12917cc45647fc7 - pristine_git_object: 6584134c7a2c2fda1faf02dc9ae9295bd01089bc + last_write_checksum: sha1:8f1f45d0ac2c3c39f1ee7c62682cfa81128efca9 + pristine_git_object: c4249118fb4d5d2317a09b0a83aedbd3dba971ba docs/components/generationresponsedataregion.mdx: id: 7c78bc2a4522 last_write_checksum: sha1:743f7db7a6249896ec86d3bae131e7dc34a1e13b @@ -4836,8 +4836,8 @@ trackedFiles: pristine_git_object: ed5a1eb606cff079f176ee4d94ca1d600e4ca184 docs/components/inputsreasoning.mdx: id: 4d87fe5d05cd - last_write_checksum: sha1:892a019c5aafa5f65beb00526a2cc9ba8a8d3a49 - pristine_git_object: 9cee27be06d1df9271989dd9b87d78f75b6014c2 + last_write_checksum: sha1:4f6ccaee59cf5b0572a3e9c3f31f0aec0ce816e7 + pristine_git_object: ebda5ac275c600dac7fb551828cc7b02ebd17bc4 docs/components/inputsrole.mdx: id: 0ab483c40a1b last_write_checksum: sha1:6466387fa9658cc53b278d915be3cef012597acb @@ -7352,8 +7352,8 @@ trackedFiles: pristine_git_object: 4f1252fbfa58befd6d5c6f79c8e5419ad9f85f9e docs/components/outputreasoningitem.mdx: id: 820bd777266f - last_write_checksum: sha1:7d28a9a9c8eb48cfb2d914dd579393df6dcbde09 - pristine_git_object: 7e14dd4efcc7414e4192179f09e962f2fedd0073 + last_write_checksum: sha1:1322fa06f41a4888a63c52f660449d595e6e477d + pristine_git_object: 35f15bf7e03d5dc20ff74ed05bc4ff4b5e1a55da docs/components/outputreasoningitemstatuscompleted.mdx: id: 4211cb7f6844 last_write_checksum: sha1:ce479409162a27538c9ebd0af573b6550d3d47a7 @@ -8008,32 +8008,32 @@ trackedFiles: pristine_git_object: 476708cc18a819c093e18a87bf3da5cb44ec9705 docs/components/reasoningdetailencrypted.mdx: id: 7bf862724f88 - last_write_checksum: sha1:04db811026d57adcecbc29ea3d20f2e0f03f6d3e - pristine_git_object: 9732f4198a64af1ca046dae1fa523caef662ddf8 + last_write_checksum: sha1:93a082c16776167b88b644c4709348c2bd513f47 + pristine_git_object: d1c07a648e29d31ae9a44ce83d952126194bd3b4 docs/components/reasoningdetailencryptedtype.mdx: id: 7dea8887a486 last_write_checksum: sha1:92808e57ae938c7cfaf7d5ab1dcc2e411d887108 pristine_git_object: 3779ebb04af32b9188d75c4c910752f6ef31ccc6 docs/components/reasoningdetailservertoolcall.mdx: id: 095a5cb44df4 - last_write_checksum: sha1:51675e9bca6e07e386205502bb20b0e7dd1268f7 - pristine_git_object: cd27b1334dd09dd16fc3fb2b47bd78db0e8a46dc + last_write_checksum: sha1:1dc4672f257fdd80b25c0041a9ba10e8aa3e5eb8 + pristine_git_object: 393613b2b46c244c74919019e22495e387e5fad7 docs/components/reasoningdetailservertoolcalltype.mdx: id: 703597bf09db last_write_checksum: sha1:a4415cefe09b6e1944d239999be6622a057ef865 pristine_git_object: cb6b4d6476d46b8715441055056e000b56448b3d docs/components/reasoningdetailsummary.mdx: id: 264cd49526bd - last_write_checksum: sha1:dd987e44568a87e453ac6d92e2c26828ca67d15f - pristine_git_object: 7e04e6bf083640c23ce2489245e52679a45605f7 + last_write_checksum: sha1:46f46fc0e83344413dc3edfda73d483f14456da5 + pristine_git_object: f17009d5b8277b2f2dd10d44a8dea10c7091a7f1 docs/components/reasoningdetailsummarytype.mdx: id: 7a022f3244e9 last_write_checksum: sha1:4f4225c81b7d7a0bbd1542f158c87a9fc4967ba2 pristine_git_object: 7061072353ebec80f873d6a6e1fff9e4cab7273d docs/components/reasoningdetailtext.mdx: id: ab46bdf1fecc - last_write_checksum: sha1:788dff3c52a316e8049537270a747b0511562522 - pristine_git_object: d153176489284f8f96cd18b1f6243d13a1b60f30 + last_write_checksum: sha1:e603cc44192f30ff8a566e8e6d0c45dc48c19c18 + pristine_git_object: 7ec3b3119cf9fb8b168b35c4a26ab245dff47d2e docs/components/reasoningdetailtexttype.mdx: id: 06604321ed1a last_write_checksum: sha1:93b10c0a74c1ca105c9d06c31a30a1a5547ba998 @@ -8054,14 +8054,10 @@ trackedFiles: id: b2f39931f1a8 last_write_checksum: sha1:f4d71419143fde97e5a1cca31603b030f49b008e pristine_git_object: 2cfb4301a444ee320895855dd98311aaca93363b - docs/components/reasoningformat.mdx: - id: ad8b386fc1e9 - last_write_checksum: sha1:f12bf23d16203924d2c9fdb135f740193abd66ba - pristine_git_object: 66ac435e558c169dd472f018e05a03fe870261ec docs/components/reasoningitem.mdx: id: b878124ede47 - last_write_checksum: sha1:5a88204a7e17fb83a74d12b935d3becceb75cd87 - pristine_git_object: e92c559a2a67deba2800a9a427cafe2d6000c429 + last_write_checksum: sha1:f37ab42401463e8318d53da9c3fed2324d33df36 + pristine_git_object: c283bf96ecffafd8149847ac8bb7a7dfab0db7c9 docs/components/reasoningitemstatuscompleted.mdx: id: 691c02c0f311 last_write_checksum: sha1:ecb1dbba577ea1e3ae7d8df659e51e0226795e09 @@ -12592,8 +12588,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:f6ec1eaf4638a648868304be75b4084c20e91da9 - pristine_git_object: 72dd1aad7bb8e082a43a6846269869092214e028 + last_write_checksum: sha1:3ef94b85a80fb786985cbb49a6a93408091e3546 + pristine_git_object: 26b718adeee0686b249044b0092c090d8c6a1cd0 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -12620,8 +12616,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:6a722ecd4772c61f047b2dc43755a0c16c6c873c - pristine_git_object: 252f8c76491b13ab0bdb26d88bf29425cb7a7371 + last_write_checksum: sha1:4876334cdd17a1f9dbcda93d04af7d57e1d12f52 + pristine_git_object: 626f088e968584f5beb77a935f38b2988d62e3fa src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -12668,8 +12664,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:82687a37fc3736db9ee6282abb24c0142f656c7f - pristine_git_object: 401fa9aba9cc9a5efaa7f5bb915ff9b103d65532 + last_write_checksum: sha1:8313207d019fd05d24d8790f1e4c02e8f1d586b6 + pristine_git_object: aeaac2e6c721f888bef2c44ae2b986519ed82b3a src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:08125e1d60df82793e11e8aed6e3c9fdb7512ebb @@ -14456,8 +14452,8 @@ trackedFiles: pristine_git_object: 5caeacf169f3edff5b6e9823264aeeff8be1e8ff src/openrouter/components/generationresponse.py: id: 84d4e3e7da8b - last_write_checksum: sha1:64a10488e46e2ff5f2cc2eb4a1a2a7e03ad9191d - pristine_git_object: a30c32c086c84d02d5f84b1c92b484d7f38bd0a3 + last_write_checksum: sha1:a81b7501325b4ad007a1ccd89bd8a1f7bb4192a3 + pristine_git_object: aafc0a99c7e97c41624c9a1c59b7c9917c01e57c src/openrouter/components/getbyokkeyresponse.py: id: ca3a8db80018 last_write_checksum: sha1:9b428028a01ffb73915a278096ca51bd1c660326 @@ -14708,8 +14704,8 @@ trackedFiles: pristine_git_object: 0347fb279f757b084116e5edc50b2f441c69e4a0 src/openrouter/components/inputs_union.py: id: 17d6239cb6a7 - last_write_checksum: sha1:3c2703629e16d3d83d6bfe0102e427c1c5e7f76f - pristine_git_object: 0e6d8b25caede2dd86be8d7bb427878eace14443 + last_write_checksum: sha1:3cc7c236633e75c2e2c56172a3f080594a5e7466 + pristine_git_object: 21426aeeede5670ea4a3d4efe6c3a3a1d50ec96b src/openrouter/components/inputtext.py: id: a995ae96be99 last_write_checksum: sha1:94c720a449e0d5a3f23ee7195f648422f61ac114 @@ -15496,8 +15492,8 @@ trackedFiles: pristine_git_object: 616b0f5112e106777b4c096aeea6fef58ff32020 src/openrouter/components/outputitems.py: id: 90f107de3116 - last_write_checksum: sha1:d7dafe97dc6bf6a0de62084afa54ff14d74b5b94 - pristine_git_object: 909f7601f58c6d208b37e7a5e7665eedbbda4b5c + last_write_checksum: sha1:67213253c5f68778b3ae9f09b97b37845d6f1887 + pristine_git_object: 07be3d7f3dd2962a3de8a31a0ab9ef91293aac97 src/openrouter/components/outputitemtoolsearchcall.py: id: 745440da2bc3 last_write_checksum: sha1:30856f53e47f0384072bc1459b82ed0bf6f57b3f @@ -15528,8 +15524,8 @@ trackedFiles: pristine_git_object: ccd5283d0d31048059abf6ff85677b5d1f9f4b7b src/openrouter/components/outputreasoningitem.py: id: 0bc0568f44f9 - last_write_checksum: sha1:f9d305a4f98f5e52124410b587ee9fc8541f9497 - pristine_git_object: 46e8472bd73ac53a7362d86f8c7ec2ad0414e7c7 + last_write_checksum: sha1:98b24fe34e94e7cf27042cbc13894f98cf951215 + pristine_git_object: 00aa1a6bdff95743f96df9b80da5151235a4da6c src/openrouter/components/outputsearchmodelsservertoolitem.py: id: ba87dc220c62 last_write_checksum: sha1:dc9f802d1fd6fa9482bcaaeb5bb07832bb6bd2e9 @@ -15844,20 +15840,20 @@ trackedFiles: pristine_git_object: fce551fac40c914beb4d8db48ad8f0acde7c2212 src/openrouter/components/reasoningdetailencrypted.py: id: ae7d7526c9b5 - last_write_checksum: sha1:df579e34f32d49b348ae1fc8e74904ac4edb03a3 - pristine_git_object: 0ba2daa8d62116e1122638e2c703e89428cd742d + last_write_checksum: sha1:8b85eaca5073ae62d529f711d03d676d411c562f + pristine_git_object: a654edf4ba0ec494f5158a647866eefd381b8ece src/openrouter/components/reasoningdetailservertoolcall.py: id: f95da47c231d - last_write_checksum: sha1:5196ad2ea5f8b463bb8e9e98adc54f8faa63a07e - pristine_git_object: 4487eb0e24600c0affed1a29ea5380328c56fd0f + last_write_checksum: sha1:d2ac11f900e61d009cd01af873213967b209d74c + pristine_git_object: 04794310f31e56ee13476870a6da6e5d13d33180 src/openrouter/components/reasoningdetailsummary.py: id: 53bda5c72dc5 - last_write_checksum: sha1:db665a5b9c7ca3be181719df3c81f07ce3c127ea - pristine_git_object: 21c892cca33d183be9be5609f29c363a1377662a + last_write_checksum: sha1:2caf69ce797542edc76bbfb4e09c2ac094470a47 + pristine_git_object: 92bc0d91b3bb9db25004469972968d861ae23ee5 src/openrouter/components/reasoningdetailtext.py: id: 62f254529b87 - last_write_checksum: sha1:11f1a343ff00bc19ac05702a810b3f4c9aca5c7e - pristine_git_object: 49b08a205274f8aad7af7c5c910a7dbc73c12588 + last_write_checksum: sha1:b1dc9549349eef1c5fa4ea92ad854148c9ba38f6 + pristine_git_object: 5cc77bce74bb00f0de002fc55d4b101f09f239a7 src/openrouter/components/reasoningdetailunion.py: id: 3326e0b80cdb last_write_checksum: sha1:0a582331054241874c2bb83991b6596c84358e43 @@ -15870,14 +15866,10 @@ trackedFiles: id: cadb8da93572 last_write_checksum: sha1:f0cac6530b869890e30631e9d42eedae0f2a5be8 pristine_git_object: fe3562c76fc28d2f8cacd49a12c0a0500b069147 - src/openrouter/components/reasoningformat.py: - id: 99d79e5500b6 - last_write_checksum: sha1:e78b2016e9485c7b904a7631780c9a3a4adfa1aa - pristine_git_object: 694e960a6bdfb0c92c36139ebe7a2a765f03b238 src/openrouter/components/reasoningitem.py: id: 4345f446ad97 - last_write_checksum: sha1:609a0510506f8dc70ca9cba07040b82ebdc9ec9f - pristine_git_object: 40ee3f6c1a1e249d988950ebe49d1ad6f8c05dc1 + last_write_checksum: sha1:529c11d97ee6efffbc6345c954796c76615a0117 + pristine_git_object: c3b0f2a4f4c1edffef84e23045d71f4e14385745 src/openrouter/components/reasoningmode.py: id: 874f05fcf99c last_write_checksum: sha1:0613ad16798a2678bb9fe0c55a20a13bf51373b1 @@ -23313,13 +23305,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 -releaseNotes: | - ## Python SDK Changes: - * `open_router.guardrail_policies.list_capacity_policies()`: **Added** - * `open_router.guardrail_policies.create_capacity_policy()`: **Added** - * `open_router.guardrail_policies.delete_capacity_policy()`: **Added** - * `open_router.guardrail_policies.get_capacity_policy()`: **Added** - * `open_router.guardrail_policies.update_capacity_policy()`: **Added** - * `open_router.guardrail_policies.create_budget_policy()`: `request.move_existing_assignments` **Added** - * `open_router.guardrail_policies.create_model_availability_policy()`: `request.move_existing_assignments` **Added** - * `open_router.guardrail_policies.create_moderation_policy()`: `request.move_existing_assignments` **Added** +releaseNotes: "## Python SDK Changes:\n* `open_router.batch.create_batches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `open_router.batch.get_batches()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `open_router.batch.cancel()`: `response.results[].response.body` **Changed** (Breaking ⚠️)\n* `open_router.batch.get_results()`: `response.data[].response.body` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_chat_completions()`: \n * `request.messages[].union(assistant).reasoning_details[]` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[]` **Changed** (Breaking ⚠️)\n* `open_router.generations.get_generation()`: `response.data.billed_duration_ms` **Added**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 788c8f3b..8b068974 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.235 + version: 1.3.236 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 15e6dc5b..a508ed5d 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -16025,6 +16025,12 @@ components: type: - 'integer' - 'null' + billed_duration_ms: + description: 'Billed duration in milliseconds for duration-metered generations, or null if not applicable' + example: 60000 + type: + - 'integer' + - 'null' cache_discount: description: 'Discount applied due to caching' example: 0.0002 @@ -19001,6 +19007,11 @@ components: - allOf: - $ref: '#/components/schemas/OutputReasoningItem' - properties: + format: + deprecated: true + type: + - 'string' + - 'null' summary: items: $ref: '#/components/schemas/ReasoningSummaryText' @@ -19013,7 +19024,6 @@ components: content: - text: 'First, we analyze the problem...' type: 'reasoning_text' - format: 'anthropic-claude-v1' id: 'reasoning-123' signature: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' status: 'completed' @@ -30509,8 +30519,6 @@ components: type: - 'array' - 'null' - format: - $ref: '#/components/schemas/ReasoningFormat' signature: description: 'A signature for the reasoning content, used for verification' example: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' @@ -30523,7 +30531,6 @@ components: content: - text: 'First, we analyze the problem...' type: 'reasoning_text' - format: 'anthropic-claude-v1' id: 'reasoning-123' signature: 'EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj...' status: 'completed' @@ -34137,7 +34144,10 @@ components: data: type: 'string' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34164,7 +34174,10 @@ components: arguments: type: 'string' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34196,7 +34209,10 @@ components: type: 'reasoning.summary' properties: format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34221,7 +34237,10 @@ components: type: 'reasoning.text' properties: format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' id: type: - 'string' @@ -34288,27 +34307,6 @@ components: - 'string' - 'null' x-speakeasy-unknown-values: allow - ReasoningFormat: - enum: - - 'unknown' - - 'openai-responses-v1' - - 'azure-openai-responses-v1' - - 'bedrock-amazon-responses-v1' - - 'bedrock-openai-responses-v1' - - 'bedrock-xai-responses-v1' - - 'xai-responses-v1' - - 'meta-responses-v1' - - 'google-vertex-meta-responses-v1' - - 'google-vertex-xai-responses-v1' - - 'openrouter-stealth-v1' - - 'anthropic-claude-v1' - - 'google-gemini-v1' - - null - example: 'unknown' - type: - - 'string' - - 'null' - x-speakeasy-unknown-values: allow ReasoningItem: allOf: - $ref: '#/components/schemas/OutputItemReasoning' @@ -34320,13 +34318,16 @@ components: - 'array' - 'null' format: - $ref: '#/components/schemas/ReasoningFormat' + deprecated: true + type: + - 'string' + - 'null' signature: type: - 'string' - 'null' type: 'object' - description: 'Reasoning output item with signature and format extensions' + description: 'Reasoning output item with signature extension' example: id: 'reasoning-abc123' summary: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a80331c3..6816b563 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:27980a2a560cd7d7ff31ac770e0896a5e2199558f5595e90f749e172ca2a7f24 - sourceBlobDigest: sha256:59a70cb8e30bc137782ec2896df25d087380763dce232be639bb0b8355670b62 + sourceRevisionDigest: sha256:f565a541a5a0f05304d0c7c5864de3decd25ee91d8aac02235f3473d693cfd79 + sourceBlobDigest: sha256:99bd1774dce7656a73809ab2ec02a20256d6d7dd694fa124ce08472d41265fdd tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:27980a2a560cd7d7ff31ac770e0896a5e2199558f5595e90f749e172ca2a7f24 - sourceBlobDigest: sha256:59a70cb8e30bc137782ec2896df25d087380763dce232be639bb0b8355670b62 + sourceRevisionDigest: sha256:f565a541a5a0f05304d0c7c5864de3decd25ee91d8aac02235f3473d693cfd79 + sourceBlobDigest: sha256:99bd1774dce7656a73809ab2ec02a20256d6d7dd694fa124ce08472d41265fdd codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:7a7fa831b9ebc6f5036fe681a5a842f506d8da85f64ee9bd0bbe956a4823c634 + codeSamplesRevisionDigest: sha256:b50547ead201470b52082050ce30ab10953a34e22989d947582f03818ee3e9c1 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 4e5d7bb5..27edd45e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5119,4 +5119,14 @@ Based on: ### Generated - [python v1.3.235] . ### Releases -- [PyPI v1.3.235] https://pypi.org/project/openrouter/1.3.235 - . \ No newline at end of file +- [PyPI v1.3.235] https://pypi.org/project/openrouter/1.3.235 - . + +## 2026-12-03 17:05:29 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.236] . +### Releases +- [PyPI v1.3.236] https://pypi.org/project/openrouter/1.3.236 - . \ No newline at end of file diff --git a/docs/components/generationresponsedata.mdx b/docs/components/generationresponsedata.mdx index 6584134c..c4249118 100644 --- a/docs/components/generationresponsedata.mdx +++ b/docs/components/generationresponsedata.mdx @@ -11,6 +11,7 @@ Generation data | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `api_type` | [Nullable[components.APIType]](../components/apitype.mdx) | ✔️ | Type of API used for the generation | | | `app_id` | *Nullable[int]* | ✔️ | ID of the app that made the request | 12345 | +| `billed_duration_ms` | *OptionalNullable[int]* | ➖ | Billed duration in milliseconds for duration-metered generations, or null if not applicable | 60000 | | `cache_discount` | *Nullable[float]* | ✔️ | Discount applied due to caching | 0.0002 | | `cancelled` | *Nullable[bool]* | ✔️ | Whether the generation was cancelled | false | | `created_at` | *str* | ✔️ | ISO 8601 timestamp of when the generation was created | 2024-07-15T23:33:19.433273+00:00 | diff --git a/docs/components/inputsreasoning.mdx b/docs/components/inputsreasoning.mdx index 9cee27be..ebda5ac2 100644 --- a/docs/components/inputsreasoning.mdx +++ b/docs/components/inputsreasoning.mdx @@ -7,13 +7,13 @@ An output item containing reasoning ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.mdx)] | ➖ | N/A | | -| `encrypted_content` | *OptionalNullable[str]* | ➖ | N/A | | -| `id` | *str* | ✔️ | N/A | | -| `status` | [Optional[components.InputsStatusUnion2]](../components/inputsstatusunion2.mdx) | ➖ | N/A | | -| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.mdx)] | ✔️ | N/A | | -| `type` | [components.InputsTypeReasoning](../components/inputstypereasoning.mdx) | ✔️ | N/A | | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `signature` | *OptionalNullable[str]* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.mdx)] | ➖ | N/A | | +| `encrypted_content` | *OptionalNullable[str]* | ➖ | N/A | | +| `id` | *str* | ✔️ | N/A | | +| `status` | [Optional[components.InputsStatusUnion2]](../components/inputsstatusunion2.mdx) | ➖ | N/A | | +| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.mdx)] | ✔️ | N/A | | +| `type` | [components.InputsTypeReasoning](../components/inputstypereasoning.mdx) | ✔️ | N/A | | +| `signature` | *OptionalNullable[str]* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | | \ No newline at end of file diff --git a/docs/components/outputreasoningitem.mdx b/docs/components/outputreasoningitem.mdx index 7e14dd4e..35f15bf7 100644 --- a/docs/components/outputreasoningitem.mdx +++ b/docs/components/outputreasoningitem.mdx @@ -15,5 +15,4 @@ An output item containing reasoning | `status` | [Optional[components.OutputReasoningItemStatusUnion]](../components/outputreasoningitemstatusunion.mdx) | ➖ | N/A | | | `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.mdx)] | ✔️ | N/A | | | `type` | [components.OutputReasoningItemType](../components/outputreasoningitemtype.mdx) | ✔️ | N/A | | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | | `signature` | *OptionalNullable[str]* | ➖ | A signature for the reasoning content, used for verification | EvcBCkgIChABGAIqQKkSDbRuVEQUk9qN1odC098l9SEj... | \ No newline at end of file diff --git a/docs/components/reasoningdetailencrypted.mdx b/docs/components/reasoningdetailencrypted.mdx index 9732f419..d1c07a64 100644 --- a/docs/components/reasoningdetailencrypted.mdx +++ b/docs/components/reasoningdetailencrypted.mdx @@ -7,10 +7,10 @@ Reasoning detail encrypted schema ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `data` | *str* | ✔️ | N/A | | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *OptionalNullable[str]* | ➖ | N/A | | -| `index` | *Optional[int]* | ➖ | N/A | | -| `type` | [components.ReasoningDetailEncryptedType](../components/reasoningdetailencryptedtype.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `data` | *str* | ✔️ | N/A | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *OptionalNullable[str]* | ➖ | N/A | +| `index` | *Optional[int]* | ➖ | N/A | +| `type` | [components.ReasoningDetailEncryptedType](../components/reasoningdetailencryptedtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/reasoningdetailservertoolcall.mdx b/docs/components/reasoningdetailservertoolcall.mdx index cd27b133..393613b2 100644 --- a/docs/components/reasoningdetailservertoolcall.mdx +++ b/docs/components/reasoningdetailservertoolcall.mdx @@ -7,13 +7,13 @@ Record of an OpenRouter server-tool invocation (e.g. openrouter:fusion), carried ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `arguments` | *str* | ✔️ | N/A | | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *OptionalNullable[str]* | ➖ | N/A | | -| `index` | *Optional[int]* | ➖ | N/A | | -| `result` | *str* | ✔️ | N/A | | -| `tool_call_id` | *OptionalNullable[str]* | ➖ | N/A | | -| `tool_name` | *str* | ✔️ | N/A | | -| `type` | [components.ReasoningDetailServerToolCallType](../components/reasoningdetailservertoolcalltype.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `arguments` | *str* | ✔️ | N/A | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *OptionalNullable[str]* | ➖ | N/A | +| `index` | *Optional[int]* | ➖ | N/A | +| `result` | *str* | ✔️ | N/A | +| `tool_call_id` | *OptionalNullable[str]* | ➖ | N/A | +| `tool_name` | *str* | ✔️ | N/A | +| `type` | [components.ReasoningDetailServerToolCallType](../components/reasoningdetailservertoolcalltype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/reasoningdetailsummary.mdx b/docs/components/reasoningdetailsummary.mdx index 7e04e6bf..f17009d5 100644 --- a/docs/components/reasoningdetailsummary.mdx +++ b/docs/components/reasoningdetailsummary.mdx @@ -7,10 +7,10 @@ Reasoning detail summary schema ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *OptionalNullable[str]* | ➖ | N/A | | -| `index` | *Optional[int]* | ➖ | N/A | | -| `summary` | *str* | ✔️ | N/A | | -| `type` | [components.ReasoningDetailSummaryType](../components/reasoningdetailsummarytype.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *OptionalNullable[str]* | ➖ | N/A | +| `index` | *Optional[int]* | ➖ | N/A | +| `summary` | *str* | ✔️ | N/A | +| `type` | [components.ReasoningDetailSummaryType](../components/reasoningdetailsummarytype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/reasoningdetailtext.mdx b/docs/components/reasoningdetailtext.mdx index d1531764..7ec3b311 100644 --- a/docs/components/reasoningdetailtext.mdx +++ b/docs/components/reasoningdetailtext.mdx @@ -7,11 +7,11 @@ Reasoning detail text schema ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `id` | *OptionalNullable[str]* | ➖ | N/A | | -| `index` | *Optional[int]* | ➖ | N/A | | -| `signature` | *OptionalNullable[str]* | ➖ | N/A | | -| `text` | *OptionalNullable[str]* | ➖ | N/A | | -| `type` | [components.ReasoningDetailTextType](../components/reasoningdetailtexttype.mdx) | ✔️ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `id` | *OptionalNullable[str]* | ➖ | N/A | +| `index` | *Optional[int]* | ➖ | N/A | +| `signature` | *OptionalNullable[str]* | ➖ | N/A | +| `text` | *OptionalNullable[str]* | ➖ | N/A | +| `type` | [components.ReasoningDetailTextType](../components/reasoningdetailtexttype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/reasoningformat.mdx b/docs/components/reasoningformat.mdx deleted file mode 100644 index 66ac435e..00000000 --- a/docs/components/reasoningformat.mdx +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "ReasoningFormat" ---- - -## Example Usage - -```python -from openrouter.components import ReasoningFormat - -# Open enum: unrecognized values are captured as UnrecognizedStr -value: ReasoningFormat = "unknown" -``` - - -## Values - -This is an open enum. Unrecognized values will not fail type checks. - -- `"unknown"` -- `"openai-responses-v1"` -- `"azure-openai-responses-v1"` -- `"bedrock-amazon-responses-v1"` -- `"bedrock-openai-responses-v1"` -- `"bedrock-xai-responses-v1"` -- `"xai-responses-v1"` -- `"meta-responses-v1"` -- `"google-vertex-meta-responses-v1"` -- `"google-vertex-xai-responses-v1"` -- `"openrouter-stealth-v1"` -- `"anthropic-claude-v1"` -- `"google-gemini-v1"` diff --git a/docs/components/reasoningitem.mdx b/docs/components/reasoningitem.mdx index e92c559a..c283bf96 100644 --- a/docs/components/reasoningitem.mdx +++ b/docs/components/reasoningitem.mdx @@ -2,18 +2,18 @@ title: "ReasoningItem" --- -Reasoning output item with signature and format extensions +Reasoning output item with signature extension ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.mdx)] | ➖ | N/A | | -| `encrypted_content` | *OptionalNullable[str]* | ➖ | N/A | | -| `id` | *str* | ✔️ | N/A | | -| `status` | [Optional[components.ReasoningItemStatusUnion]](../components/reasoningitemstatusunion.mdx) | ➖ | N/A | | -| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.mdx)] | ✔️ | N/A | | -| `type` | [components.ReasoningItemType](../components/reasoningitemtype.mdx) | ✔️ | N/A | | -| `format_` | [OptionalNullable[components.ReasoningFormat]](../components/reasoningformat.mdx) | ➖ | N/A | unknown | -| `signature` | *OptionalNullable[str]* | ➖ | N/A | | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `content` | List[[components.ReasoningTextContent](../components/reasoningtextcontent.mdx)] | ➖ | N/A | +| `encrypted_content` | *OptionalNullable[str]* | ➖ | N/A | +| `id` | *str* | ✔️ | N/A | +| `status` | [Optional[components.ReasoningItemStatusUnion]](../components/reasoningitemstatusunion.mdx) | ➖ | N/A | +| `summary` | List[[components.ReasoningSummaryText](../components/reasoningsummarytext.mdx)] | ✔️ | N/A | +| `type` | [components.ReasoningItemType](../components/reasoningitemtype.mdx) | ✔️ | N/A | +| ~~`format_`~~ | *OptionalNullable[str]* | ➖ | ⚠️ **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. | +| `signature` | *OptionalNullable[str]* | ➖ | N/A | \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 72dd1aad..26b718ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.235" +version = "1.3.236" 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 252f8c76..626f088e 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.235" +__version__: str = "1.3.236" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.235 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.236 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 401fa9ab..aeaac2e6 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -4537,7 +4537,6 @@ ReasoningDoneEventTypedDict, ) from .reasoningeffort import ReasoningEffort - from .reasoningformat import ReasoningFormat from .reasoningitem import ( ReasoningItem, ReasoningItemStatusCompleted, @@ -8689,7 +8688,6 @@ "ReasoningDoneEventType", "ReasoningDoneEventTypedDict", "ReasoningEffort", - "ReasoningFormat", "ReasoningItem", "ReasoningItemStatusCompleted", "ReasoningItemStatusInProgress", @@ -12895,7 +12893,6 @@ "ReasoningDoneEventType": ".reasoningdoneevent", "ReasoningDoneEventTypedDict": ".reasoningdoneevent", "ReasoningEffort": ".reasoningeffort", - "ReasoningFormat": ".reasoningformat", "ReasoningItem": ".reasoningitem", "ReasoningItemStatusCompleted": ".reasoningitem", "ReasoningItemStatusInProgress": ".reasoningitem", diff --git a/src/openrouter/components/generationresponse.py b/src/openrouter/components/generationresponse.py index a30c32c0..aafc0a99 100644 --- a/src/openrouter/components/generationresponse.py +++ b/src/openrouter/components/generationresponse.py @@ -132,6 +132,8 @@ class GenerationResponseDataTypedDict(TypedDict): r"""The resolved web search engine used for this generation (e.g. exa, firecrawl, parallel)""" workspace_id: Nullable[str] r"""ID of the workspace this generation is attributed to. Null for accounts without workspaces. Generations created before workspace resolution existed are attributed to the account default workspace.""" + billed_duration_ms: NotRequired[Nullable[int]] + r"""Billed duration in milliseconds for duration-metered generations, or null if not applicable""" request_id: NotRequired[Nullable[str]] r"""Unique identifier grouping all generations from a single API request""" response_cache_source_id: NotRequired[Nullable[str]] @@ -269,6 +271,9 @@ class GenerationResponseData(BaseModel): workspace_id: Nullable[str] r"""ID of the workspace this generation is attributed to. Null for accounts without workspaces. Generations created before workspace resolution existed are attributed to the account default workspace.""" + billed_duration_ms: OptionalNullable[int] = UNSET + r"""Billed duration in milliseconds for duration-metered generations, or null if not applicable""" + request_id: OptionalNullable[str] = UNSET r"""Unique identifier grouping all generations from a single API request""" @@ -280,11 +285,19 @@ class GenerationResponseData(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set(["request_id", "response_cache_source_id", "session_id"]) + optional_fields = set( + [ + "billed_duration_ms", + "request_id", + "response_cache_source_id", + "session_id", + ] + ) nullable_fields = set( [ "api_type", "app_id", + "billed_duration_ms", "cache_discount", "cancelled", "external_user", diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py index 0e6d8b25..21426aee 100644 --- a/src/openrouter/components/inputs_union.py +++ b/src/openrouter/components/inputs_union.py @@ -140,7 +140,6 @@ OutputWebSearchServerToolItem, OutputWebSearchServerToolItemTypedDict, ) -from .reasoningformat import ReasoningFormat from .reasoningitem import ReasoningItem, ReasoningItemTypedDict from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict @@ -196,9 +195,9 @@ class InputsReasoningTypedDict(TypedDict): content: NotRequired[Nullable[List[ReasoningTextContentTypedDict]]] encrypted_content: NotRequired[Nullable[str]] status: NotRequired[InputsStatusUnion2TypedDict] - format_: NotRequired[Nullable[ReasoningFormat]] signature: NotRequired[Nullable[str]] r"""A signature for the reasoning content, used for verification""" + format_: NotRequired[Nullable[str]] class InputsReasoning(BaseModel): @@ -216,20 +215,24 @@ class InputsReasoning(BaseModel): status: Optional[InputsStatusUnion2] = None - format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") - ] = UNSET - signature: OptionalNullable[str] = UNSET r"""A signature for the reasoning content, used for verification""" + format_: Annotated[ + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), + ] = UNSET + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set( - ["content", "encrypted_content", "status", "format", "signature"] + ["content", "encrypted_content", "status", "signature", "format"] ) nullable_fields = set( - ["content", "encrypted_content", "summary", "format", "signature"] + ["content", "encrypted_content", "summary", "signature", "format"] ) serialized = handler(self) m = {} diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py index 909f7601..07be3d7f 100644 --- a/src/openrouter/components/outputitems.py +++ b/src/openrouter/components/outputitems.py @@ -155,11 +155,11 @@ OutputSearchModelsServerToolItemTypedDict, OutputShellCallItemTypedDict, OutputComputerCallItemTypedDict, + OutputReasoningItemTypedDict, OutputCodeInterpreterCallItemTypedDict, OutputCustomToolCallItemTypedDict, OutputAdvisorServerToolItemTypedDict, OutputCodeInterpreterServerToolItemTypedDict, - OutputReasoningItemTypedDict, OutputImageGenerationServerToolItemTypedDict, McpCallItemTypedDict, OutputWebFetchServerToolItemTypedDict, diff --git a/src/openrouter/components/outputreasoningitem.py b/src/openrouter/components/outputreasoningitem.py index 46e8472b..00aa1a6b 100644 --- a/src/openrouter/components/outputreasoningitem.py +++ b/src/openrouter/components/outputreasoningitem.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict from openrouter.types import ( @@ -11,10 +10,9 @@ UNSET, UNSET_SENTINEL, ) -import pydantic from pydantic import model_serializer from typing import List, Literal, Optional, Union -from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict +from typing_extensions import NotRequired, TypeAliasType, TypedDict OutputReasoningItemStatusInProgress = Literal["in_progress",] @@ -58,7 +56,6 @@ class OutputReasoningItemTypedDict(TypedDict): content: NotRequired[Nullable[List[ReasoningTextContentTypedDict]]] encrypted_content: NotRequired[Nullable[str]] status: NotRequired[OutputReasoningItemStatusUnionTypedDict] - format_: NotRequired[Nullable[ReasoningFormat]] signature: NotRequired[Nullable[str]] r"""A signature for the reasoning content, used for verification""" @@ -78,19 +75,13 @@ class OutputReasoningItem(BaseModel): status: Optional[OutputReasoningItemStatusUnion] = None - format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") - ] = UNSET - signature: OptionalNullable[str] = UNSET r"""A signature for the reasoning content, used for verification""" @model_serializer(mode="wrap") def serialize_model(self, handler): - optional_fields = set( - ["content", "encrypted_content", "status", "format", "signature"] - ) - nullable_fields = set(["content", "encrypted_content", "format", "signature"]) + optional_fields = set(["content", "encrypted_content", "status", "signature"]) + nullable_fields = set(["content", "encrypted_content", "signature"]) serialized = handler(self) m = {} @@ -111,9 +102,3 @@ def serialize_model(self, handler): m[k] = val return m - - -try: - OutputReasoningItem.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/reasoningdetailencrypted.py b/src/openrouter/components/reasoningdetailencrypted.py index 0ba2daa8..a654edf4 100644 --- a/src/openrouter/components/reasoningdetailencrypted.py +++ b/src/openrouter/components/reasoningdetailencrypted.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from openrouter.types import ( BaseModel, Nullable, @@ -23,7 +22,7 @@ class ReasoningDetailEncryptedTypedDict(TypedDict): data: str type: ReasoningDetailEncryptedType - format_: NotRequired[Nullable[ReasoningFormat]] + format_: NotRequired[Nullable[str]] id: NotRequired[Nullable[str]] index: NotRequired[int] @@ -36,7 +35,11 @@ class ReasoningDetailEncrypted(BaseModel): type: ReasoningDetailEncryptedType format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), ] = UNSET id: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/reasoningdetailservertoolcall.py b/src/openrouter/components/reasoningdetailservertoolcall.py index 4487eb0e..04794310 100644 --- a/src/openrouter/components/reasoningdetailservertoolcall.py +++ b/src/openrouter/components/reasoningdetailservertoolcall.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from openrouter.types import ( BaseModel, Nullable, @@ -25,7 +24,7 @@ class ReasoningDetailServerToolCallTypedDict(TypedDict): result: str tool_name: str type: ReasoningDetailServerToolCallType - format_: NotRequired[Nullable[ReasoningFormat]] + format_: NotRequired[Nullable[str]] id: NotRequired[Nullable[str]] index: NotRequired[int] tool_call_id: NotRequired[Nullable[str]] @@ -43,7 +42,11 @@ class ReasoningDetailServerToolCall(BaseModel): type: ReasoningDetailServerToolCallType format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), ] = UNSET id: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/reasoningdetailsummary.py b/src/openrouter/components/reasoningdetailsummary.py index 21c892cc..92bc0d91 100644 --- a/src/openrouter/components/reasoningdetailsummary.py +++ b/src/openrouter/components/reasoningdetailsummary.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from openrouter.types import ( BaseModel, Nullable, @@ -23,7 +22,7 @@ class ReasoningDetailSummaryTypedDict(TypedDict): summary: str type: ReasoningDetailSummaryType - format_: NotRequired[Nullable[ReasoningFormat]] + format_: NotRequired[Nullable[str]] id: NotRequired[Nullable[str]] index: NotRequired[int] @@ -36,7 +35,11 @@ class ReasoningDetailSummary(BaseModel): type: ReasoningDetailSummaryType format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), ] = UNSET id: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/reasoningdetailtext.py b/src/openrouter/components/reasoningdetailtext.py index 49b08a20..5cc77bce 100644 --- a/src/openrouter/components/reasoningdetailtext.py +++ b/src/openrouter/components/reasoningdetailtext.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from openrouter.types import ( BaseModel, Nullable, @@ -22,7 +21,7 @@ class ReasoningDetailTextTypedDict(TypedDict): r"""Reasoning detail text schema""" type: ReasoningDetailTextType - format_: NotRequired[Nullable[ReasoningFormat]] + format_: NotRequired[Nullable[str]] id: NotRequired[Nullable[str]] index: NotRequired[int] signature: NotRequired[Nullable[str]] @@ -35,7 +34,11 @@ class ReasoningDetailText(BaseModel): type: ReasoningDetailTextType format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), ] = UNSET id: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/reasoningformat.py b/src/openrouter/components/reasoningformat.py deleted file mode 100644 index 694e960a..00000000 --- a/src/openrouter/components/reasoningformat.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from openrouter.types import UnrecognizedStr -from typing import Literal, Union - - -ReasoningFormat = Union[ - Literal[ - "unknown", - "openai-responses-v1", - "azure-openai-responses-v1", - "bedrock-amazon-responses-v1", - "bedrock-openai-responses-v1", - "bedrock-xai-responses-v1", - "xai-responses-v1", - "meta-responses-v1", - "google-vertex-meta-responses-v1", - "google-vertex-xai-responses-v1", - "openrouter-stealth-v1", - "anthropic-claude-v1", - "google-gemini-v1", - ], - UnrecognizedStr, -] diff --git a/src/openrouter/components/reasoningitem.py b/src/openrouter/components/reasoningitem.py index 40ee3f6c..c3b0f2a4 100644 --- a/src/openrouter/components/reasoningitem.py +++ b/src/openrouter/components/reasoningitem.py @@ -1,7 +1,6 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .reasoningformat import ReasoningFormat from .reasoningsummarytext import ReasoningSummaryText, ReasoningSummaryTextTypedDict from .reasoningtextcontent import ReasoningTextContent, ReasoningTextContentTypedDict from openrouter.types import ( @@ -50,7 +49,7 @@ class ReasoningItemTypedDict(TypedDict): - r"""Reasoning output item with signature and format extensions""" + r"""Reasoning output item with signature extension""" id: str summary: List[ReasoningSummaryTextTypedDict] @@ -58,12 +57,12 @@ class ReasoningItemTypedDict(TypedDict): content: NotRequired[Nullable[List[ReasoningTextContentTypedDict]]] encrypted_content: NotRequired[Nullable[str]] status: NotRequired[ReasoningItemStatusUnionTypedDict] - format_: NotRequired[Nullable[ReasoningFormat]] + format_: NotRequired[Nullable[str]] signature: NotRequired[Nullable[str]] class ReasoningItem(BaseModel): - r"""Reasoning output item with signature and format extensions""" + r"""Reasoning output item with signature extension""" id: str @@ -78,7 +77,11 @@ class ReasoningItem(BaseModel): status: Optional[ReasoningItemStatusUnion] = None format_: Annotated[ - OptionalNullable[ReasoningFormat], pydantic.Field(alias="format") + OptionalNullable[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="format", + ), ] = UNSET signature: OptionalNullable[str] = UNSET diff --git a/uv.lock b/uv.lock index f2f3e684..990c2f4a 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.235" +version = "1.3.236" source = { editable = "." } dependencies = [ { name = "httpcore" },