From a03e229ebe87a109dbf5b20563f84858cd46767f Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 10 Aug 2026 19:27:06 +0000 Subject: [PATCH 1/2] ## Python SDK Changes: * `open_router.beta.responses.send()`: * `request.input.union(Array<>)[]` **Changed** * `response` **Changed** * `open_router.presets.create_presets_responses()`: * `request.input.union(Array<>)[]` **Changed** * `open_router.responses.send()`: * `request.input.union(Array<>)[]` **Changed** * `response` **Changed** --- .speakeasy/gen.lock | 221 +++++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 351 ++++++++++++++++-- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- .../codeinterpretercallcodedeltaevent.mdx | 16 + .../codeinterpretercallcodedeltaeventtype.mdx | 15 + .../codeinterpretercallcodedoneevent.mdx | 16 + .../codeinterpretercallcodedoneeventtype.mdx | 15 + .../codeinterpretercallcompletedevent.mdx | 15 + .../codeinterpretercallcompletedeventtype.mdx | 15 + ...=> codeinterpretercallinprogressevent.mdx} | 11 +- ...codeinterpretercallinprogresseventtype.mdx | 15 + .../codeinterpretercallinterpretingevent.mdx | 15 + ...deinterpretercallinterpretingeventtype.mdx | 15 + docs/components/codeinterpreterfileoutput.mdx | 18 + .../codeinterpreterfileoutputtype.mdx | 15 + .../components/codeinterpreterimageoutput.mdx | 10 + .../codeinterpreterimageoutputtype.mdx | 15 + docs/components/codeinterpreterlogsoutput.mdx | 10 + .../codeinterpreterlogsoutputtype.mdx | 15 + ...stomtoolcalloutputitemoutputinputimage.mdx | 10 +- .../customtoolcalloutputitemoutputtype.mdx | 15 + ...customtoolcalloutputitemtypeinputimage.mdx | 15 - ...functioncalloutputitemoutputinputimage.mdx | 10 +- .../functioncalloutputitemoutputtype.mdx | 15 + .../functioncalloutputitemtypeinputimage.mdx | 15 - .../outputcodeinterpretercallitem.mdx | 17 +- .../outputcodeinterpretercallitemoutput.mdx | 24 ++ ...tputcodeinterpretercallitemoutputunion.mdx | 18 - .../outputcodeinterpretercallitemstatus.mdx | 23 ++ .../outputcodeinterpretercallitemtype.mdx | 15 + ...outputcodeinterpretercallitemtypeimage.mdx | 15 - docs/components/outputlogs.mdx | 10 - docs/components/outputwebsearchcallitem.mdx | 13 +- docs/components/streamevents.mdx | 30 ++ docs/components/typecodeinterpretercall.mdx | 15 - docs/components/typelogs.mdx | 15 - pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 145 ++++++-- .../codeinterpretercallcodedeltaevent.py | 35 ++ .../codeinterpretercallcodedoneevent.py | 35 ++ .../codeinterpretercallcompletedevent.py | 32 ++ .../codeinterpretercallinprogressevent.py | 32 ++ .../codeinterpretercallinterpretingevent.py | 32 ++ .../components/codeinterpreterfileoutput.py | 96 +++++ .../components/codeinterpreterimageoutput.py | 20 + .../components/codeinterpreterlogsoutput.py | 20 + .../components/customtoolcalloutputitem.py | 6 +- .../components/functioncalloutputitem.py | 6 +- src/openrouter/components/inputs_union.py | 92 ++--- .../outputcodeinterpretercallitem.py | 156 +++++--- src/openrouter/components/outputitems.py | 14 +- .../components/outputwebsearchcallitem.py | 19 +- src/openrouter/components/streamevents.py | 81 ++-- uv.lock | 2 +- 57 files changed, 1506 insertions(+), 425 deletions(-) create mode 100644 docs/components/codeinterpretercallcodedeltaevent.mdx create mode 100644 docs/components/codeinterpretercallcodedeltaeventtype.mdx create mode 100644 docs/components/codeinterpretercallcodedoneevent.mdx create mode 100644 docs/components/codeinterpretercallcodedoneeventtype.mdx create mode 100644 docs/components/codeinterpretercallcompletedevent.mdx create mode 100644 docs/components/codeinterpretercallcompletedeventtype.mdx rename docs/components/{outputimage.mdx => codeinterpretercallinprogressevent.mdx} (51%) create mode 100644 docs/components/codeinterpretercallinprogresseventtype.mdx create mode 100644 docs/components/codeinterpretercallinterpretingevent.mdx create mode 100644 docs/components/codeinterpretercallinterpretingeventtype.mdx create mode 100644 docs/components/codeinterpreterfileoutput.mdx create mode 100644 docs/components/codeinterpreterfileoutputtype.mdx create mode 100644 docs/components/codeinterpreterimageoutput.mdx create mode 100644 docs/components/codeinterpreterimageoutputtype.mdx create mode 100644 docs/components/codeinterpreterlogsoutput.mdx create mode 100644 docs/components/codeinterpreterlogsoutputtype.mdx create mode 100644 docs/components/customtoolcalloutputitemoutputtype.mdx delete mode 100644 docs/components/customtoolcalloutputitemtypeinputimage.mdx create mode 100644 docs/components/functioncalloutputitemoutputtype.mdx delete mode 100644 docs/components/functioncalloutputitemtypeinputimage.mdx create mode 100644 docs/components/outputcodeinterpretercallitemoutput.mdx delete mode 100644 docs/components/outputcodeinterpretercallitemoutputunion.mdx create mode 100644 docs/components/outputcodeinterpretercallitemstatus.mdx create mode 100644 docs/components/outputcodeinterpretercallitemtype.mdx delete mode 100644 docs/components/outputcodeinterpretercallitemtypeimage.mdx delete mode 100644 docs/components/outputlogs.mdx delete mode 100644 docs/components/typecodeinterpretercall.mdx delete mode 100644 docs/components/typelogs.mdx create mode 100644 src/openrouter/components/codeinterpretercallcodedeltaevent.py create mode 100644 src/openrouter/components/codeinterpretercallcodedoneevent.py create mode 100644 src/openrouter/components/codeinterpretercallcompletedevent.py create mode 100644 src/openrouter/components/codeinterpretercallinprogressevent.py create mode 100644 src/openrouter/components/codeinterpretercallinterpretingevent.py create mode 100644 src/openrouter/components/codeinterpreterfileoutput.py create mode 100644 src/openrouter/components/codeinterpreterimageoutput.py create mode 100644 src/openrouter/components/codeinterpreterlogsoutput.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index b2f33b20..e80bca0c 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: 8ede64aad6d17e4f87c4b39ce933ada2 + docChecksum: 6c564d6990f47adc4bd2002d1e7db979 docVersion: 1.0.0 speakeasyVersion: 1.787.0 generationVersion: 2.914.0 - releaseVersion: 1.1.39 - configChecksum: 7f9824cc3197d73cf65c172ce031d036 + releaseVersion: 1.1.40 + configChecksum: 66e76c65c8062a2c933f5f4166d428a5 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 48616d01-e54c-4095-8f95-f422376258d5 - pristine_commit_hash: 7ac7061ac11b14ce0a8b53e9cf88dbf29c3a4727 - pristine_tree_hash: e3f44e92e87d7b7bddc0a758a6e35aaedf9a2bfb + generation_id: da5a1f1f-f69b-4604-8c2c-3f544e78845b + pristine_commit_hash: 35e83150f02d24b7f7d60e0fb7d6de1bb6f7cde5 + pristine_tree_hash: 501f339c666803f05ffbcc391e5d29df0af7f75d features: python: acceptHeaders: 3.0.0 @@ -1240,6 +1240,70 @@ trackedFiles: id: 1cc125f1dfa9 last_write_checksum: sha1:eb910f807f9326f7d5028621831cc7a098364676 pristine_git_object: a3cd42720335c5efe1333e2efa007a799b9868b3 + docs/components/codeinterpretercallcodedeltaevent.mdx: + id: 49bd6f63fc7b + last_write_checksum: sha1:7680a9c4beaab8a216ba869a03777a6639fa1843 + pristine_git_object: 70e78af03e6629794375f3cad23564cf5845634b + docs/components/codeinterpretercallcodedeltaeventtype.mdx: + id: 8ef9c8131fa6 + last_write_checksum: sha1:1b6d507b0e1bc37556d1109aed636ce8a20071c8 + pristine_git_object: e1646fe12570b967eff54c35c92eeaa93eea8ff5 + docs/components/codeinterpretercallcodedoneevent.mdx: + id: ac268d9f3090 + last_write_checksum: sha1:32a7c4b99f1be55131e14fde3430fa1a26464979 + pristine_git_object: d7bc2ec6bcd3421c74fe38c22b7cd5fac228f755 + docs/components/codeinterpretercallcodedoneeventtype.mdx: + id: 61d2cbe9f1af + last_write_checksum: sha1:a696f02f06b15fef06709c5f2d394f190f9da7fd + pristine_git_object: 2f98b03b326d81f73b19ef59731577bc0e7a9aeb + docs/components/codeinterpretercallcompletedevent.mdx: + id: e1e8836c5ffc + last_write_checksum: sha1:1df680a0a8258050e9777941bca9b8a8193ee9d4 + pristine_git_object: 0589dc6b46f8d3a7cedf2ecf8910630a1d06dd9b + docs/components/codeinterpretercallcompletedeventtype.mdx: + id: 4ec99daeb0a4 + last_write_checksum: sha1:be26e1a1a3b4898efe066997789f58d43c63fb94 + pristine_git_object: eb4b77aea535203da8061ce55a5d6439dda7f3ed + docs/components/codeinterpretercallinprogressevent.mdx: + id: e61df0621201 + last_write_checksum: sha1:88610eafda8c3d5de90ea1381948f0c9bbefab5e + pristine_git_object: 0c1876df6c8561edb43b9153a4bb99c6a5eb123e + docs/components/codeinterpretercallinprogresseventtype.mdx: + id: 8e190579effa + last_write_checksum: sha1:5faae85e37e6881d73a3af295fa97386c3c37968 + pristine_git_object: 45e38c0b6fddd2bb331b60641d2074a24a71ad09 + docs/components/codeinterpretercallinterpretingevent.mdx: + id: 1f32d93b89ee + last_write_checksum: sha1:50fea08f970bd76fc6cd0eab5fd5d36d78841849 + pristine_git_object: 92fb7446f06a88ff973f04c9f2c4221bf8a8e970 + docs/components/codeinterpretercallinterpretingeventtype.mdx: + id: ea63e19fd229 + last_write_checksum: sha1:d94c8c4ecc3af444e66b1d297cb7b19d04cef93a + pristine_git_object: ba4d90b16690f187db5ed7e02cf42c86fc66fc7b + docs/components/codeinterpreterfileoutput.mdx: + id: 509ffc0161c8 + last_write_checksum: sha1:b7f4a0ad266ae7e978ff0e1076fa562f7dd1d1b8 + pristine_git_object: 623e61267c1526e1b1d52f1868edd2fc796f7106 + docs/components/codeinterpreterfileoutputtype.mdx: + id: 8a179388fbcd + last_write_checksum: sha1:130b0e08e8b1ee3da3b4f69b72b841a7c987e92e + pristine_git_object: 62f1f4af0a42782931cdfaaf60a032c41eb8f268 + docs/components/codeinterpreterimageoutput.mdx: + id: cb4e405bd13f + last_write_checksum: sha1:c6400fa34f819d8624a123d5653e7ec5521fb442 + pristine_git_object: e259d6ef54dcc7d1d003027f0dad13ac580e31d5 + docs/components/codeinterpreterimageoutputtype.mdx: + id: ca1b9e7977e7 + last_write_checksum: sha1:294995cf70b32f427b0611dec672262d04765b20 + pristine_git_object: 4fabf1c97ccccbf212420a8b7d312cf335d7021f + docs/components/codeinterpreterlogsoutput.mdx: + id: e3e644b99031 + last_write_checksum: sha1:9345faccaf6f989b55c6d8558f592eb8a5dffac9 + pristine_git_object: 9ac144a810b60523b2832fb90b1186e447b8963f + docs/components/codeinterpreterlogsoutputtype.mdx: + id: 9d66eb67a4f8 + last_write_checksum: sha1:9835eca752b6106df16911e038c3e263de55bb19 + pristine_git_object: c1a03f222a3ac17e934517767f099729e3ceec24 docs/components/codeinterpreterservertool.mdx: id: d828abe3a52a last_write_checksum: sha1:8eafcbabe4084b286d34a7b2e7db0f99ad547727 @@ -1578,8 +1642,12 @@ trackedFiles: pristine_git_object: ba63c6e461e3e083730d6a14666263355c7a9a24 docs/components/customtoolcalloutputitemoutputinputimage.mdx: id: 35c913e2c5ba - last_write_checksum: sha1:01ebc7a20d532e09e7660689bd7406567aaf3e04 - pristine_git_object: 830ac246df500f3e4376c3eeb08c8b856e4ec504 + last_write_checksum: sha1:f4de00869fabcff45e9899269e8e007f9fc2322c + pristine_git_object: ccd8f2028dad331c809210160396f6ce90c9bc66 + docs/components/customtoolcalloutputitemoutputtype.mdx: + id: 72fe576e0d6b + last_write_checksum: sha1:c97a4d1832ac6cd82b95f6b3392226550790db8c + pristine_git_object: bf573ae77b931742426c957e84a3ca248ebe37c1 docs/components/customtoolcalloutputitemoutputunion1.mdx: id: 083fd9d40955 last_write_checksum: sha1:a1e66b4441b36a0b0383da6eb2be1c6f97ef1066 @@ -1592,10 +1660,6 @@ trackedFiles: id: 9aeafc9c0118 last_write_checksum: sha1:5b1f4ee809d675b439fff5b77313d166b426c355 pristine_git_object: abfec635180255e23d4c5c0faf7662f90e2c92a0 - docs/components/customtoolcalloutputitemtypeinputimage.mdx: - id: e3c38138e53f - last_write_checksum: sha1:679e601744c73d99f5afd57c0de521914497aa82 - pristine_git_object: 821cf8bba27d169ca2a950faca297f432222192d docs/components/customtooltypecustom.mdx: id: bd47414fa7f5 last_write_checksum: sha1:308434644c3f96ca5e4084d22f5877b17c45a153 @@ -1986,8 +2050,12 @@ trackedFiles: pristine_git_object: 086e8a674c4fe4174eb1129b0aa33f785dfe6044 docs/components/functioncalloutputitemoutputinputimage.mdx: id: 0b40b0d89709 - last_write_checksum: sha1:5a890674261391c3100592a20cbcd175dc96060a - pristine_git_object: 55bb222509ed9d751a7675dde367f8a699a29760 + last_write_checksum: sha1:e865b62b96310c4f1555da723f3b68ed7b7c7215 + pristine_git_object: 61b3a7cb3fb593bc06e7a4434abfec53af1e78b0 + docs/components/functioncalloutputitemoutputtype.mdx: + id: db3d5a58af6b + last_write_checksum: sha1:72e52567b78ac19860ebd08ba39bda30649cd7ae + pristine_git_object: e1e11e985f0ee3d7f787d6ec366a13f8b5e68b32 docs/components/functioncalloutputitemoutputunion1.mdx: id: 69d70ecfbda9 last_write_checksum: sha1:4e8c3d4459c55ae088b9c6de3ac5f67cec1c42c3 @@ -2000,10 +2068,6 @@ trackedFiles: id: a1c1ac8a378a last_write_checksum: sha1:766416f347f68a55e2b4ef1c3861add60157c0ff pristine_git_object: 7085d8cd474a4fa2f41e915375479f2220c47853 - docs/components/functioncalloutputitemtypeinputimage.mdx: - id: 13902448e7ad - last_write_checksum: sha1:0b3d0f3e8cbe4f93445d07ba65cceebe365933da - pristine_git_object: eff3701c44c58f6c8a93badff21969b939089a4f docs/components/fusionanalysisresult.mdx: id: a3d19bd18149 last_write_checksum: sha1:3fc83d03ab1cfe864d1a8206f8beab5bfeb05d74 @@ -3658,16 +3722,20 @@ trackedFiles: pristine_git_object: 4e1ac848efae9e52849329f14d2b9ff2f14933bd docs/components/outputcodeinterpretercallitem.mdx: id: 167ec714574b - last_write_checksum: sha1:5e16eae1eac9685d1e71bf3802129068a4f92fae - pristine_git_object: 08f28041e498e979b7bd81d87644030a038b5e14 - docs/components/outputcodeinterpretercallitemoutputunion.mdx: - id: 8e4dfeaae6c9 - last_write_checksum: sha1:87d64144954ae95d6e5bfc5ce8746e49aabe1fc3 - pristine_git_object: 02e6c2ca8d7c3ae31c6489585f651b0029648bbe - docs/components/outputcodeinterpretercallitemtypeimage.mdx: - id: 03ff0b62333c - last_write_checksum: sha1:c23cbcaa9dcf7dc9c38819be58b9a117722e0821 - pristine_git_object: c901280c878c987f81b6f0ad29747baac0039e69 + last_write_checksum: sha1:a8b6ab633681cf91080dcb3d841f34f4fd8cb6d0 + pristine_git_object: bd9643534d23c3894917597de1717b9d01c7a34d + docs/components/outputcodeinterpretercallitemoutput.mdx: + id: 8df225976a5f + last_write_checksum: sha1:079c039cc1c074c7405776ac03022c6945c80627 + pristine_git_object: c153d53bf9c50042f8b1cc85407a01463a1f313b + docs/components/outputcodeinterpretercallitemstatus.mdx: + id: db9e860281f2 + last_write_checksum: sha1:393883117c79b69e6b371808c99392c37dea006c + pristine_git_object: 472a16ae0932c8e759a9f6c2f6b1ae588dac1641 + docs/components/outputcodeinterpretercallitemtype.mdx: + id: a20c297a80cf + last_write_checksum: sha1:455f8fbf33bd08bf197851bb8f499aa6dc91b817 + pristine_git_object: 20a4e3ea9314f5bca0be2c54aa02eb2694b421e3 docs/components/outputcodeinterpreterservertoolitem.mdx: id: 4d2814954b22 last_write_checksum: sha1:f2e2fb1a45947bf9456ec890932769bf954e1cc1 @@ -3760,10 +3828,6 @@ trackedFiles: id: d5337e29a21f last_write_checksum: sha1:133446222202e08ffceaa5944185842c21078830 pristine_git_object: 5b050d8db3ad7195c2c6bbc93638be95edbb1624 - docs/components/outputimage.mdx: - id: a358b7233cd2 - last_write_checksum: sha1:029463bda2ddf51bd399d5ca95c2747ac1140c14 - pristine_git_object: a7b8246372bebf6dac66833399060cd6566c109e docs/components/outputimagegenerationcallitem.mdx: id: bd80e7125993 last_write_checksum: sha1:581ca78bee7a7f88687d57fcdd9dfe5c909e2cac @@ -3792,10 +3856,6 @@ trackedFiles: id: 876e956be23e last_write_checksum: sha1:feaf29256eb4203388160c9f8c22292dde315bef pristine_git_object: f73cc6671c184f19ca530e8d0bda4e6cc247e30b - docs/components/outputlogs.mdx: - id: 89bf8506e4fe - last_write_checksum: sha1:8b2efe9f4117b7b3d44eb16813e8ed88fc6d1ebc - pristine_git_object: e6eb732cb2cf1a73385b3d6111a1e1b810eca30e docs/components/outputmcpservertoolitem.mdx: id: 78e33fe9943f last_write_checksum: sha1:b64c87e227cf51037bc59aca8fb82b2ed0dd2f4c @@ -4002,8 +4062,8 @@ trackedFiles: pristine_git_object: 909b5a9d76aa8d35d543c6d26b297a4fcf1b44e1 docs/components/outputwebsearchcallitem.mdx: id: c79fb1d179e3 - last_write_checksum: sha1:24d7061a66250fc3576a7c1c7f28b85f8e8c9d8d - pristine_git_object: 3a389a5fa8751c88ebd8727d612df156f9f5f8de + last_write_checksum: sha1:89bdc1fc7bae81cab11649a8b0333ee6ad4b4c7d + pristine_git_object: 746838c8ddcc727399d8274b7aaa6f1c5cbed366 docs/components/outputwebsearchcallitemactionsearch.mdx: id: 68b8fca747ab last_write_checksum: sha1:98a76009fb8bc87c3b2f20dcf56af177cdff2826 @@ -4806,8 +4866,8 @@ trackedFiles: pristine_git_object: a9461bc3e848e3554a6101ec4c43988cf1239576 docs/components/streamevents.mdx: id: e9baa20de483 - last_write_checksum: sha1:6f55c435eea76405b2fd0e826d1fae0b3e6a3680 - pristine_git_object: 149400c47139d6908783f1dd9cfd2700a211bfdf + last_write_checksum: sha1:81d4b89198b631b7514cbe3b29fbedbde654b57d + pristine_git_object: e4f5c12415b7515a10e399ab6b9dd3607048320c docs/components/streameventsresponsecompleted.mdx: id: f7c112325f05 last_write_checksum: sha1:289f19b6527fda93d1449df57ba6a525aee25bd6 @@ -5148,10 +5208,6 @@ trackedFiles: id: c93f61b0fed2 last_write_checksum: sha1:13f5740aad556c24c2e9484da8e67e15b0d4d085 pristine_git_object: 6af79caed7c31fa5750415ace82eafd7a2ad53c2 - docs/components/typecodeinterpretercall.mdx: - id: 9bad1b75289c - last_write_checksum: sha1:88de669f44eb1fb08ce07a972c635742fd80f384 - pristine_git_object: 374132b2a749b431e0860c9c0a7135ec61878ca6 docs/components/typecompact20260112.mdx: id: 6afc200110eb last_write_checksum: sha1:67b122fb7d678523303b419575d85075c6cf260a @@ -5192,10 +5248,6 @@ trackedFiles: id: 5bf492bd8ad4 last_write_checksum: sha1:a66abfbde09ed71dfa93add4862e64b3b844d31f pristine_git_object: 0af8acd63592cc7211fb13ed0ce921243b4f3c23 - docs/components/typelogs.mdx: - id: 9b6be157ecfe - last_write_checksum: sha1:da3b6998aa72148cfe7ff2bbef5ab6a438797784 - pristine_git_object: accf2ed99ce1962c6d1df51e0950841f3e41c16e docs/components/typenone.mdx: id: 1fbbd27c03b6 last_write_checksum: sha1:003d0b57065e35457a5f365aec76783fd735125c @@ -7106,8 +7158,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:d8d63f40b234f19da09326afcde5a467253c45d9 - pristine_git_object: ce5d9656dcb74b9b09f66619f39bd0cf58bff036 + last_write_checksum: sha1:03bacf2d58c452223beadec03cef73887230c1e5 + pristine_git_object: a1626c79c62b97ee6fb8ed23ebd406c41b2f5d88 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -7134,8 +7186,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:c4d146d77cb18189d6d83253caee92c73bad220b - pristine_git_object: 682398c0d1af843933d8a689c8bdeaac7d10e421 + last_write_checksum: sha1:0bac2098e378c245be34c17842da9c8121b8275d + pristine_git_object: add8bfb5806dbef16f20985b9be0faab50298fd8 src/openrouter/analytics.py: id: cb406b5aaabb last_write_checksum: sha1:3ea0f1c73fb9c101b7bc5719da4dd7bf62ff469a @@ -7178,8 +7230,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:464c7d54ea7f9bcec393d05f1d433ed5ebe24ac0 - pristine_git_object: 2d6b0ae3aa92f73697966b8e0d25df317d888310 + last_write_checksum: sha1:f60cd4f5bc011539964e984662bf4de255c22493 + pristine_git_object: 670eeb2dbe8c686babcc1bf5dd23cd0d572fedff src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -7724,6 +7776,38 @@ trackedFiles: id: 13091b97a3f6 last_write_checksum: sha1:175467dd12af52db74931fff622ec8862298e47b pristine_git_object: 48a494268294c8640d05d6397f1ae6ba9b49bf67 + src/openrouter/components/codeinterpretercallcodedeltaevent.py: + id: 57cd88fa2bbd + last_write_checksum: sha1:494b5f489144b2b2e30203bd4cdf43df102508f6 + pristine_git_object: e3c2f4bae4ba26c2c3429635e31bc89a6c5c2225 + src/openrouter/components/codeinterpretercallcodedoneevent.py: + id: 6305a339b9af + last_write_checksum: sha1:d1f594aee0127d44a1ca0a9421ab054d2e812e83 + pristine_git_object: 1061ea3252f8763d4f4f1fa89fde8d64b6dced59 + src/openrouter/components/codeinterpretercallcompletedevent.py: + id: 45def2b2cee5 + last_write_checksum: sha1:99989a2bbcb73377b52e0cda9e2ffbc2203dc520 + pristine_git_object: 3ebe507782fc00375a506ad12080be0314e87d52 + src/openrouter/components/codeinterpretercallinprogressevent.py: + id: ffbf51e0ef8a + last_write_checksum: sha1:8da5065e099293eb25af63f0e98566277c21a6f6 + pristine_git_object: cf6578f42dcf5057f1e87d7a0162ee8757769fb0 + src/openrouter/components/codeinterpretercallinterpretingevent.py: + id: fe503db7b847 + last_write_checksum: sha1:60d21852dc24dd083d5c0dac2e2d0fbc7abca5fe + pristine_git_object: b8619642a82aac67315c3881c8b8432b89261aa6 + src/openrouter/components/codeinterpreterfileoutput.py: + id: add905ef7652 + last_write_checksum: sha1:3c52af1e5f12ea34f813aed313e8639b7f22b7fa + pristine_git_object: f094665524c9dc8ac90ca675bf9e31041b6cbb9e + src/openrouter/components/codeinterpreterimageoutput.py: + id: 0b242e2186ef + last_write_checksum: sha1:24b78ce992c536b7364dbc7763bbb98c155d78f3 + pristine_git_object: 5440fe747c67988f389c01366c2af926f078d095 + src/openrouter/components/codeinterpreterlogsoutput.py: + id: 9c871a73b94b + last_write_checksum: sha1:a66244ce1e9edf6c05bfd80e885c8610ae95d7e0 + pristine_git_object: 113b249faf288b231800815733f91b2776188a48 src/openrouter/components/codeinterpreterservertool.py: id: a72c520afbf9 last_write_checksum: sha1:89e529b98c4b42a9d573f9234ee44f702e8bfcb7 @@ -7890,8 +7974,8 @@ trackedFiles: pristine_git_object: 3e47f14839dadbbf30303e0b1e703802a3eaedf3 src/openrouter/components/customtoolcalloutputitem.py: id: 533940b12cd2 - last_write_checksum: sha1:35d003dc2704b61038c6f776f59fff5d4c4e8677 - pristine_git_object: b80b24da37f0c0ace34a5d9e95e54e226086419e + last_write_checksum: sha1:68089e5a22099cc2d438eb7be71e39fdda816241 + pristine_git_object: f6c97dc258f59093ca23fd06ca4969952477ce73 src/openrouter/components/dabenchmarkentry.py: id: 5f5745cbfe75 last_write_checksum: sha1:4416b41c6ca98d790893113ed5f6c3e0157e74dd @@ -8042,8 +8126,8 @@ trackedFiles: pristine_git_object: 8d9002fa30aea04624c233b970eb36001a764f40 src/openrouter/components/functioncalloutputitem.py: id: bf659aa04e7d - last_write_checksum: sha1:0100d1d3b565d9701635773fe6c5f2fcbadb1353 - pristine_git_object: 5a290e0b17b588c58fc73ff77b95bc38fac2245f + last_write_checksum: sha1:011dcfa6feb0042f5a20e1a0caee9d8b300b0457 + pristine_git_object: bbae407986dbec466356c39751216f07e879220b src/openrouter/components/fusionanalysisresult.py: id: 8c88c59e344e last_write_checksum: sha1:b64559e722fac2ca6acf2d8e69ba29080d0350fd @@ -8290,8 +8374,8 @@ trackedFiles: pristine_git_object: f499cbbb546232f5cfbfe2c44fb41aefb306c87f src/openrouter/components/inputs_union.py: id: 17d6239cb6a7 - last_write_checksum: sha1:47b4138ee8bdcb0a779903f037d40f9ff777f00f - pristine_git_object: 636485dea6c14040b9357237b04489decc0d2b5a + last_write_checksum: sha1:12efadbe47b5fbe8557ba3f188be85336847743b + pristine_git_object: 82a4055ff813e8b8c627aba63c5202c0c7c29363 src/openrouter/components/inputtext.py: id: a995ae96be99 last_write_checksum: sha1:2da9ff645acc96772701908830151c5a707ed021 @@ -8706,8 +8790,8 @@ trackedFiles: pristine_git_object: 3366466ab412cb62051880b09619babda8d200d5 src/openrouter/components/outputcodeinterpretercallitem.py: id: f3d69267994b - last_write_checksum: sha1:19c1c83023a655dd2941baf6b8c3d6ccf37ada6d - pristine_git_object: cdf3d63b6bb7309da0c094232a08de2b8af9ad8b + last_write_checksum: sha1:dc1524411086fceb7123fe4a7b32bd9c5539432e + pristine_git_object: 2a05974f17cc4b3ee7a8569c0da9b2855506010a src/openrouter/components/outputcodeinterpreterservertoolitem.py: id: 628c3093647e last_write_checksum: sha1:a26aaf9a1ce42a37ff68404c98e62f76f745a10e @@ -8758,8 +8842,8 @@ trackedFiles: pristine_git_object: 94af810bbdb87fb8c6800645354f7ec4dd067e7f src/openrouter/components/outputitems.py: id: 90f107de3116 - last_write_checksum: sha1:754a89a9140d8ea809d266740900ea1e6672a526 - pristine_git_object: 18c57e57bdd273faa0c9b4798cd8a87aa7a44093 + last_write_checksum: sha1:11ae20f32633b9e35a8bb591bb6c0ec8efe24d0a + pristine_git_object: e636dee65c7243deacf11bc538b37388c78a3e40 src/openrouter/components/outputmcpservertoolitem.py: id: bb8c2536a58e last_write_checksum: sha1:28d33c9226ff4ce6871457fa1fae384b590f676c @@ -8818,8 +8902,8 @@ trackedFiles: pristine_git_object: 9b139a07d00c0fdee897f87e2336838f3a4130bd src/openrouter/components/outputwebsearchcallitem.py: id: 8c94cd441023 - last_write_checksum: sha1:80e10b29932f6f3bbcacdbdf98f00d2c4c4bc384 - pristine_git_object: fd19c842ecd8817dd85cb4146591eba0e90a9d23 + last_write_checksum: sha1:b2de1d7e888e18dbfabd8d142d3a807a452b8eaf + pristine_git_object: 1bf141f2fb8ab4465931103371e8298987c33911 src/openrouter/components/outputwebsearchservertoolitem.py: id: b1fcca0b3fd3 last_write_checksum: sha1:fe18ea4e95294b30c6c22efd3941cd0cf660b94b @@ -9230,8 +9314,8 @@ trackedFiles: pristine_git_object: a27d8806096c5db215e83fc89b4700ff94d3078f src/openrouter/components/streamevents.py: id: 331636234c76 - last_write_checksum: sha1:112335cf676d4178d1eadce236ef4f0c7ea3a7ec - pristine_git_object: 6e69218e4e91b0f7181b4f78a179faecee4ec913 + last_write_checksum: sha1:00825f6b341d0ec77d8f5488f17e6fb580daab1b + pristine_git_object: 0f44579de3554658650bf89e9cf529ea8e886d03 src/openrouter/components/streameventsresponsecompleted.py: id: fd244f61371c last_write_checksum: sha1:011e0930c7994f64dbee78c0a4c2fa5d7167d8ab @@ -11939,3 +12023,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: "## Python SDK Changes:\n* `open_router.beta.responses.send()`: \n * `request.input.union(Array<>)[]` **Changed**\n * `response` **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" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 37e59711..7baa302f 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.1.39 + version: 1.1.40 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index c7333049..ce735fd8 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -3923,6 +3923,7 @@ components: discriminator: mapping: apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + code_interpreter_call: '#/components/schemas/OutputItemCodeInterpreterCall' custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' file_search_call: '#/components/schemas/OutputItemFileSearchCall' function_call: '#/components/schemas/OutputItemFunctionCall' @@ -3940,6 +3941,7 @@ components: - $ref: '#/components/schemas/OutputItemFileSearchCall' - $ref: '#/components/schemas/OutputItemImageGenerationCall' - $ref: '#/components/schemas/OutputItemApplyPatchCall' + - $ref: '#/components/schemas/OutputItemCodeInterpreterCall' type: 'array' output_text: type: 'string' @@ -6210,7 +6212,69 @@ components: required: - 'type' type: 'object' + CodeInterpreterCallCodeDeltaEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesCodeInterpreterCallCodeDelta' + - properties: {} + type: 'object' + description: 'Incremental chunk of code being streamed for a `code_interpreter_call`.' + example: + delta: 'print("hello")' + item_id: 'ci-abc123' + output_index: 0 + sequence_number: 3 + type: 'response.code_interpreter_call_code.delta' + CodeInterpreterCallCodeDoneEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesCodeInterpreterCallCodeDone' + - properties: {} + type: 'object' + description: 'Emitted when code streaming completes for a `code_interpreter_call`.' + example: + code: 'print("hello")' + item_id: 'ci-abc123' + output_index: 0 + sequence_number: 8 + type: 'response.code_interpreter_call_code.done' + CodeInterpreterCallCompletedEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesCodeInterpreterCallCompleted' + - properties: {} + type: 'object' + description: 'Code interpreter call completed' + example: + item_id: 'ci-abc123' + output_index: 0 + sequence_number: 10 + type: 'response.code_interpreter_call.completed' + CodeInterpreterCallInProgressEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesCodeInterpreterCallInProgress' + - properties: {} + type: 'object' + description: 'Code interpreter call in progress' + example: + item_id: 'ci-abc123' + output_index: 0 + sequence_number: 2 + type: 'response.code_interpreter_call.in_progress' + CodeInterpreterCallInterpretingEvent: + allOf: + - $ref: '#/components/schemas/OpenAIResponsesCodeInterpreterCallInterpreting' + - properties: {} + type: 'object' + description: 'Code interpreter is executing the code' + example: + item_id: 'ci-abc123' + output_index: 0 + sequence_number: 9 + type: 'response.code_interpreter_call.interpreting' CodeInterpreterCallItem: + allOf: + - $ref: '#/components/schemas/OutputItemCodeInterpreterCall' + - additionalProperties: {} + properties: {} + type: 'object' description: 'A code interpreter execution call with outputs' example: code: 'print("Hello, World!")' @@ -6221,56 +6285,73 @@ components: type: 'logs' status: 'completed' type: 'code_interpreter_call' + CodeInterpreterFileOutput: + example: + download_url: 'https://example.com/download/file_abc123' + filename: 'summary.txt' + id: 'file_abc123' + type: 'file' properties: - code: + download_url: + description: 'Provider-issued download URL for the generated file. Typically signed and time-limited (see `expires_at`); fetch promptly rather than persisting the URL.' + type: 'string' + error_code: + description: 'Provider error code when generating or persisting the file failed; null or absent on success.' type: - 'string' - 'null' - container_id: + expires_at: + description: 'When the `download_url` stops working, as an ISO 8601 timestamp. After this time the file must be regenerated.' + type: 'string' + filename: type: 'string' id: type: 'string' - outputs: - items: - anyOf: - - properties: - type: - enum: - - 'image' - type: 'string' - url: - type: 'string' - required: - - 'type' - - 'url' - type: 'object' - - properties: - logs: - type: 'string' - type: - enum: - - 'logs' - type: 'string' - required: - - 'type' - - 'logs' - type: 'object' - type: - - 'array' - - 'null' + media_type: + type: 'string' + sha256: + type: 'string' + size_bytes: + type: 'integer' status: - $ref: '#/components/schemas/ToolCallStatus' + description: 'Provider-reported readiness of the generated file (e.g. `ready`). Values other than `ready` indicate the artifact may not be downloadable.' + type: 'string' type: enum: - - 'code_interpreter_call' + - 'file' type: 'string' required: - 'type' - - 'id' - - 'code' - - 'outputs' - - 'status' - - 'container_id' + type: 'object' + CodeInterpreterImageOutput: + example: + type: 'image' + url: 'https://example.com/plot.png' + properties: + type: + enum: + - 'image' + type: 'string' + url: + type: 'string' + required: + - 'type' + - 'url' + type: 'object' + CodeInterpreterLogsOutput: + example: + logs: "hello\n" + type: 'logs' + properties: + logs: + type: 'string' + type: + enum: + - 'logs' + type: 'string' + required: + - 'type' + - 'logs' type: 'object' CodeInterpreterServerTool: description: 'Code interpreter tool configuration' @@ -17056,6 +17137,129 @@ components: filename: 'research_paper.pdf' index: 0 type: 'file_citation' + OpenAIResponsesCodeInterpreterCallCodeDelta: + example: + delta: 'print("hello")' + item_id: 'ci_abc123' + output_index: 0 + sequence_number: 2 + type: 'response.code_interpreter_call_code.delta' + properties: + delta: + type: 'string' + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.code_interpreter_call_code.delta' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + - 'delta' + type: 'object' + OpenAIResponsesCodeInterpreterCallCodeDone: + example: + code: 'print("hello")' + item_id: 'ci_abc123' + output_index: 0 + sequence_number: 3 + type: 'response.code_interpreter_call_code.done' + properties: + code: + type: 'string' + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.code_interpreter_call_code.done' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + - 'code' + type: 'object' + OpenAIResponsesCodeInterpreterCallCompleted: + example: + item_id: 'ci_abc123' + output_index: 0 + sequence_number: 3 + type: 'response.code_interpreter_call.completed' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.code_interpreter_call.completed' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + OpenAIResponsesCodeInterpreterCallInProgress: + example: + item_id: 'ci_abc123' + output_index: 0 + sequence_number: 1 + type: 'response.code_interpreter_call.in_progress' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.code_interpreter_call.in_progress' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + OpenAIResponsesCodeInterpreterCallInterpreting: + example: + item_id: 'ci_abc123' + output_index: 0 + sequence_number: 2 + type: 'response.code_interpreter_call.interpreting' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.code_interpreter_call.interpreting' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' OpenAIResponsesImageGenCallCompleted: example: item_id: 'ig_abc123' @@ -17992,7 +18196,8 @@ components: OutputCodeInterpreterCallItem: allOf: - $ref: '#/components/schemas/CodeInterpreterCallItem' - - properties: {} + - additionalProperties: {} + properties: {} type: 'object' description: 'A code interpreter execution call with outputs' example: @@ -18355,6 +18560,7 @@ components: discriminator: mapping: apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + code_interpreter_call: '#/components/schemas/OutputItemCodeInterpreterCall' custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' file_search_call: '#/components/schemas/OutputItemFileSearchCall' function_call: '#/components/schemas/OutputItemFunctionCall' @@ -18372,6 +18578,7 @@ components: - $ref: '#/components/schemas/OutputItemFileSearchCall' - $ref: '#/components/schemas/OutputItemImageGenerationCall' - $ref: '#/components/schemas/OutputItemApplyPatchCall' + - $ref: '#/components/schemas/OutputItemCodeInterpreterCall' output_index: type: 'integer' sequence_number: @@ -18431,6 +18638,58 @@ components: - 'operation' - 'status' type: 'object' + OutputItemCodeInterpreterCall: + additionalProperties: {} + example: + code: 'print("hello")' + id: 'ci_abc123' + outputs: + - logs: "hello\n" + type: 'logs' + status: 'completed' + type: 'code_interpreter_call' + properties: + code: + type: + - 'string' + - 'null' + container_id: + type: 'string' + id: + type: 'string' + outputs: + items: + discriminator: + mapping: + file: '#/components/schemas/CodeInterpreterFileOutput' + image: '#/components/schemas/CodeInterpreterImageOutput' + logs: '#/components/schemas/CodeInterpreterLogsOutput' + propertyName: 'type' + oneOf: + - $ref: '#/components/schemas/CodeInterpreterLogsOutput' + - $ref: '#/components/schemas/CodeInterpreterImageOutput' + - $ref: '#/components/schemas/CodeInterpreterFileOutput' + type: + - 'array' + - 'null' + status: + enum: + - 'in_progress' + - 'completed' + - 'incomplete' + - 'interpreting' + - 'failed' + type: 'string' + x-speakeasy-unknown-values: allow + type: + enum: + - 'code_interpreter_call' + type: 'string' + required: + - 'type' + - 'id' + - 'status' + type: 'object' OutputItemCustomToolCall: example: call_id: 'call-abc123' @@ -18480,6 +18739,7 @@ components: discriminator: mapping: apply_patch_call: '#/components/schemas/OutputItemApplyPatchCall' + code_interpreter_call: '#/components/schemas/OutputItemCodeInterpreterCall' custom_tool_call: '#/components/schemas/OutputItemCustomToolCall' file_search_call: '#/components/schemas/OutputItemFileSearchCall' function_call: '#/components/schemas/OutputItemFunctionCall' @@ -18497,6 +18757,7 @@ components: - $ref: '#/components/schemas/OutputItemFileSearchCall' - $ref: '#/components/schemas/OutputItemImageGenerationCall' - $ref: '#/components/schemas/OutputItemApplyPatchCall' + - $ref: '#/components/schemas/OutputItemCodeInterpreterCall' output_index: type: 'integer' sequence_number: @@ -18720,6 +18981,7 @@ components: - $ref: '#/components/schemas/OutputFilesServerToolItem' - $ref: '#/components/schemas/OutputCustomToolCallItem' OutputItemWebSearchCall: + additionalProperties: {} example: action: query: 'OpenAI API' @@ -19239,7 +19501,8 @@ components: OutputWebSearchCallItem: allOf: - $ref: '#/components/schemas/OutputItemWebSearchCall' - - properties: {} + - additionalProperties: {} + properties: {} type: 'object' example: id: 'ws-abc123' @@ -22740,6 +23003,11 @@ components: error: '#/components/schemas/ErrorEvent' response.apply_patch_call_operation_diff.delta: '#/components/schemas/ApplyPatchCallOperationDiffDeltaEvent' response.apply_patch_call_operation_diff.done: '#/components/schemas/ApplyPatchCallOperationDiffDoneEvent' + response.code_interpreter_call_code.delta: '#/components/schemas/CodeInterpreterCallCodeDeltaEvent' + response.code_interpreter_call_code.done: '#/components/schemas/CodeInterpreterCallCodeDoneEvent' + response.code_interpreter_call.completed: '#/components/schemas/CodeInterpreterCallCompletedEvent' + response.code_interpreter_call.in_progress: '#/components/schemas/CodeInterpreterCallInProgressEvent' + response.code_interpreter_call.interpreting: '#/components/schemas/CodeInterpreterCallInterpretingEvent' response.completed: '#/components/schemas/StreamEventsResponseCompleted' response.content_part.added: '#/components/schemas/ContentPartAddedEvent' response.content_part.done: '#/components/schemas/ContentPartDoneEvent' @@ -22833,6 +23101,11 @@ components: - $ref: '#/components/schemas/ImageGenCallGeneratingEvent' - $ref: '#/components/schemas/ImageGenCallPartialImageEvent' - $ref: '#/components/schemas/ImageGenCallCompletedEvent' + - $ref: '#/components/schemas/CodeInterpreterCallInProgressEvent' + - $ref: '#/components/schemas/CodeInterpreterCallInterpretingEvent' + - $ref: '#/components/schemas/CodeInterpreterCallCompletedEvent' + - $ref: '#/components/schemas/CodeInterpreterCallCodeDeltaEvent' + - $ref: '#/components/schemas/CodeInterpreterCallCodeDoneEvent' - $ref: '#/components/schemas/WebSearchCallInProgressEvent' - $ref: '#/components/schemas/WebSearchCallSearchingEvent' - $ref: '#/components/schemas/WebSearchCallCompletedEvent' diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 756fe8db..34cb26e4 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:6849054eae332165a01616dd2091d05f0a57a524efac24db416762aef06f8a21 - sourceBlobDigest: sha256:4d5de277c3c9e905f111de416fc5de6f4a0a5d795933f5b1d4726acd5ebdea58 + sourceRevisionDigest: sha256:35e67391b197f8732722c0dcb24d4209f4813551f34a8adf570e4eaea2b1f48f + sourceBlobDigest: sha256:e2f8d2320125220985c946e142d32005f35fd241d2bdac79a86d3ad136446e8f tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:6849054eae332165a01616dd2091d05f0a57a524efac24db416762aef06f8a21 - sourceBlobDigest: sha256:4d5de277c3c9e905f111de416fc5de6f4a0a5d795933f5b1d4726acd5ebdea58 + sourceRevisionDigest: sha256:35e67391b197f8732722c0dcb24d4209f4813551f34a8adf570e4eaea2b1f48f + sourceBlobDigest: sha256:e2f8d2320125220985c946e142d32005f35fd241d2bdac79a86d3ad136446e8f codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:2366bc5b32aa50e28b3d02521973ce550603c24d4079d8ea94ac81326bfa5754 + codeSamplesRevisionDigest: sha256:955c8dcebd02c34fc2a3f2cc5f01499c9b98686ee98571537f56a02ef42c73a4 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.787.0 diff --git a/RELEASES.md b/RELEASES.md index d1c1b6fb..38291470 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1179,4 +1179,14 @@ Based on: ### Generated - [python v1.1.39] . ### Releases -- [PyPI v1.1.39] https://pypi.org/project/openrouter/1.1.39 - . \ No newline at end of file +- [PyPI v1.1.39] https://pypi.org/project/openrouter/1.1.39 - . + +## 2026-08-10 19:25:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.787.0 (2.914.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.1.40] . +### Releases +- [PyPI v1.1.40] https://pypi.org/project/openrouter/1.1.40 - . \ No newline at end of file diff --git a/docs/components/codeinterpretercallcodedeltaevent.mdx b/docs/components/codeinterpretercallcodedeltaevent.mdx new file mode 100644 index 00000000..70e78af0 --- /dev/null +++ b/docs/components/codeinterpretercallcodedeltaevent.mdx @@ -0,0 +1,16 @@ +--- +title: "CodeInterpreterCallCodeDeltaEvent" +--- + +Incremental chunk of code being streamed for a `code_interpreter_call`. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `delta` | *str* | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *int* | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterCallCodeDeltaEventType](../components/codeinterpretercallcodedeltaeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpretercallcodedeltaeventtype.mdx b/docs/components/codeinterpretercallcodedeltaeventtype.mdx new file mode 100644 index 00000000..e1646fe1 --- /dev/null +++ b/docs/components/codeinterpretercallcodedeltaeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallCodeDeltaEventType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterCallCodeDeltaEventType +value: CodeInterpreterCallCodeDeltaEventType = "response.code_interpreter_call_code.delta" +``` + + +## Values + +- `"response.code_interpreter_call_code.delta"` diff --git a/docs/components/codeinterpretercallcodedoneevent.mdx b/docs/components/codeinterpretercallcodedoneevent.mdx new file mode 100644 index 00000000..d7bc2ec6 --- /dev/null +++ b/docs/components/codeinterpretercallcodedoneevent.mdx @@ -0,0 +1,16 @@ +--- +title: "CodeInterpreterCallCodeDoneEvent" +--- + +Emitted when code streaming completes for a `code_interpreter_call`. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `code` | *str* | :heavy_check_mark: | N/A | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *int* | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterCallCodeDoneEventType](../components/codeinterpretercallcodedoneeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpretercallcodedoneeventtype.mdx b/docs/components/codeinterpretercallcodedoneeventtype.mdx new file mode 100644 index 00000000..2f98b03b --- /dev/null +++ b/docs/components/codeinterpretercallcodedoneeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallCodeDoneEventType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterCallCodeDoneEventType +value: CodeInterpreterCallCodeDoneEventType = "response.code_interpreter_call_code.done" +``` + + +## Values + +- `"response.code_interpreter_call_code.done"` diff --git a/docs/components/codeinterpretercallcompletedevent.mdx b/docs/components/codeinterpretercallcompletedevent.mdx new file mode 100644 index 00000000..0589dc6b --- /dev/null +++ b/docs/components/codeinterpretercallcompletedevent.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallCompletedEvent" +--- + +Code interpreter call completed + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *int* | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterCallCompletedEventType](../components/codeinterpretercallcompletedeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpretercallcompletedeventtype.mdx b/docs/components/codeinterpretercallcompletedeventtype.mdx new file mode 100644 index 00000000..eb4b77ae --- /dev/null +++ b/docs/components/codeinterpretercallcompletedeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallCompletedEventType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterCallCompletedEventType +value: CodeInterpreterCallCompletedEventType = "response.code_interpreter_call.completed" +``` + + +## Values + +- `"response.code_interpreter_call.completed"` diff --git a/docs/components/outputimage.mdx b/docs/components/codeinterpretercallinprogressevent.mdx similarity index 51% rename from docs/components/outputimage.mdx rename to docs/components/codeinterpretercallinprogressevent.mdx index a7b82463..0c1876df 100644 --- a/docs/components/outputimage.mdx +++ b/docs/components/codeinterpretercallinprogressevent.mdx @@ -1,10 +1,15 @@ --- -title: "OutputImage" +title: "CodeInterpreterCallInProgressEvent" --- +Code interpreter call in progress + + ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `type` | [components.OutputCodeInterpreterCallItemTypeImage](../components/outputcodeinterpretercallitemtypeimage.mdx) | :heavy_check_mark: | N/A | -| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *int* | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterCallInProgressEventType](../components/codeinterpretercallinprogresseventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpretercallinprogresseventtype.mdx b/docs/components/codeinterpretercallinprogresseventtype.mdx new file mode 100644 index 00000000..45e38c0b --- /dev/null +++ b/docs/components/codeinterpretercallinprogresseventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallInProgressEventType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterCallInProgressEventType +value: CodeInterpreterCallInProgressEventType = "response.code_interpreter_call.in_progress" +``` + + +## Values + +- `"response.code_interpreter_call.in_progress"` diff --git a/docs/components/codeinterpretercallinterpretingevent.mdx b/docs/components/codeinterpretercallinterpretingevent.mdx new file mode 100644 index 00000000..92fb7446 --- /dev/null +++ b/docs/components/codeinterpretercallinterpretingevent.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallInterpretingEvent" +--- + +Code interpreter is executing the code + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `item_id` | *str* | :heavy_check_mark: | N/A | +| `output_index` | *int* | :heavy_check_mark: | N/A | +| `sequence_number` | *int* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterCallInterpretingEventType](../components/codeinterpretercallinterpretingeventtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpretercallinterpretingeventtype.mdx b/docs/components/codeinterpretercallinterpretingeventtype.mdx new file mode 100644 index 00000000..ba4d90b1 --- /dev/null +++ b/docs/components/codeinterpretercallinterpretingeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterCallInterpretingEventType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterCallInterpretingEventType +value: CodeInterpreterCallInterpretingEventType = "response.code_interpreter_call.interpreting" +``` + + +## Values + +- `"response.code_interpreter_call.interpreting"` diff --git a/docs/components/codeinterpreterfileoutput.mdx b/docs/components/codeinterpreterfileoutput.mdx new file mode 100644 index 00000000..623e6126 --- /dev/null +++ b/docs/components/codeinterpreterfileoutput.mdx @@ -0,0 +1,18 @@ +--- +title: "CodeInterpreterFileOutput" +--- + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `download_url` | *Optional[str]* | :heavy_minus_sign: | Provider-issued download URL for the generated file. Typically signed and time-limited (see `expires_at`); fetch promptly rather than persisting the URL. | +| `error_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Provider error code when generating or persisting the file failed; null or absent on success. | +| `expires_at` | *Optional[str]* | :heavy_minus_sign: | When the `download_url` stops working, as an ISO 8601 timestamp. After this time the file must be regenerated. | +| `filename` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `media_type` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `sha256` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `size_bytes` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `status` | *Optional[str]* | :heavy_minus_sign: | Provider-reported readiness of the generated file (e.g. `ready`). Values other than `ready` indicate the artifact may not be downloadable. | +| `type` | [components.CodeInterpreterFileOutputType](../components/codeinterpreterfileoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpreterfileoutputtype.mdx b/docs/components/codeinterpreterfileoutputtype.mdx new file mode 100644 index 00000000..62f1f4af --- /dev/null +++ b/docs/components/codeinterpreterfileoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterFileOutputType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterFileOutputType +value: CodeInterpreterFileOutputType = "file" +``` + + +## Values + +- `"file"` diff --git a/docs/components/codeinterpreterimageoutput.mdx b/docs/components/codeinterpreterimageoutput.mdx new file mode 100644 index 00000000..e259d6ef --- /dev/null +++ b/docs/components/codeinterpreterimageoutput.mdx @@ -0,0 +1,10 @@ +--- +title: "CodeInterpreterImageOutput" +--- + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `type` | [components.CodeInterpreterImageOutputType](../components/codeinterpreterimageoutputtype.mdx) | :heavy_check_mark: | N/A | +| `url` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpreterimageoutputtype.mdx b/docs/components/codeinterpreterimageoutputtype.mdx new file mode 100644 index 00000000..4fabf1c9 --- /dev/null +++ b/docs/components/codeinterpreterimageoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterImageOutputType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterImageOutputType +value: CodeInterpreterImageOutputType = "image" +``` + + +## Values + +- `"image"` diff --git a/docs/components/codeinterpreterlogsoutput.mdx b/docs/components/codeinterpreterlogsoutput.mdx new file mode 100644 index 00000000..9ac144a8 --- /dev/null +++ b/docs/components/codeinterpreterlogsoutput.mdx @@ -0,0 +1,10 @@ +--- +title: "CodeInterpreterLogsOutput" +--- + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `logs` | *str* | :heavy_check_mark: | N/A | +| `type` | [components.CodeInterpreterLogsOutputType](../components/codeinterpreterlogsoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/codeinterpreterlogsoutputtype.mdx b/docs/components/codeinterpreterlogsoutputtype.mdx new file mode 100644 index 00000000..c1a03f22 --- /dev/null +++ b/docs/components/codeinterpreterlogsoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CodeInterpreterLogsOutputType" +--- + +## Example Usage + +```python +from openrouter.components import CodeInterpreterLogsOutputType +value: CodeInterpreterLogsOutputType = "logs" +``` + + +## Values + +- `"logs"` diff --git a/docs/components/customtoolcalloutputitemoutputinputimage.mdx b/docs/components/customtoolcalloutputitemoutputinputimage.mdx index 830ac246..ccd8f202 100644 --- a/docs/components/customtoolcalloutputitemoutputinputimage.mdx +++ b/docs/components/customtoolcalloutputitemoutputinputimage.mdx @@ -7,8 +7,8 @@ Image input content item ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `detail` | [components.CustomToolCallOutputItemDetail](../components/customtoolcalloutputitemdetail.mdx) | :heavy_check_mark: | N/A | -| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `type` | [components.CustomToolCallOutputItemTypeInputImage](../components/customtoolcalloutputitemtypeinputimage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `detail` | [components.CustomToolCallOutputItemDetail](../components/customtoolcalloutputitemdetail.mdx) | :heavy_check_mark: | N/A | +| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `type` | [components.CustomToolCallOutputItemOutputType](../components/customtoolcalloutputitemoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/customtoolcalloutputitemoutputtype.mdx b/docs/components/customtoolcalloutputitemoutputtype.mdx new file mode 100644 index 00000000..bf573ae7 --- /dev/null +++ b/docs/components/customtoolcalloutputitemoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "CustomToolCallOutputItemOutputType" +--- + +## Example Usage + +```python +from openrouter.components import CustomToolCallOutputItemOutputType +value: CustomToolCallOutputItemOutputType = "input_image" +``` + + +## Values + +- `"input_image"` diff --git a/docs/components/customtoolcalloutputitemtypeinputimage.mdx b/docs/components/customtoolcalloutputitemtypeinputimage.mdx deleted file mode 100644 index 821cf8bb..00000000 --- a/docs/components/customtoolcalloutputitemtypeinputimage.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "CustomToolCallOutputItemTypeInputImage" ---- - -## Example Usage - -```python -from openrouter.components import CustomToolCallOutputItemTypeInputImage -value: CustomToolCallOutputItemTypeInputImage = "input_image" -``` - - -## Values - -- `"input_image"` diff --git a/docs/components/functioncalloutputitemoutputinputimage.mdx b/docs/components/functioncalloutputitemoutputinputimage.mdx index 55bb2225..61b3a7cb 100644 --- a/docs/components/functioncalloutputitemoutputinputimage.mdx +++ b/docs/components/functioncalloutputitemoutputinputimage.mdx @@ -7,8 +7,8 @@ Image input content item ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `detail` | [components.FunctionCallOutputItemDetail](../components/functioncalloutputitemdetail.mdx) | :heavy_check_mark: | N/A | -| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | -| `type` | [components.FunctionCallOutputItemTypeInputImage](../components/functioncalloutputitemtypeinputimage.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `detail` | [components.FunctionCallOutputItemDetail](../components/functioncalloutputitemdetail.mdx) | :heavy_check_mark: | N/A | +| `image_url` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | +| `type` | [components.FunctionCallOutputItemOutputType](../components/functioncalloutputitemoutputtype.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/functioncalloutputitemoutputtype.mdx b/docs/components/functioncalloutputitemoutputtype.mdx new file mode 100644 index 00000000..e1e11e98 --- /dev/null +++ b/docs/components/functioncalloutputitemoutputtype.mdx @@ -0,0 +1,15 @@ +--- +title: "FunctionCallOutputItemOutputType" +--- + +## Example Usage + +```python +from openrouter.components import FunctionCallOutputItemOutputType +value: FunctionCallOutputItemOutputType = "input_image" +``` + + +## Values + +- `"input_image"` diff --git a/docs/components/functioncalloutputitemtypeinputimage.mdx b/docs/components/functioncalloutputitemtypeinputimage.mdx deleted file mode 100644 index eff3701c..00000000 --- a/docs/components/functioncalloutputitemtypeinputimage.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "FunctionCallOutputItemTypeInputImage" ---- - -## Example Usage - -```python -from openrouter.components import FunctionCallOutputItemTypeInputImage -value: FunctionCallOutputItemTypeInputImage = "input_image" -``` - - -## Values - -- `"input_image"` diff --git a/docs/components/outputcodeinterpretercallitem.mdx b/docs/components/outputcodeinterpretercallitem.mdx index 08f28041..bd964353 100644 --- a/docs/components/outputcodeinterpretercallitem.mdx +++ b/docs/components/outputcodeinterpretercallitem.mdx @@ -7,11 +7,12 @@ A code interpreter execution call with outputs ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `code` | *Nullable[str]* | :heavy_check_mark: | N/A | | -| `container_id` | *str* | :heavy_check_mark: | N/A | | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `outputs` | List[[components.OutputCodeInterpreterCallItemOutputUnion](../components/outputcodeinterpretercallitemoutputunion.mdx)] | :heavy_check_mark: | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | :heavy_check_mark: | N/A | completed | -| `type` | [components.TypeCodeInterpreterCall](../components/typecodeinterpretercall.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | N/A | | +| `container_id` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `outputs` | List[[components.OutputCodeInterpreterCallItemOutput](../components/outputcodeinterpretercallitemoutput.mdx)] | :heavy_minus_sign: | N/A | | +| `status` | [components.OutputCodeInterpreterCallItemStatus](../components/outputcodeinterpretercallitemstatus.mdx) | :heavy_check_mark: | N/A | | +| `type` | [components.OutputCodeInterpreterCallItemType](../components/outputcodeinterpretercallitemtype.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"code": "print(\"hello\")",
"container_id": "ctr-xyz789",
"id": "ci-abc123",
"outputs": [
\{
"logs": "hello\n",
"type": "logs"
}
],
"status": "completed",
"type": "code_interpreter_call"
} | \ No newline at end of file diff --git a/docs/components/outputcodeinterpretercallitemoutput.mdx b/docs/components/outputcodeinterpretercallitemoutput.mdx new file mode 100644 index 00000000..c153d53b --- /dev/null +++ b/docs/components/outputcodeinterpretercallitemoutput.mdx @@ -0,0 +1,24 @@ +--- +title: "OutputCodeInterpreterCallItemOutput" +--- + +## Supported Types + +### `components.CodeInterpreterFileOutput` + +```python +value: components.CodeInterpreterFileOutput = /* values here */ +``` + +### `components.CodeInterpreterImageOutput` + +```python +value: components.CodeInterpreterImageOutput = /* values here */ +``` + +### `components.CodeInterpreterLogsOutput` + +```python +value: components.CodeInterpreterLogsOutput = /* values here */ +``` + diff --git a/docs/components/outputcodeinterpretercallitemoutputunion.mdx b/docs/components/outputcodeinterpretercallitemoutputunion.mdx deleted file mode 100644 index 02e6c2ca..00000000 --- a/docs/components/outputcodeinterpretercallitemoutputunion.mdx +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "OutputCodeInterpreterCallItemOutputUnion" ---- - -## Supported Types - -### `components.OutputImage` - -```python -value: components.OutputImage = /* values here */ -``` - -### `components.OutputLogs` - -```python -value: components.OutputLogs = /* values here */ -``` - diff --git a/docs/components/outputcodeinterpretercallitemstatus.mdx b/docs/components/outputcodeinterpretercallitemstatus.mdx new file mode 100644 index 00000000..472a16ae --- /dev/null +++ b/docs/components/outputcodeinterpretercallitemstatus.mdx @@ -0,0 +1,23 @@ +--- +title: "OutputCodeInterpreterCallItemStatus" +--- + +## Example Usage + +```python +from openrouter.components import OutputCodeInterpreterCallItemStatus + +# Open enum: unrecognized values are captured as UnrecognizedStr +value: OutputCodeInterpreterCallItemStatus = "in_progress" +``` + + +## Values + +This is an open enum. Unrecognized values will not fail type checks. + +- `"in_progress"` +- `"completed"` +- `"incomplete"` +- `"interpreting"` +- `"failed"` diff --git a/docs/components/outputcodeinterpretercallitemtype.mdx b/docs/components/outputcodeinterpretercallitemtype.mdx new file mode 100644 index 00000000..20a4e3ea --- /dev/null +++ b/docs/components/outputcodeinterpretercallitemtype.mdx @@ -0,0 +1,15 @@ +--- +title: "OutputCodeInterpreterCallItemType" +--- + +## Example Usage + +```python +from openrouter.components import OutputCodeInterpreterCallItemType +value: OutputCodeInterpreterCallItemType = "code_interpreter_call" +``` + + +## Values + +- `"code_interpreter_call"` diff --git a/docs/components/outputcodeinterpretercallitemtypeimage.mdx b/docs/components/outputcodeinterpretercallitemtypeimage.mdx deleted file mode 100644 index c901280c..00000000 --- a/docs/components/outputcodeinterpretercallitemtypeimage.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "OutputCodeInterpreterCallItemTypeImage" ---- - -## Example Usage - -```python -from openrouter.components import OutputCodeInterpreterCallItemTypeImage -value: OutputCodeInterpreterCallItemTypeImage = "image" -``` - - -## Values - -- `"image"` diff --git a/docs/components/outputlogs.mdx b/docs/components/outputlogs.mdx deleted file mode 100644 index e6eb732c..00000000 --- a/docs/components/outputlogs.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "OutputLogs" ---- - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| `logs` | *str* | :heavy_check_mark: | N/A | -| `type` | [components.TypeLogs](../components/typelogs.mdx) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/components/outputwebsearchcallitem.mdx b/docs/components/outputwebsearchcallitem.mdx index 3a389a5f..746838c8 100644 --- a/docs/components/outputwebsearchcallitem.mdx +++ b/docs/components/outputwebsearchcallitem.mdx @@ -4,9 +4,10 @@ title: "OutputWebSearchCallItem" ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `action` | [Optional[components.Action]](../components/action.mdx) | :heavy_minus_sign: | N/A | | -| `id` | *str* | :heavy_check_mark: | N/A | | -| `status` | [components.WebSearchStatus](../components/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | -| `type` | [components.TypeWebSearchCall](../components/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `action` | [Optional[components.Action]](../components/action.mdx) | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | | +| `status` | [components.WebSearchStatus](../components/websearchstatus.mdx) | :heavy_check_mark: | N/A | completed | +| `type` | [components.TypeWebSearchCall](../components/typewebsearchcall.mdx) | :heavy_check_mark: | N/A | | +| `__pydantic_extra__` | Dict[str, *Any*] | :heavy_minus_sign: | N/A | \{
"id": "ws-abc123",
"status": "completed",
"type": "web_search_call"
} | \ No newline at end of file diff --git a/docs/components/streamevents.mdx b/docs/components/streamevents.mdx index 149400c4..e4f5c124 100644 --- a/docs/components/streamevents.mdx +++ b/docs/components/streamevents.mdx @@ -25,6 +25,36 @@ value: components.ApplyPatchCallOperationDiffDeltaEvent = /* values here */ value: components.ApplyPatchCallOperationDiffDoneEvent = /* values here */ ``` +### `components.CodeInterpreterCallCodeDeltaEvent` + +```python +value: components.CodeInterpreterCallCodeDeltaEvent = /* values here */ +``` + +### `components.CodeInterpreterCallCodeDoneEvent` + +```python +value: components.CodeInterpreterCallCodeDoneEvent = /* values here */ +``` + +### `components.CodeInterpreterCallCompletedEvent` + +```python +value: components.CodeInterpreterCallCompletedEvent = /* values here */ +``` + +### `components.CodeInterpreterCallInProgressEvent` + +```python +value: components.CodeInterpreterCallInProgressEvent = /* values here */ +``` + +### `components.CodeInterpreterCallInterpretingEvent` + +```python +value: components.CodeInterpreterCallInterpretingEvent = /* values here */ +``` + ### `components.StreamEventsResponseCompleted` ```python diff --git a/docs/components/typecodeinterpretercall.mdx b/docs/components/typecodeinterpretercall.mdx deleted file mode 100644 index 374132b2..00000000 --- a/docs/components/typecodeinterpretercall.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeCodeInterpreterCall" ---- - -## Example Usage - -```python -from openrouter.components import TypeCodeInterpreterCall -value: TypeCodeInterpreterCall = "code_interpreter_call" -``` - - -## Values - -- `"code_interpreter_call"` diff --git a/docs/components/typelogs.mdx b/docs/components/typelogs.mdx deleted file mode 100644 index accf2ed9..00000000 --- a/docs/components/typelogs.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "TypeLogs" ---- - -## Example Usage - -```python -from openrouter.components import TypeLogs -value: TypeLogs = "logs" -``` - - -## Values - -- `"logs"` diff --git a/pyproject.toml b/pyproject.toml index ce5d9656..a1626c79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.1.39" +version = "1.1.40" 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 682398c0..add8bfb5 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.1.39" +__version__: str = "1.1.40" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.914.0" -__user_agent__: str = "speakeasy-sdk/python 1.1.39 2.914.0 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.1.40 2.914.0 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 2d6b0ae3..670eeb2d 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -660,6 +660,46 @@ ChatWebSearchShorthandType, ChatWebSearchShorthandTypedDict, ) + from .codeinterpretercallcodedeltaevent import ( + CodeInterpreterCallCodeDeltaEvent, + CodeInterpreterCallCodeDeltaEventType, + CodeInterpreterCallCodeDeltaEventTypedDict, + ) + from .codeinterpretercallcodedoneevent import ( + CodeInterpreterCallCodeDoneEvent, + CodeInterpreterCallCodeDoneEventType, + CodeInterpreterCallCodeDoneEventTypedDict, + ) + from .codeinterpretercallcompletedevent import ( + CodeInterpreterCallCompletedEvent, + CodeInterpreterCallCompletedEventType, + CodeInterpreterCallCompletedEventTypedDict, + ) + from .codeinterpretercallinprogressevent import ( + CodeInterpreterCallInProgressEvent, + CodeInterpreterCallInProgressEventType, + CodeInterpreterCallInProgressEventTypedDict, + ) + from .codeinterpretercallinterpretingevent import ( + CodeInterpreterCallInterpretingEvent, + CodeInterpreterCallInterpretingEventType, + CodeInterpreterCallInterpretingEventTypedDict, + ) + from .codeinterpreterfileoutput import ( + CodeInterpreterFileOutput, + CodeInterpreterFileOutputType, + CodeInterpreterFileOutputTypedDict, + ) + from .codeinterpreterimageoutput import ( + CodeInterpreterImageOutput, + CodeInterpreterImageOutputType, + CodeInterpreterImageOutputTypedDict, + ) + from .codeinterpreterlogsoutput import ( + CodeInterpreterLogsOutput, + CodeInterpreterLogsOutputType, + CodeInterpreterLogsOutputTypedDict, + ) from .codeinterpreterservertool import ( CodeInterpreterServerTool, CodeInterpreterServerToolTypedDict, @@ -863,12 +903,12 @@ CustomToolCallOutputItemDetail, CustomToolCallOutputItemOutputInputImage, CustomToolCallOutputItemOutputInputImageTypedDict, + CustomToolCallOutputItemOutputType, CustomToolCallOutputItemOutputUnion1, CustomToolCallOutputItemOutputUnion1TypedDict, CustomToolCallOutputItemOutputUnion2, CustomToolCallOutputItemOutputUnion2TypedDict, CustomToolCallOutputItemTypeCustomToolCallOutput, - CustomToolCallOutputItemTypeInputImage, CustomToolCallOutputItemTypedDict, ) from .dabenchmarkentry import DABenchmarkEntry, DABenchmarkEntryTypedDict @@ -1045,12 +1085,12 @@ FunctionCallOutputItemDetail, FunctionCallOutputItemOutputInputImage, FunctionCallOutputItemOutputInputImageTypedDict, + FunctionCallOutputItemOutputType, FunctionCallOutputItemOutputUnion1, FunctionCallOutputItemOutputUnion1TypedDict, FunctionCallOutputItemOutputUnion2, FunctionCallOutputItemOutputUnion2TypedDict, FunctionCallOutputItemTypeFunctionCallOutput, - FunctionCallOutputItemTypeInputImage, FunctionCallOutputItemTypedDict, ) from .fusionanalysisresult import ( @@ -2091,17 +2131,12 @@ ) from .outputcodeinterpretercallitem import ( OutputCodeInterpreterCallItem, - OutputCodeInterpreterCallItemOutputUnion, - OutputCodeInterpreterCallItemOutputUnionTypedDict, - OutputCodeInterpreterCallItemTypeImage, + OutputCodeInterpreterCallItemOutput, + OutputCodeInterpreterCallItemOutputTypedDict, + OutputCodeInterpreterCallItemStatus, + OutputCodeInterpreterCallItemType, OutputCodeInterpreterCallItemTypedDict, - OutputImage, - OutputImageTypedDict, - OutputLogs, - OutputLogsTypedDict, - TypeCodeInterpreterCall, - TypeLogs, - UnknownOutputCodeInterpreterCallItemOutputUnion, + UnknownOutputCodeInterpreterCallItemOutput, ) from .outputcodeinterpreterservertoolitem import ( OutputCodeInterpreterServerToolItem, @@ -3505,6 +3540,30 @@ "ClearToolInputs", "ClearToolInputsTypedDict", "Code", + "CodeInterpreterCallCodeDeltaEvent", + "CodeInterpreterCallCodeDeltaEventType", + "CodeInterpreterCallCodeDeltaEventTypedDict", + "CodeInterpreterCallCodeDoneEvent", + "CodeInterpreterCallCodeDoneEventType", + "CodeInterpreterCallCodeDoneEventTypedDict", + "CodeInterpreterCallCompletedEvent", + "CodeInterpreterCallCompletedEventType", + "CodeInterpreterCallCompletedEventTypedDict", + "CodeInterpreterCallInProgressEvent", + "CodeInterpreterCallInProgressEventType", + "CodeInterpreterCallInProgressEventTypedDict", + "CodeInterpreterCallInterpretingEvent", + "CodeInterpreterCallInterpretingEventType", + "CodeInterpreterCallInterpretingEventTypedDict", + "CodeInterpreterFileOutput", + "CodeInterpreterFileOutputType", + "CodeInterpreterFileOutputTypedDict", + "CodeInterpreterImageOutput", + "CodeInterpreterImageOutputType", + "CodeInterpreterImageOutputTypedDict", + "CodeInterpreterLogsOutput", + "CodeInterpreterLogsOutputType", + "CodeInterpreterLogsOutputTypedDict", "CodeInterpreterServerTool", "CodeInterpreterServerToolTypedDict", "CodexLocalShellTool", @@ -3644,12 +3703,12 @@ "CustomToolCallOutputItemDetail", "CustomToolCallOutputItemOutputInputImage", "CustomToolCallOutputItemOutputInputImageTypedDict", + "CustomToolCallOutputItemOutputType", "CustomToolCallOutputItemOutputUnion1", "CustomToolCallOutputItemOutputUnion1TypedDict", "CustomToolCallOutputItemOutputUnion2", "CustomToolCallOutputItemOutputUnion2TypedDict", "CustomToolCallOutputItemTypeCustomToolCallOutput", - "CustomToolCallOutputItemTypeInputImage", "CustomToolCallOutputItemTypedDict", "CustomToolTypeCustom", "CustomToolTypedDict", @@ -3806,12 +3865,12 @@ "FunctionCallOutputItemDetail", "FunctionCallOutputItemOutputInputImage", "FunctionCallOutputItemOutputInputImageTypedDict", + "FunctionCallOutputItemOutputType", "FunctionCallOutputItemOutputUnion1", "FunctionCallOutputItemOutputUnion1TypedDict", "FunctionCallOutputItemOutputUnion2", "FunctionCallOutputItemOutputUnion2TypedDict", "FunctionCallOutputItemTypeFunctionCallOutput", - "FunctionCallOutputItemTypeInputImage", "FunctionCallOutputItemTypedDict", "FusionAnalysisResult", "FusionAnalysisResultTypedDict", @@ -4477,9 +4536,10 @@ "OutputBrowserUseServerToolItemType", "OutputBrowserUseServerToolItemTypedDict", "OutputCodeInterpreterCallItem", - "OutputCodeInterpreterCallItemOutputUnion", - "OutputCodeInterpreterCallItemOutputUnionTypedDict", - "OutputCodeInterpreterCallItemTypeImage", + "OutputCodeInterpreterCallItemOutput", + "OutputCodeInterpreterCallItemOutputTypedDict", + "OutputCodeInterpreterCallItemStatus", + "OutputCodeInterpreterCallItemType", "OutputCodeInterpreterCallItemTypedDict", "OutputCodeInterpreterServerToolItem", "OutputCodeInterpreterServerToolItemType", @@ -4514,21 +4574,17 @@ "OutputFusionServerToolItem", "OutputFusionServerToolItemType", "OutputFusionServerToolItemTypedDict", - "OutputImage", "OutputImageGenerationCallItem", "OutputImageGenerationCallItemType", "OutputImageGenerationCallItemTypedDict", "OutputImageGenerationServerToolItem", "OutputImageGenerationServerToolItemType", "OutputImageGenerationServerToolItemTypedDict", - "OutputImageTypedDict", "OutputItemImageGenerationCall", "OutputItemImageGenerationCallType", "OutputItemImageGenerationCallTypedDict", "OutputItems", "OutputItemsTypedDict", - "OutputLogs", - "OutputLogsTypedDict", "OutputMcpServerToolItem", "OutputMcpServerToolItemType", "OutputMcpServerToolItemTypedDict", @@ -5062,7 +5118,6 @@ "TypeClearThinking20251015", "TypeClearToolUses20250919", "TypeCodeInterpreter", - "TypeCodeInterpreterCall", "TypeCompact20260112", "TypeDisabled", "TypeDocument", @@ -5073,7 +5128,6 @@ "TypeFileSearch", "TypeFindInPage", "TypeLocalShellCall", - "TypeLogs", "TypeNone", "TypeOpenPage", "TypeRedactedThinking", @@ -5141,7 +5195,7 @@ "UnknownOpenAIResponsesAnnotation", "UnknownOpenResponsesResultToolUnion", "UnknownOutcome", - "UnknownOutputCodeInterpreterCallItemOutputUnion", + "UnknownOutputCodeInterpreterCallItemOutput", "UnknownOutputItems", "UnknownOutputMessageContent", "UnknownOutputMessageItemContent", @@ -5717,6 +5771,30 @@ "ChatWebSearchShorthand": ".chatwebsearchshorthand", "ChatWebSearchShorthandType": ".chatwebsearchshorthand", "ChatWebSearchShorthandTypedDict": ".chatwebsearchshorthand", + "CodeInterpreterCallCodeDeltaEvent": ".codeinterpretercallcodedeltaevent", + "CodeInterpreterCallCodeDeltaEventType": ".codeinterpretercallcodedeltaevent", + "CodeInterpreterCallCodeDeltaEventTypedDict": ".codeinterpretercallcodedeltaevent", + "CodeInterpreterCallCodeDoneEvent": ".codeinterpretercallcodedoneevent", + "CodeInterpreterCallCodeDoneEventType": ".codeinterpretercallcodedoneevent", + "CodeInterpreterCallCodeDoneEventTypedDict": ".codeinterpretercallcodedoneevent", + "CodeInterpreterCallCompletedEvent": ".codeinterpretercallcompletedevent", + "CodeInterpreterCallCompletedEventType": ".codeinterpretercallcompletedevent", + "CodeInterpreterCallCompletedEventTypedDict": ".codeinterpretercallcompletedevent", + "CodeInterpreterCallInProgressEvent": ".codeinterpretercallinprogressevent", + "CodeInterpreterCallInProgressEventType": ".codeinterpretercallinprogressevent", + "CodeInterpreterCallInProgressEventTypedDict": ".codeinterpretercallinprogressevent", + "CodeInterpreterCallInterpretingEvent": ".codeinterpretercallinterpretingevent", + "CodeInterpreterCallInterpretingEventType": ".codeinterpretercallinterpretingevent", + "CodeInterpreterCallInterpretingEventTypedDict": ".codeinterpretercallinterpretingevent", + "CodeInterpreterFileOutput": ".codeinterpreterfileoutput", + "CodeInterpreterFileOutputType": ".codeinterpreterfileoutput", + "CodeInterpreterFileOutputTypedDict": ".codeinterpreterfileoutput", + "CodeInterpreterImageOutput": ".codeinterpreterimageoutput", + "CodeInterpreterImageOutputType": ".codeinterpreterimageoutput", + "CodeInterpreterImageOutputTypedDict": ".codeinterpreterimageoutput", + "CodeInterpreterLogsOutput": ".codeinterpreterlogsoutput", + "CodeInterpreterLogsOutputType": ".codeinterpreterlogsoutput", + "CodeInterpreterLogsOutputTypedDict": ".codeinterpreterlogsoutput", "CodeInterpreterServerTool": ".codeinterpreterservertool", "CodeInterpreterServerToolTypedDict": ".codeinterpreterservertool", "Container": ".codeinterpreterservertool", @@ -5851,12 +5929,12 @@ "CustomToolCallOutputItemDetail": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputInputImage": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputInputImageTypedDict": ".customtoolcalloutputitem", + "CustomToolCallOutputItemOutputType": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputUnion1": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputUnion1TypedDict": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputUnion2": ".customtoolcalloutputitem", "CustomToolCallOutputItemOutputUnion2TypedDict": ".customtoolcalloutputitem", "CustomToolCallOutputItemTypeCustomToolCallOutput": ".customtoolcalloutputitem", - "CustomToolCallOutputItemTypeInputImage": ".customtoolcalloutputitem", "CustomToolCallOutputItemTypedDict": ".customtoolcalloutputitem", "DABenchmarkEntry": ".dabenchmarkentry", "DABenchmarkEntryTypedDict": ".dabenchmarkentry", @@ -5993,12 +6071,12 @@ "FunctionCallOutputItemDetail": ".functioncalloutputitem", "FunctionCallOutputItemOutputInputImage": ".functioncalloutputitem", "FunctionCallOutputItemOutputInputImageTypedDict": ".functioncalloutputitem", + "FunctionCallOutputItemOutputType": ".functioncalloutputitem", "FunctionCallOutputItemOutputUnion1": ".functioncalloutputitem", "FunctionCallOutputItemOutputUnion1TypedDict": ".functioncalloutputitem", "FunctionCallOutputItemOutputUnion2": ".functioncalloutputitem", "FunctionCallOutputItemOutputUnion2TypedDict": ".functioncalloutputitem", "FunctionCallOutputItemTypeFunctionCallOutput": ".functioncalloutputitem", - "FunctionCallOutputItemTypeInputImage": ".functioncalloutputitem", "FunctionCallOutputItemTypedDict": ".functioncalloutputitem", "Contradiction": ".fusionanalysisresult", "ContradictionTypedDict": ".fusionanalysisresult", @@ -6808,17 +6886,12 @@ "OutputBrowserUseServerToolItemType": ".outputbrowseruseservertoolitem", "OutputBrowserUseServerToolItemTypedDict": ".outputbrowseruseservertoolitem", "OutputCodeInterpreterCallItem": ".outputcodeinterpretercallitem", - "OutputCodeInterpreterCallItemOutputUnion": ".outputcodeinterpretercallitem", - "OutputCodeInterpreterCallItemOutputUnionTypedDict": ".outputcodeinterpretercallitem", - "OutputCodeInterpreterCallItemTypeImage": ".outputcodeinterpretercallitem", + "OutputCodeInterpreterCallItemOutput": ".outputcodeinterpretercallitem", + "OutputCodeInterpreterCallItemOutputTypedDict": ".outputcodeinterpretercallitem", + "OutputCodeInterpreterCallItemStatus": ".outputcodeinterpretercallitem", + "OutputCodeInterpreterCallItemType": ".outputcodeinterpretercallitem", "OutputCodeInterpreterCallItemTypedDict": ".outputcodeinterpretercallitem", - "OutputImage": ".outputcodeinterpretercallitem", - "OutputImageTypedDict": ".outputcodeinterpretercallitem", - "OutputLogs": ".outputcodeinterpretercallitem", - "OutputLogsTypedDict": ".outputcodeinterpretercallitem", - "TypeCodeInterpreterCall": ".outputcodeinterpretercallitem", - "TypeLogs": ".outputcodeinterpretercallitem", - "UnknownOutputCodeInterpreterCallItemOutputUnion": ".outputcodeinterpretercallitem", + "UnknownOutputCodeInterpreterCallItemOutput": ".outputcodeinterpretercallitem", "OutputCodeInterpreterServerToolItem": ".outputcodeinterpreterservertoolitem", "OutputCodeInterpreterServerToolItemType": ".outputcodeinterpreterservertoolitem", "OutputCodeInterpreterServerToolItemTypedDict": ".outputcodeinterpreterservertoolitem", diff --git a/src/openrouter/components/codeinterpretercallcodedeltaevent.py b/src/openrouter/components/codeinterpretercallcodedeltaevent.py new file mode 100644 index 00000000..e3c2f4ba --- /dev/null +++ b/src/openrouter/components/codeinterpretercallcodedeltaevent.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterCallCodeDeltaEventType = Literal[ + "response.code_interpreter_call_code.delta", +] + + +class CodeInterpreterCallCodeDeltaEventTypedDict(TypedDict): + r"""Incremental chunk of code being streamed for a `code_interpreter_call`.""" + + delta: str + item_id: str + output_index: int + sequence_number: int + type: CodeInterpreterCallCodeDeltaEventType + + +class CodeInterpreterCallCodeDeltaEvent(BaseModel): + r"""Incremental chunk of code being streamed for a `code_interpreter_call`.""" + + delta: str + + item_id: str + + output_index: int + + sequence_number: int + + type: CodeInterpreterCallCodeDeltaEventType diff --git a/src/openrouter/components/codeinterpretercallcodedoneevent.py b/src/openrouter/components/codeinterpretercallcodedoneevent.py new file mode 100644 index 00000000..1061ea32 --- /dev/null +++ b/src/openrouter/components/codeinterpretercallcodedoneevent.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterCallCodeDoneEventType = Literal[ + "response.code_interpreter_call_code.done", +] + + +class CodeInterpreterCallCodeDoneEventTypedDict(TypedDict): + r"""Emitted when code streaming completes for a `code_interpreter_call`.""" + + code: str + item_id: str + output_index: int + sequence_number: int + type: CodeInterpreterCallCodeDoneEventType + + +class CodeInterpreterCallCodeDoneEvent(BaseModel): + r"""Emitted when code streaming completes for a `code_interpreter_call`.""" + + code: str + + item_id: str + + output_index: int + + sequence_number: int + + type: CodeInterpreterCallCodeDoneEventType diff --git a/src/openrouter/components/codeinterpretercallcompletedevent.py b/src/openrouter/components/codeinterpretercallcompletedevent.py new file mode 100644 index 00000000..3ebe5077 --- /dev/null +++ b/src/openrouter/components/codeinterpretercallcompletedevent.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterCallCompletedEventType = Literal[ + "response.code_interpreter_call.completed", +] + + +class CodeInterpreterCallCompletedEventTypedDict(TypedDict): + r"""Code interpreter call completed""" + + item_id: str + output_index: int + sequence_number: int + type: CodeInterpreterCallCompletedEventType + + +class CodeInterpreterCallCompletedEvent(BaseModel): + r"""Code interpreter call completed""" + + item_id: str + + output_index: int + + sequence_number: int + + type: CodeInterpreterCallCompletedEventType diff --git a/src/openrouter/components/codeinterpretercallinprogressevent.py b/src/openrouter/components/codeinterpretercallinprogressevent.py new file mode 100644 index 00000000..cf6578f4 --- /dev/null +++ b/src/openrouter/components/codeinterpretercallinprogressevent.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterCallInProgressEventType = Literal[ + "response.code_interpreter_call.in_progress", +] + + +class CodeInterpreterCallInProgressEventTypedDict(TypedDict): + r"""Code interpreter call in progress""" + + item_id: str + output_index: int + sequence_number: int + type: CodeInterpreterCallInProgressEventType + + +class CodeInterpreterCallInProgressEvent(BaseModel): + r"""Code interpreter call in progress""" + + item_id: str + + output_index: int + + sequence_number: int + + type: CodeInterpreterCallInProgressEventType diff --git a/src/openrouter/components/codeinterpretercallinterpretingevent.py b/src/openrouter/components/codeinterpretercallinterpretingevent.py new file mode 100644 index 00000000..b8619642 --- /dev/null +++ b/src/openrouter/components/codeinterpretercallinterpretingevent.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterCallInterpretingEventType = Literal[ + "response.code_interpreter_call.interpreting", +] + + +class CodeInterpreterCallInterpretingEventTypedDict(TypedDict): + r"""Code interpreter is executing the code""" + + item_id: str + output_index: int + sequence_number: int + type: CodeInterpreterCallInterpretingEventType + + +class CodeInterpreterCallInterpretingEvent(BaseModel): + r"""Code interpreter is executing the code""" + + item_id: str + + output_index: int + + sequence_number: int + + type: CodeInterpreterCallInterpretingEventType diff --git a/src/openrouter/components/codeinterpreterfileoutput.py b/src/openrouter/components/codeinterpreterfileoutput.py new file mode 100644 index 00000000..f0946655 --- /dev/null +++ b/src/openrouter/components/codeinterpreterfileoutput.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Literal, Optional +from typing_extensions import NotRequired, TypedDict + + +CodeInterpreterFileOutputType = Literal["file",] + + +class CodeInterpreterFileOutputTypedDict(TypedDict): + type: CodeInterpreterFileOutputType + download_url: NotRequired[str] + r"""Provider-issued download URL for the generated file. Typically signed and time-limited (see `expires_at`); fetch promptly rather than persisting the URL.""" + error_code: NotRequired[Nullable[str]] + r"""Provider error code when generating or persisting the file failed; null or absent on success.""" + expires_at: NotRequired[str] + r"""When the `download_url` stops working, as an ISO 8601 timestamp. After this time the file must be regenerated.""" + filename: NotRequired[str] + id: NotRequired[str] + media_type: NotRequired[str] + sha256: NotRequired[str] + size_bytes: NotRequired[int] + status: NotRequired[str] + r"""Provider-reported readiness of the generated file (e.g. `ready`). Values other than `ready` indicate the artifact may not be downloadable.""" + + +class CodeInterpreterFileOutput(BaseModel): + type: CodeInterpreterFileOutputType + + download_url: Optional[str] = None + r"""Provider-issued download URL for the generated file. Typically signed and time-limited (see `expires_at`); fetch promptly rather than persisting the URL.""" + + error_code: OptionalNullable[str] = UNSET + r"""Provider error code when generating or persisting the file failed; null or absent on success.""" + + expires_at: Optional[str] = None + r"""When the `download_url` stops working, as an ISO 8601 timestamp. After this time the file must be regenerated.""" + + filename: Optional[str] = None + + id: Optional[str] = None + + media_type: Optional[str] = None + + sha256: Optional[str] = None + + size_bytes: Optional[int] = None + + status: Optional[str] = None + r"""Provider-reported readiness of the generated file (e.g. `ready`). Values other than `ready` indicate the artifact may not be downloadable.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set( + [ + "download_url", + "error_code", + "expires_at", + "filename", + "id", + "media_type", + "sha256", + "size_bytes", + "status", + ] + ) + nullable_fields = set(["error_code"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m diff --git a/src/openrouter/components/codeinterpreterimageoutput.py b/src/openrouter/components/codeinterpreterimageoutput.py new file mode 100644 index 00000000..5440fe74 --- /dev/null +++ b/src/openrouter/components/codeinterpreterimageoutput.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterImageOutputType = Literal["image",] + + +class CodeInterpreterImageOutputTypedDict(TypedDict): + type: CodeInterpreterImageOutputType + url: str + + +class CodeInterpreterImageOutput(BaseModel): + type: CodeInterpreterImageOutputType + + url: str diff --git a/src/openrouter/components/codeinterpreterlogsoutput.py b/src/openrouter/components/codeinterpreterlogsoutput.py new file mode 100644 index 00000000..113b249f --- /dev/null +++ b/src/openrouter/components/codeinterpreterlogsoutput.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from openrouter.types import BaseModel +from typing import Literal +from typing_extensions import TypedDict + + +CodeInterpreterLogsOutputType = Literal["logs",] + + +class CodeInterpreterLogsOutputTypedDict(TypedDict): + logs: str + type: CodeInterpreterLogsOutputType + + +class CodeInterpreterLogsOutput(BaseModel): + logs: str + + type: CodeInterpreterLogsOutputType diff --git a/src/openrouter/components/customtoolcalloutputitem.py b/src/openrouter/components/customtoolcalloutputitem.py index b80b24da..f6c97dc2 100644 --- a/src/openrouter/components/customtoolcalloutputitem.py +++ b/src/openrouter/components/customtoolcalloutputitem.py @@ -28,14 +28,14 @@ ] -CustomToolCallOutputItemTypeInputImage = Literal["input_image",] +CustomToolCallOutputItemOutputType = Literal["input_image",] class CustomToolCallOutputItemOutputInputImageTypedDict(TypedDict): r"""Image input content item""" detail: CustomToolCallOutputItemDetail - type: CustomToolCallOutputItemTypeInputImage + type: CustomToolCallOutputItemOutputType image_url: NotRequired[Nullable[str]] @@ -44,7 +44,7 @@ class CustomToolCallOutputItemOutputInputImage(BaseModel): detail: CustomToolCallOutputItemDetail - type: CustomToolCallOutputItemTypeInputImage + type: CustomToolCallOutputItemOutputType image_url: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/functioncalloutputitem.py b/src/openrouter/components/functioncalloutputitem.py index 5a290e0b..bbae4079 100644 --- a/src/openrouter/components/functioncalloutputitem.py +++ b/src/openrouter/components/functioncalloutputitem.py @@ -29,14 +29,14 @@ ] -FunctionCallOutputItemTypeInputImage = Literal["input_image",] +FunctionCallOutputItemOutputType = Literal["input_image",] class FunctionCallOutputItemOutputInputImageTypedDict(TypedDict): r"""Image input content item""" detail: FunctionCallOutputItemDetail - type: FunctionCallOutputItemTypeInputImage + type: FunctionCallOutputItemOutputType image_url: NotRequired[Nullable[str]] @@ -45,7 +45,7 @@ class FunctionCallOutputItemOutputInputImage(BaseModel): detail: FunctionCallOutputItemDetail - type: FunctionCallOutputItemTypeInputImage + type: FunctionCallOutputItemOutputType image_url: OptionalNullable[str] = UNSET diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py index 636485de..82a4055f 100644 --- a/src/openrouter/components/inputs_union.py +++ b/src/openrouter/components/inputs_union.py @@ -376,53 +376,53 @@ def serialize_model(self, handler): "InputsUnion1TypedDict", Union[ ItemReferenceItemTypedDict, - CompactionItemTypedDict, + OutputFileSearchCallItemTypedDict, + EasyInputMessageTypedDict, InputMessageItemTypedDict, AdditionalToolsItemTypedDict, - EasyInputMessageTypedDict, ContextCompactionItemTypedDict, - OutputWebSearchServerToolItemTypedDict, + CompactionItemTypedDict, CustomToolCallOutputItemTypedDict, LocalShellCallOutputItemTypedDict, OutputToolSearchServerToolItemTypedDict, OutputFileSearchServerToolItemTypedDict, - OutputWebSearchCallItemTypedDict, - OutputFileSearchCallItemTypedDict, + OutputWebSearchServerToolItemTypedDict, OutputApplyPatchServerToolItemTypedDict, - OutputMcpServerToolItemTypedDict, - ApplyPatchCallItemTypedDict, - OutputDatetimeItemTypedDict, OutputImageGenerationCallItemTypedDict, - ApplyPatchCallOutputItemTypedDict, - McpApprovalResponseItemTypedDict, - McpApprovalRequestItemTypedDict, - OutputBrowserUseServerToolItemTypedDict, McpListToolsItemTypedDict, - OutputTextEditorServerToolItemTypedDict, + McpApprovalResponseItemTypedDict, + OutputDatetimeItemTypedDict, + OutputWebSearchCallItemTypedDict, LocalShellCallItemTypedDict, + McpApprovalRequestItemTypedDict, OutputSearchModelsServerToolItemTypedDict, + OutputBrowserUseServerToolItemTypedDict, FunctionCallOutputItemTypedDict, - OutputCodeInterpreterCallItemTypedDict, - OutputCustomToolCallItemTypedDict, - OutputComputerCallItemTypedDict, + OutputTextEditorServerToolItemTypedDict, + ApplyPatchCallItemTypedDict, + ApplyPatchCallOutputItemTypedDict, + OutputMcpServerToolItemTypedDict, + OutputMemoryServerToolItemTypedDict, InputsMessageTypedDict, + OutputCustomToolCallItemTypedDict, CustomToolCallItemTypedDict, - OutputMemoryServerToolItemTypedDict, - ShellCallOutputItemTypedDict, + OutputComputerCallItemTypedDict, ShellCallItemTypedDict, + ShellCallOutputItemTypedDict, + OutputFunctionCallItemTypedDict, FunctionCallItemTypedDict, McpCallItemTypedDict, AgentMessageItemTypedDict, - OutputFunctionCallItemTypedDict, + OutputCodeInterpreterCallItemTypedDict, + OutputAdvisorServerToolItemTypedDict, InputsReasoningTypedDict, - ReasoningItemTypedDict, OutputFilesServerToolItemTypedDict, - OutputAdvisorServerToolItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, OutputWebFetchServerToolItemTypedDict, + ReasoningItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, OutputCodeInterpreterServerToolItemTypedDict, - OutputBashServerToolItemTypedDict, OutputFusionServerToolItemTypedDict, + OutputBashServerToolItemTypedDict, OutputSubagentServerToolItemTypedDict, ], ) @@ -432,53 +432,53 @@ def serialize_model(self, handler): "InputsUnion1", Union[ ItemReferenceItem, - CompactionItem, + OutputFileSearchCallItem, + EasyInputMessage, InputMessageItem, AdditionalToolsItem, - EasyInputMessage, ContextCompactionItem, - OutputWebSearchServerToolItem, + CompactionItem, CustomToolCallOutputItem, LocalShellCallOutputItem, OutputToolSearchServerToolItem, OutputFileSearchServerToolItem, - OutputWebSearchCallItem, - OutputFileSearchCallItem, + OutputWebSearchServerToolItem, OutputApplyPatchServerToolItem, - OutputMcpServerToolItem, - ApplyPatchCallItem, - OutputDatetimeItem, OutputImageGenerationCallItem, - ApplyPatchCallOutputItem, - McpApprovalResponseItem, - McpApprovalRequestItem, - OutputBrowserUseServerToolItem, McpListToolsItem, - OutputTextEditorServerToolItem, + McpApprovalResponseItem, + OutputDatetimeItem, + OutputWebSearchCallItem, LocalShellCallItem, + McpApprovalRequestItem, OutputSearchModelsServerToolItem, + OutputBrowserUseServerToolItem, FunctionCallOutputItem, - OutputCodeInterpreterCallItem, - OutputCustomToolCallItem, - OutputComputerCallItem, + OutputTextEditorServerToolItem, + ApplyPatchCallItem, + ApplyPatchCallOutputItem, + OutputMcpServerToolItem, + OutputMemoryServerToolItem, InputsMessage, + OutputCustomToolCallItem, CustomToolCallItem, - OutputMemoryServerToolItem, - ShellCallOutputItem, + OutputComputerCallItem, ShellCallItem, + ShellCallOutputItem, + OutputFunctionCallItem, FunctionCallItem, McpCallItem, AgentMessageItem, - OutputFunctionCallItem, + OutputCodeInterpreterCallItem, + OutputAdvisorServerToolItem, InputsReasoning, - ReasoningItem, OutputFilesServerToolItem, - OutputAdvisorServerToolItem, - OutputImageGenerationServerToolItem, OutputWebFetchServerToolItem, + ReasoningItem, + OutputImageGenerationServerToolItem, OutputCodeInterpreterServerToolItem, - OutputBashServerToolItem, OutputFusionServerToolItem, + OutputBashServerToolItem, OutputSubagentServerToolItem, ], ) diff --git a/src/openrouter/components/outputcodeinterpretercallitem.py b/src/openrouter/components/outputcodeinterpretercallitem.py index cdf3d63b..2a05974f 100644 --- a/src/openrouter/components/outputcodeinterpretercallitem.py +++ b/src/openrouter/components/outputcodeinterpretercallitem.py @@ -1,52 +1,47 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from .toolcallstatus import ToolCallStatus +from .codeinterpreterfileoutput import ( + CodeInterpreterFileOutput, + CodeInterpreterFileOutputTypedDict, +) +from .codeinterpreterimageoutput import ( + CodeInterpreterImageOutput, + CodeInterpreterImageOutputTypedDict, +) +from .codeinterpreterlogsoutput import ( + CodeInterpreterLogsOutput, + CodeInterpreterLogsOutputTypedDict, +) from functools import partial -from openrouter.types import BaseModel, Nullable, UNSET_SENTINEL +from openrouter.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, + UnrecognizedStr, +) from openrouter.utils.unions import parse_open_union +import pydantic from pydantic import ConfigDict, model_serializer from pydantic.functional_validators import BeforeValidator -from typing import Any, List, Literal, Union -from typing_extensions import Annotated, TypeAliasType, TypedDict - - -TypeLogs = Literal["logs",] - - -class OutputLogsTypedDict(TypedDict): - logs: str - type: TypeLogs - - -class OutputLogs(BaseModel): - logs: str - - type: TypeLogs - - -OutputCodeInterpreterCallItemTypeImage = Literal["image",] +from typing import Any, Dict, List, Literal, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -class OutputImageTypedDict(TypedDict): - type: OutputCodeInterpreterCallItemTypeImage - url: str - - -class OutputImage(BaseModel): - type: OutputCodeInterpreterCallItemTypeImage - - url: str - - -OutputCodeInterpreterCallItemOutputUnionTypedDict = TypeAliasType( - "OutputCodeInterpreterCallItemOutputUnionTypedDict", - Union[OutputImageTypedDict, OutputLogsTypedDict], +OutputCodeInterpreterCallItemOutputTypedDict = TypeAliasType( + "OutputCodeInterpreterCallItemOutputTypedDict", + Union[ + CodeInterpreterLogsOutputTypedDict, + CodeInterpreterImageOutputTypedDict, + CodeInterpreterFileOutputTypedDict, + ], ) -class UnknownOutputCodeInterpreterCallItemOutputUnion(BaseModel): - r"""A OutputCodeInterpreterCallItemOutputUnion variant the SDK doesn't recognize. Preserves the raw payload.""" +class UnknownOutputCodeInterpreterCallItemOutput(BaseModel): + r"""A OutputCodeInterpreterCallItemOutput variant the SDK doesn't recognize. Preserves the raw payload.""" type: Literal["UNKNOWN"] = "UNKNOWN" raw: Any @@ -55,65 +50,110 @@ class UnknownOutputCodeInterpreterCallItemOutputUnion(BaseModel): model_config = ConfigDict(frozen=True) -_OUTPUT_CODE_INTERPRETER_CALL_ITEM_OUTPUT_UNION_VARIANTS: dict[str, Any] = { - "image": OutputImage, - "logs": OutputLogs, +_OUTPUT_CODE_INTERPRETER_CALL_ITEM_OUTPUT_VARIANTS: dict[str, Any] = { + "file": CodeInterpreterFileOutput, + "image": CodeInterpreterImageOutput, + "logs": CodeInterpreterLogsOutput, } -OutputCodeInterpreterCallItemOutputUnion = Annotated[ - Union[OutputImage, OutputLogs, UnknownOutputCodeInterpreterCallItemOutputUnion], +OutputCodeInterpreterCallItemOutput = Annotated[ + Union[ + CodeInterpreterFileOutput, + CodeInterpreterImageOutput, + CodeInterpreterLogsOutput, + UnknownOutputCodeInterpreterCallItemOutput, + ], BeforeValidator( partial( parse_open_union, disc_key="type", - variants=_OUTPUT_CODE_INTERPRETER_CALL_ITEM_OUTPUT_UNION_VARIANTS, - unknown_cls=UnknownOutputCodeInterpreterCallItemOutputUnion, - union_name="OutputCodeInterpreterCallItemOutputUnion", + variants=_OUTPUT_CODE_INTERPRETER_CALL_ITEM_OUTPUT_VARIANTS, + unknown_cls=UnknownOutputCodeInterpreterCallItemOutput, + union_name="OutputCodeInterpreterCallItemOutput", ) ), ] -TypeCodeInterpreterCall = Literal["code_interpreter_call",] +OutputCodeInterpreterCallItemStatus = Union[ + Literal[ + "in_progress", + "completed", + "incomplete", + "interpreting", + "failed", + ], + UnrecognizedStr, +] + + +OutputCodeInterpreterCallItemType = Literal["code_interpreter_call",] class OutputCodeInterpreterCallItemTypedDict(TypedDict): r"""A code interpreter execution call with outputs""" - code: Nullable[str] - container_id: str id: str - outputs: Nullable[List[OutputCodeInterpreterCallItemOutputUnionTypedDict]] - status: ToolCallStatus - type: TypeCodeInterpreterCall + status: OutputCodeInterpreterCallItemStatus + type: OutputCodeInterpreterCallItemType + code: NotRequired[Nullable[str]] + container_id: NotRequired[str] + outputs: NotRequired[Nullable[List[OutputCodeInterpreterCallItemOutputTypedDict]]] class OutputCodeInterpreterCallItem(BaseModel): r"""A code interpreter execution call with outputs""" - code: Nullable[str] - - container_id: str + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) id: str - outputs: Nullable[List[OutputCodeInterpreterCallItemOutputUnion]] + status: OutputCodeInterpreterCallItemStatus + + type: OutputCodeInterpreterCallItemType + + code: OptionalNullable[str] = UNSET + + container_id: Optional[str] = None + + outputs: OptionalNullable[List[OutputCodeInterpreterCallItemOutput]] = UNSET - status: ToolCallStatus + @property + def additional_properties(self): + return self.__pydantic_extra__ - type: TypeCodeInterpreterCall + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] @model_serializer(mode="wrap") def serialize_model(self, handler): + optional_fields = set(["code", "container_id", "outputs"]) + nullable_fields = set(["code", "outputs"]) serialized = handler(self) m = {} for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) if val != UNSET_SENTINEL: - m[k] = val + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + for k, v in serialized.items(): + m[k] = v return m diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py index 18c57e57..e636dee6 100644 --- a/src/openrouter/components/outputitems.py +++ b/src/openrouter/components/outputitems.py @@ -121,26 +121,26 @@ OutputItemsTypedDict = TypeAliasType( "OutputItemsTypedDict", Union[ - OutputToolSearchServerToolItemTypedDict, OutputWebSearchServerToolItemTypedDict, - OutputFileSearchServerToolItemTypedDict, - OutputWebSearchCallItemTypedDict, OutputFileSearchCallItemTypedDict, + OutputFileSearchServerToolItemTypedDict, + OutputToolSearchServerToolItemTypedDict, OutputApplyPatchServerToolItemTypedDict, + OutputImageGenerationCallItemTypedDict, OutputDatetimeItemTypedDict, - OutputTextEditorServerToolItemTypedDict, + OutputWebSearchCallItemTypedDict, OutputSearchModelsServerToolItemTypedDict, - OutputImageGenerationCallItemTypedDict, + OutputTextEditorServerToolItemTypedDict, OutputApplyPatchCallItemTypedDict, OutputMcpServerToolItemTypedDict, OutputShellCallItemTypedDict, OutputBrowserUseServerToolItemTypedDict, OutputComputerCallItemTypedDict, - OutputCodeInterpreterCallItemTypedDict, + OutputShellCallOutputItemTypedDict, OutputCustomToolCallItemTypedDict, OutputMemoryServerToolItemTypedDict, OutputMessageItemTypedDict, - OutputShellCallOutputItemTypedDict, + OutputCodeInterpreterCallItemTypedDict, OutputFunctionCallItemTypedDict, OutputWebFetchServerToolItemTypedDict, OutputCodeInterpreterServerToolItemTypedDict, diff --git a/src/openrouter/components/outputwebsearchcallitem.py b/src/openrouter/components/outputwebsearchcallitem.py index fd19c842..1bf141f2 100644 --- a/src/openrouter/components/outputwebsearchcallitem.py +++ b/src/openrouter/components/outputwebsearchcallitem.py @@ -12,9 +12,10 @@ UNSET_SENTINEL, ) from openrouter.utils.unions import parse_open_union +import pydantic from pydantic import ConfigDict, model_serializer from pydantic.functional_validators import BeforeValidator -from typing import Any, List, Literal, Optional, Union +from typing import Any, Dict, List, Literal, Optional, Union from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict @@ -167,6 +168,11 @@ class OutputWebSearchCallItemTypedDict(TypedDict): class OutputWebSearchCallItem(BaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, extra="allow" + ) + __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False) + id: str status: WebSearchStatus @@ -175,6 +181,14 @@ class OutputWebSearchCallItem(BaseModel): action: Optional[Action] = None + @property + def additional_properties(self): + return self.__pydantic_extra__ + + @additional_properties.setter + def additional_properties(self, value): + self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride] + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = set(["action"]) @@ -184,9 +198,12 @@ def serialize_model(self, handler): for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k, serialized.get(n)) + serialized.pop(k, serialized.pop(n, None)) if val != UNSET_SENTINEL: if val is not None or k not in optional_fields: m[k] = val + for k, v in serialized.items(): + m[k] = v return m diff --git a/src/openrouter/components/streamevents.py b/src/openrouter/components/streamevents.py index 6e69218e..0f44579d 100644 --- a/src/openrouter/components/streamevents.py +++ b/src/openrouter/components/streamevents.py @@ -10,6 +10,26 @@ ApplyPatchCallOperationDiffDoneEvent, ApplyPatchCallOperationDiffDoneEventTypedDict, ) +from .codeinterpretercallcodedeltaevent import ( + CodeInterpreterCallCodeDeltaEvent, + CodeInterpreterCallCodeDeltaEventTypedDict, +) +from .codeinterpretercallcodedoneevent import ( + CodeInterpreterCallCodeDoneEvent, + CodeInterpreterCallCodeDoneEventTypedDict, +) +from .codeinterpretercallcompletedevent import ( + CodeInterpreterCallCompletedEvent, + CodeInterpreterCallCompletedEventTypedDict, +) +from .codeinterpretercallinprogressevent import ( + CodeInterpreterCallInProgressEvent, + CodeInterpreterCallInProgressEventTypedDict, +) +from .codeinterpretercallinterpretingevent import ( + CodeInterpreterCallInterpretingEvent, + CodeInterpreterCallInterpretingEventTypedDict, +) from .contentpartaddedevent import ContentPartAddedEvent, ContentPartAddedEventTypedDict from .contentpartdoneevent import ContentPartDoneEvent, ContentPartDoneEventTypedDict from .customtoolcallinputdeltaevent import ( @@ -156,50 +176,55 @@ StreamEventsTypedDict = TypeAliasType( "StreamEventsTypedDict", Union[ - DebugEventTypedDict, + OpenResponsesCreatedEventTypedDict, OpenResponsesInProgressEventTypedDict, StreamEventsResponseCompletedTypedDict, StreamEventsResponseIncompleteTypedDict, StreamEventsResponseFailedTypedDict, - OpenResponsesCreatedEventTypedDict, - FusionCallInProgressEventTypedDict, - WebSearchCallCompletedEventTypedDict, - StreamEventsResponseOutputItemAddedTypedDict, + DebugEventTypedDict, FusionCallCompletedEventTypedDict, - ImageGenCallInProgressEventTypedDict, StreamEventsResponseOutputItemDoneTypedDict, - ImageGenCallGeneratingEventTypedDict, - ImageGenCallCompletedEventTypedDict, - WebSearchCallInProgressEventTypedDict, + ImageGenCallInProgressEventTypedDict, + FusionCallInProgressEventTypedDict, + StreamEventsResponseOutputItemAddedTypedDict, + WebSearchCallCompletedEventTypedDict, WebSearchCallSearchingEventTypedDict, - FusionCallPanelAddedEventTypedDict, - CustomToolCallInputDeltaEventTypedDict, + WebSearchCallInProgressEventTypedDict, + CodeInterpreterCallCompletedEventTypedDict, + CodeInterpreterCallInterpretingEventTypedDict, + CodeInterpreterCallInProgressEventTypedDict, + ImageGenCallCompletedEventTypedDict, + ImageGenCallGeneratingEventTypedDict, CustomToolCallInputDoneEventTypedDict, - FunctionCallArgsDeltaEventTypedDict, - ApplyPatchCallOperationDiffDeltaEventTypedDict, - ApplyPatchCallOperationDiffDoneEventTypedDict, + CodeInterpreterCallCodeDeltaEventTypedDict, ErrorEventTypedDict, FusionCallAnalysisCompletedEventTypedDict, - ReasoningSummaryTextDoneEventTypedDict, + FusionCallPanelAddedEventTypedDict, + ApplyPatchCallOperationDiffDoneEventTypedDict, + ApplyPatchCallOperationDiffDeltaEventTypedDict, + CustomToolCallInputDeltaEventTypedDict, + CodeInterpreterCallCodeDoneEventTypedDict, + FunctionCallArgsDeltaEventTypedDict, + FusionCallPanelDeltaEventTypedDict, + FusionCallPanelReasoningDeltaEventTypedDict, + FunctionCallArgsDoneEventTypedDict, RefusalDoneEventTypedDict, + RefusalDeltaEventTypedDict, ReasoningSummaryTextDeltaEventTypedDict, - ReasoningSummaryPartDoneEventTypedDict, - ReasoningSummaryPartAddedEventTypedDict, - ReasoningDoneEventTypedDict, ReasoningDeltaEventTypedDict, - FunctionCallArgsDoneEventTypedDict, ContentPartAddedEventTypedDict, ImageGenCallPartialImageEventTypedDict, - RefusalDeltaEventTypedDict, + ReasoningDoneEventTypedDict, ContentPartDoneEventTypedDict, - FusionCallPanelDeltaEventTypedDict, - FusionCallPanelReasoningDeltaEventTypedDict, + ReasoningSummaryPartAddedEventTypedDict, + ReasoningSummaryPartDoneEventTypedDict, + ReasoningSummaryTextDoneEventTypedDict, FusionCallPanelCompletedEventTypedDict, FusionCallAnalysisInProgressEventTypedDict, FusionCallPanelFailedEventTypedDict, + AnnotationAddedEventTypedDict, TextDeltaEventTypedDict, TextDoneEventTypedDict, - AnnotationAddedEventTypedDict, ], ) r"""Union of all possible event types emitted during response streaming""" @@ -219,6 +244,11 @@ class UnknownStreamEvents(BaseModel): "error": ErrorEvent, "response.apply_patch_call_operation_diff.delta": ApplyPatchCallOperationDiffDeltaEvent, "response.apply_patch_call_operation_diff.done": ApplyPatchCallOperationDiffDoneEvent, + "response.code_interpreter_call_code.delta": CodeInterpreterCallCodeDeltaEvent, + "response.code_interpreter_call_code.done": CodeInterpreterCallCodeDoneEvent, + "response.code_interpreter_call.completed": CodeInterpreterCallCompletedEvent, + "response.code_interpreter_call.in_progress": CodeInterpreterCallInProgressEvent, + "response.code_interpreter_call.interpreting": CodeInterpreterCallInterpretingEvent, "response.completed": StreamEventsResponseCompleted, "response.content_part.added": ContentPartAddedEvent, "response.content_part.done": ContentPartDoneEvent, @@ -268,6 +298,11 @@ class UnknownStreamEvents(BaseModel): ErrorEvent, ApplyPatchCallOperationDiffDeltaEvent, ApplyPatchCallOperationDiffDoneEvent, + CodeInterpreterCallCodeDeltaEvent, + CodeInterpreterCallCodeDoneEvent, + CodeInterpreterCallCompletedEvent, + CodeInterpreterCallInProgressEvent, + CodeInterpreterCallInterpretingEvent, StreamEventsResponseCompleted, ContentPartAddedEvent, ContentPartDoneEvent, diff --git a/uv.lock b/uv.lock index 1eb62572..3a820588 100644 --- a/uv.lock +++ b/uv.lock @@ -213,7 +213,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.1.39" +version = "1.1.40" source = { editable = "." } dependencies = [ { name = "httpcore" }, From ba7c97be51017a6789837efd282e7f94062578ce Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Mon, 10 Aug 2026 19:27:13 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow