From 973c809bd3b554c28480ad8a95ac2361c2e4699e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 5 Nov 2026 06:58:12 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Python=20SDK=20Changes:=20*=20`open=5F?= =?UTF-8?q?router.batch.create=5Fbatches()`:=20=20`response.results[].resp?= =?UTF-8?q?onse.body.union(OpenResponsesResult).output[]`=20**Changed**=20?= =?UTF-8?q?(Breaking=20=E2=9A=A0=EF=B8=8F)=20*=20`open=5Frouter.batch.get?= =?UTF-8?q?=5Fbatches()`:=20=20`response.results[].response.body.union(Ope?= =?UTF-8?q?nResponsesResult).output[]`=20**Changed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)=20*=20`open=5Frouter.presets.create=5Fprese?= =?UTF-8?q?ts=5Fresponses()`:=20=20=20*=20=20`request.input.union(Array<>)?= =?UTF-8?q?[].union(OutputMcpServerToolItem)`=20**Removed**=20(Breaking=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 157 ++++++++--- .speakeasy/gen.yaml | 2 +- .speakeasy/out.openapi.yaml | 248 ++++++++++++++++-- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- docs/components/inputsunion1.mdx | 6 - .../components/mcpcallargumentsdeltaevent.mdx | 16 ++ .../mcpcallargumentsdeltaeventtype.mdx | 15 ++ docs/components/mcpcallargumentsdoneevent.mdx | 16 ++ .../mcpcallargumentsdoneeventtype.mdx | 15 ++ docs/components/mcpcallcompletedevent.mdx | 15 ++ docs/components/mcpcallcompletedeventtype.mdx | 15 ++ docs/components/mcpcallfailedevent.mdx | 15 ++ docs/components/mcpcallfailedeventtype.mdx | 15 ++ docs/components/mcpcallinprogressevent.mdx | 15 ++ .../components/mcpcallinprogresseventtype.mdx | 15 ++ .../components/mcplisttoolscompletedevent.mdx | 15 ++ .../mcplisttoolscompletedeventtype.mdx | 15 ++ docs/components/mcplisttoolsfailedevent.mdx | 15 ++ .../mcplisttoolsfailedeventtype.mdx | 15 ++ .../mcplisttoolsinprogressevent.mdx | 15 ++ .../mcplisttoolsinprogresseventtype.mdx | 15 ++ docs/components/outputitems.mdx | 18 +- docs/components/outputmcpservertoolitem.mdx | 16 -- .../outputmcpservertoolitemtype.mdx | 15 -- docs/components/streamevents.mdx | 48 ++++ pyproject.toml | 2 +- src/openrouter/_version.py | 4 +- src/openrouter/components/__init__.py | 99 ++++++- src/openrouter/components/inputs_union.py | 22 +- .../components/mcpcallargumentsdeltaevent.py | 33 +++ .../components/mcpcallargumentsdoneevent.py | 33 +++ .../components/mcpcallcompletedevent.py | 30 +++ .../components/mcpcallfailedevent.py | 30 +++ .../components/mcpcallinprogressevent.py | 30 +++ .../components/mcplisttoolscompletedevent.py | 30 +++ .../components/mcplisttoolsfailedevent.py | 30 +++ .../components/mcplisttoolsinprogressevent.py | 30 +++ src/openrouter/components/outputitems.py | 27 +- .../components/outputmcpservertoolitem.py | 58 ---- src/openrouter/components/streamevents.py | 104 ++++++-- uv.lock | 2 +- 42 files changed, 1097 insertions(+), 241 deletions(-) create mode 100644 docs/components/mcpcallargumentsdeltaevent.mdx create mode 100644 docs/components/mcpcallargumentsdeltaeventtype.mdx create mode 100644 docs/components/mcpcallargumentsdoneevent.mdx create mode 100644 docs/components/mcpcallargumentsdoneeventtype.mdx create mode 100644 docs/components/mcpcallcompletedevent.mdx create mode 100644 docs/components/mcpcallcompletedeventtype.mdx create mode 100644 docs/components/mcpcallfailedevent.mdx create mode 100644 docs/components/mcpcallfailedeventtype.mdx create mode 100644 docs/components/mcpcallinprogressevent.mdx create mode 100644 docs/components/mcpcallinprogresseventtype.mdx create mode 100644 docs/components/mcplisttoolscompletedevent.mdx create mode 100644 docs/components/mcplisttoolscompletedeventtype.mdx create mode 100644 docs/components/mcplisttoolsfailedevent.mdx create mode 100644 docs/components/mcplisttoolsfailedeventtype.mdx create mode 100644 docs/components/mcplisttoolsinprogressevent.mdx create mode 100644 docs/components/mcplisttoolsinprogresseventtype.mdx delete mode 100644 docs/components/outputmcpservertoolitem.mdx delete mode 100644 docs/components/outputmcpservertoolitemtype.mdx create mode 100644 src/openrouter/components/mcpcallargumentsdeltaevent.py create mode 100644 src/openrouter/components/mcpcallargumentsdoneevent.py create mode 100644 src/openrouter/components/mcpcallcompletedevent.py create mode 100644 src/openrouter/components/mcpcallfailedevent.py create mode 100644 src/openrouter/components/mcpcallinprogressevent.py create mode 100644 src/openrouter/components/mcplisttoolscompletedevent.py create mode 100644 src/openrouter/components/mcplisttoolsfailedevent.py create mode 100644 src/openrouter/components/mcplisttoolsinprogressevent.py delete mode 100644 src/openrouter/components/outputmcpservertoolitem.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index aead9db1c..6366865d7 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: 7c0a846ea1ab89558dae0a3b5369daf0 + docChecksum: dcb28c0ea12f18761e71fce94698bcd1 docVersion: 1.0.0 speakeasyVersion: 1.803.2 generationVersion: 2.950.13 - releaseVersion: 1.3.126 - configChecksum: aba2a60d4afb327e561d36366a542163 + releaseVersion: 1.3.127 + configChecksum: 94c6fa81cd1ed5b34c80914c148d9fb8 repoURL: https://github.com/OpenRouterTeam/python-sdk.git installationURL: https://github.com/OpenRouterTeam/python-sdk.git published: true persistentEdits: - generation_id: 4047d64a-f035-41c4-ae4e-4d43d5f22d09 - pristine_commit_hash: 9972b6706161348ad84902f0c450cb62b47142bc - pristine_tree_hash: 757bea65d5316d8852a946dc76573297bc0db331 + generation_id: 670277ca-ddc2-4d83-9716-6fc4adc889af + pristine_commit_hash: 830b541320bb5b9cd70f1ed3bdd0eb1076d95514 + pristine_tree_hash: 978de81dac89fefd1ad7a271360128a4ad8f73dd features: python: acceptHeaders: 3.0.0 @@ -4480,8 +4480,8 @@ trackedFiles: pristine_git_object: 33aee92c61bf7ab9beded4e193f50a2c08462378 docs/components/inputsunion1.mdx: id: c216609d21ce - last_write_checksum: sha1:55ad93fc0525c68b3b5f14ac38bf2f46afea348f - pristine_git_object: fb20a6372f2061f4f7d53687acc411b65f78c218 + last_write_checksum: sha1:88d6b1cc9e8cce59257891c4f23f21e46eb0c722 + pristine_git_object: 15339c96c674a0f91f255b7fde8608c0a7759095 docs/components/inputtext.mdx: id: c8a97322a50a last_write_checksum: sha1:7cebf6a159830481658f474b33c1ee2a27c12e41 @@ -4750,6 +4750,46 @@ trackedFiles: id: e1ada0a7d6f5 last_write_checksum: sha1:7ac26ee40276a37c28fcb7616399f5ec13635d46 pristine_git_object: 4bbaed26edb62e2c671b09348e5fe5f0e8ea4a33 + docs/components/mcpcallargumentsdeltaevent.mdx: + id: 283f96279dcd + last_write_checksum: sha1:65bbdaff94290dfef68bc2b0845f9030bab80bfe + pristine_git_object: 93bb300b989d61dfbb32e519eaadf68073ece674 + docs/components/mcpcallargumentsdeltaeventtype.mdx: + id: b746c6939eba + last_write_checksum: sha1:b26f2f1891f68ac16c790671b76974370ef57a66 + pristine_git_object: 7de1cf7088aefb02f38c1d7b5a1af941463f7f01 + docs/components/mcpcallargumentsdoneevent.mdx: + id: 4aedb36d3fd7 + last_write_checksum: sha1:e3fbaca5d4759ae283dc4325849515a197c92482 + pristine_git_object: a59b441431631854affc8a1c3c52112589c5184a + docs/components/mcpcallargumentsdoneeventtype.mdx: + id: 0a3c6fee5083 + last_write_checksum: sha1:0c50d043176e9c3edecbc0a6db69d537910f1995 + pristine_git_object: faee14bf5a9a5af477f884b5d5813f97ab992e2c + docs/components/mcpcallcompletedevent.mdx: + id: 2dc34aed2e0f + last_write_checksum: sha1:5866d268d9abc9e9a972668c21c21b2b9406046b + pristine_git_object: 555f1d0a3cefe6938fd291f2535a00caf4b670d3 + docs/components/mcpcallcompletedeventtype.mdx: + id: 378c43eda9a1 + last_write_checksum: sha1:e0fb001f2784f77ea97e2cbfbc94eb57b8bfac0c + pristine_git_object: 6916a960bf63c4b02370c7792c95d5202160429c + docs/components/mcpcallfailedevent.mdx: + id: ad0039b94f3d + last_write_checksum: sha1:8df2209c86ec16bcdc9ceb104190d4434ea29401 + pristine_git_object: 1548bb8c70ed99188e91f866c5813e396164aa63 + docs/components/mcpcallfailedeventtype.mdx: + id: b9b8b6a87a65 + last_write_checksum: sha1:b4476b4ce00782bf4f718e7a02d77181788cf7d7 + pristine_git_object: 0750b7a3025f2f8a6cc2738d0ed2d14453326604 + docs/components/mcpcallinprogressevent.mdx: + id: 23a0bd9cd0ce + last_write_checksum: sha1:e52ce0dddd6ba2c75418c1043243fafe854eeda0 + pristine_git_object: 31edc5d5d224ef4a2b0598055f247801a1041be3 + docs/components/mcpcallinprogresseventtype.mdx: + id: db8413142ec6 + last_write_checksum: sha1:2c44729c0c93021a42f87b930373f162f588bf44 + pristine_git_object: 2fe550a4cda295139b08434f60c8f3fc04bbd4e8 docs/components/mcpcallitem.mdx: id: 6b694279da31 last_write_checksum: sha1:c242b263896268f54a4bf4420359e7b7fc2d8417 @@ -4766,6 +4806,30 @@ trackedFiles: id: eb98ab391c2e last_write_checksum: sha1:2faeee3cd6eaf45ed4fdd12ff61919682a29c12d pristine_git_object: dfa1420c3ce7f01f253bfd6c60cf0a234dc6bc58 + docs/components/mcplisttoolscompletedevent.mdx: + id: 2c4ada33f66a + last_write_checksum: sha1:af26b741e1caac9064e2099b0b08acf095235795 + pristine_git_object: d7ec79418eb45a38b314c8ec793ae12662a0e870 + docs/components/mcplisttoolscompletedeventtype.mdx: + id: 8fd555f8b9d1 + last_write_checksum: sha1:7c0af43e0f1230f55cf0ccd2a3f7b7a404d31a7f + pristine_git_object: 0c0baacd523bdcecc64af52882ff08908c33bb4e + docs/components/mcplisttoolsfailedevent.mdx: + id: d8f46d42d91f + last_write_checksum: sha1:05f44216bfa4acebbf60e705083f29f58071a76d + pristine_git_object: 82012348845694e641e92a04a9493fa09b7a9403 + docs/components/mcplisttoolsfailedeventtype.mdx: + id: b4c99d463a8b + last_write_checksum: sha1:7ce9df4cd82fb5fbe3d79135cc0baca2662f3821 + pristine_git_object: f49828e3a482eb3691dfaeeb7c7679b2b31a4878 + docs/components/mcplisttoolsinprogressevent.mdx: + id: 01d8c9fe495e + last_write_checksum: sha1:04729e678b3b61cc38545eea9c3b8c9e6bb4817e + pristine_git_object: e5774ad86a17005eaefa8a9f35a98fadbae9d424 + docs/components/mcplisttoolsinprogresseventtype.mdx: + id: 6018134091d3 + last_write_checksum: sha1:f9d72cc1eb1f58eba50f4d364d85972d98c3a40e + pristine_git_object: f15fd57008fea51a8faed5919963ebe4ddae48ff docs/components/mcplisttoolsitem.mdx: id: 3340f4b5fcbf last_write_checksum: sha1:f4c81e7df2485d74061b91387cc5c911b21be986 @@ -6164,8 +6228,8 @@ trackedFiles: pristine_git_object: 510bb66605a709aea0c2025829cd1b1d1a46e673 docs/components/outputitems.mdx: id: 876e956be23e - last_write_checksum: sha1:ca4e8ebaf09e514d2e17832471e76feb8cd9b3cd - pristine_git_object: 5ade7f32a1e57ad769bcaf3516139ebea0a9004e + last_write_checksum: sha1:f07118635ddb738c3c31664a2feac591493c83d0 + pristine_git_object: f68ca9d3a8cb5d6c6ef918e1e2b6830116b43a10 docs/components/outputitemwebsearchcall.mdx: id: 5a7fc683da6e last_write_checksum: sha1:147e2d8107125a6eeddd5b81e4a80fae22030cb3 @@ -6202,14 +6266,6 @@ trackedFiles: id: d2b8aa1042f6 last_write_checksum: sha1:3abc7411cbca83cd5bb87ae18dc3fb4bfd143a08 pristine_git_object: 9bf8367aa6a8a7503f85af91c3dc6a221e8512e3 - docs/components/outputmcpservertoolitem.mdx: - id: 78e33fe9943f - last_write_checksum: sha1:d7e2862ebff07e901a7656bdaa3c5b850057c63c - pristine_git_object: 6df10a68b3ced7dd61a785281f2cc51745256750 - docs/components/outputmcpservertoolitemtype.mdx: - id: 73eee5101369 - last_write_checksum: sha1:dbd204ff01694d6ecab08faae07aeef5a78cf2a9 - pristine_git_object: b98202d9a57066e51e0a8cffc48f9e909708915c docs/components/outputmemoryservertoolitem.mdx: id: 92da20c0ab0a last_write_checksum: sha1:8048e185a9a1c845cc9a3a932c7b4ce4570261a3 @@ -7636,8 +7692,8 @@ trackedFiles: pristine_git_object: e00173a1ac04508aaa5006a1e3779800f6568bd6 docs/components/streamevents.mdx: id: e9baa20de483 - last_write_checksum: sha1:81d4b89198b631b7514cbe3b29fbedbde654b57d - pristine_git_object: e4f5c12415b7515a10e399ab6b9dd3607048320c + last_write_checksum: sha1:c86c204eac7d46bd8ac133422cdb843af0a83076 + pristine_git_object: ab12eb3060015c517a2c2228d17d198b9551ecf3 docs/components/streameventsresponsecompleted.mdx: id: f7c112325f05 last_write_checksum: sha1:49e6b943b4aaa50c1504cc0494b954c6e123b708 @@ -10828,8 +10884,8 @@ trackedFiles: pristine_git_object: 3e38f1a929f7d6b1d6de74604aa87e3d8f010544 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:f755225952ac4ea194024245a51c03fa87b77225 - pristine_git_object: fb9b6c688addd4e229f88661c5270368e6477b00 + last_write_checksum: sha1:a844bdbd4710dfce805081368f82799aa35e037b + pristine_git_object: 2d6e74e8b1654e5503687af84f6f4f9737803b3d scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:77f44b60b98bc126557ec27391f91dfba764bb54 @@ -10856,8 +10912,8 @@ trackedFiles: pristine_git_object: 86713cfea633e09d33b3d4e65281071fe20e6137 src/openrouter/_version.py: id: d8d15ad6c586 - last_write_checksum: sha1:b6110f361d7c331d22ebbdf41995f080dbc15ee7 - pristine_git_object: cbb70cdf39b7f65876a13cbc0a05587d04f05133 + last_write_checksum: sha1:6d2c2fe86d9f61e7cef851a58e7ee82e20e742d2 + pristine_git_object: 3d34c6fe5db55c9c0321d8ca34aa1c0db58b8d30 src/openrouter/alpha.py: id: 306c4d93308d last_write_checksum: sha1:80cc0f39649445431cc2247ed0e0765438467766 @@ -10904,8 +10960,8 @@ trackedFiles: pristine_git_object: ad3d247954547814054c01989a2dff3d12b3e4e1 src/openrouter/components/__init__.py: id: 81754e97b3f4 - last_write_checksum: sha1:77d26d645188b87e6bca9deb1e375de58c598160 - pristine_git_object: 94487b2834d8a4eb212455fec5b618042e9a1677 + last_write_checksum: sha1:48ad93d96227249948388186cfa57152de6547c2 + pristine_git_object: e9f2addc2139e9b103cb5dcaf7d83716d8c166bb src/openrouter/components/aabenchmarkentry.py: id: e2e0f0b48c82 last_write_checksum: sha1:fab4d9a24d2cea937bb749d46c5f83941e99d65c @@ -12736,8 +12792,8 @@ trackedFiles: pristine_git_object: f499cbbb546232f5cfbfe2c44fb41aefb306c87f src/openrouter/components/inputs_union.py: id: 17d6239cb6a7 - last_write_checksum: sha1:dfe49f1e6c19162682f6fa841ff6d26081a13a21 - pristine_git_object: bea147ee65f20c44bae5de0c758e7f2959ac8b49 + last_write_checksum: sha1:3957ec94f01bb9a31f293f8ae2505d8ac04c88cf + pristine_git_object: 398c4ae99e49fee455c7b6fe262840e8714f217a src/openrouter/components/inputtext.py: id: a995ae96be99 last_write_checksum: sha1:94c720a449e0d5a3f23ee7195f648422f61ac114 @@ -12870,6 +12926,26 @@ trackedFiles: id: b39dfe6b18a0 last_write_checksum: sha1:a10d7a429144da649ca8218295f76f782e0da7a3 pristine_git_object: 75dc3be4f7c24488c28233a5717191a0dcfe538d + src/openrouter/components/mcpcallargumentsdeltaevent.py: + id: 5414da8130c7 + last_write_checksum: sha1:d74cb15a4f042ad923cb67b21dbe89e9bb759116 + pristine_git_object: fe40ea00fa3b4845fcc8572c8b28d2c4088a46b6 + src/openrouter/components/mcpcallargumentsdoneevent.py: + id: dd0e96bc825b + last_write_checksum: sha1:171571ed0180f23f14d3ce5eca87df15296cc6c8 + pristine_git_object: b7dcedaafb5af5c3da6150a2d122733a49f6c7cd + src/openrouter/components/mcpcallcompletedevent.py: + id: 29f48e66ec46 + last_write_checksum: sha1:ebc49fb5414f1578b60293017a5e5dc53c7e48af + pristine_git_object: 86cb370910a3e414f610d699a0641345cde91d6f + src/openrouter/components/mcpcallfailedevent.py: + id: 56578eafbb17 + last_write_checksum: sha1:d190cc9b69aeab4f50529a000439652e626ebbe7 + pristine_git_object: 9af444acbe81420d63e587fde1444d4e274157d6 + src/openrouter/components/mcpcallinprogressevent.py: + id: bc2c6f87dea4 + last_write_checksum: sha1:1231427d8592d123509d83a0eb9a8c17e39d6f14 + pristine_git_object: 16f4b5bce74438805eb145c9726f12383b833273 src/openrouter/components/mcpcallitem.py: id: e56a30943ca4 last_write_checksum: sha1:456d85e5e2816b7523758572e5e6b079025ef72a @@ -12878,6 +12954,18 @@ trackedFiles: id: 1b3869159863 last_write_checksum: sha1:f4048532d0cb6e05bc70ac2c55d9fee41ea83bf9 pristine_git_object: c725a1c24e1ea6e1da09f6ec4e585a851583f1fb + src/openrouter/components/mcplisttoolscompletedevent.py: + id: f5bc35db3a73 + last_write_checksum: sha1:08997534b3dd99dea6cf27cbcdec042fa7f7f5ee + pristine_git_object: be1daf34a0b39ae1031858ea194019408e91f153 + src/openrouter/components/mcplisttoolsfailedevent.py: + id: f8787f2affa7 + last_write_checksum: sha1:69a4ffb752ad6367e0c5491a757631e63a1daab3 + pristine_git_object: e78732c4cfe86508798cbb9e4abce04875c2bab2 + src/openrouter/components/mcplisttoolsinprogressevent.py: + id: 18f64defcdee + last_write_checksum: sha1:7d7151ed9f273aaf8d89922d4e93a746ea7afeee + pristine_git_object: 7959bd5ef013a3f62932b3d79acc5e216eada93b src/openrouter/components/mcplisttoolsitem.py: id: f2dd3ab36ae6 last_write_checksum: sha1:0bc5df5e37f5b0ea220484e409086353a742ab4e @@ -13352,16 +13440,12 @@ trackedFiles: pristine_git_object: 616b0f5112e106777b4c096aeea6fef58ff32020 src/openrouter/components/outputitems.py: id: 90f107de3116 - last_write_checksum: sha1:8e0e487161f75e4d205f490f28520fa2f9a16867 - pristine_git_object: c4933ca3bf16935f1defe8ab2ac29cd5e4448310 + last_write_checksum: sha1:375c8632b321362d5e189a743c012cd4be655c92 + pristine_git_object: 9cadc1da1a6023b0f6dc93b9863641c741bcae94 src/openrouter/components/outputitemwebsearchcall.py: id: bac8732aecb9 last_write_checksum: sha1:00d5b67226d6ff2c6a5497e6e01c764aeede496e pristine_git_object: 90625cac6f95fc7d0ba3b470e695058e4977451a - src/openrouter/components/outputmcpservertoolitem.py: - id: bb8c2536a58e - last_write_checksum: sha1:28d33c9226ff4ce6871457fa1fae384b590f676c - pristine_git_object: 58c21511449abfea7eeb5b667dadcf011b936bdb src/openrouter/components/outputmemoryservertoolitem.py: id: 4b0dc2fc5f41 last_write_checksum: sha1:9f0e9de9562aa7b0909ff7724bf0c5f4ccac7beb @@ -14012,8 +14096,8 @@ trackedFiles: pristine_git_object: a27d8806096c5db215e83fc89b4700ff94d3078f src/openrouter/components/streamevents.py: id: 331636234c76 - last_write_checksum: sha1:00825f6b341d0ec77d8f5488f17e6fb580daab1b - pristine_git_object: 0f44579de3554658650bf89e9cf529ea8e886d03 + last_write_checksum: sha1:7e1a6db744f452171978fbb78e838d43bec6e699 + pristine_git_object: ac2b33099bab8e7b3fbad2d7f55977d2db03ba1c src/openrouter/components/streameventsresponsecompleted.py: id: fd244f61371c last_write_checksum: sha1:011e0930c7994f64dbee78c0a4c2fa5d7167d8ab @@ -19972,3 +20056,4 @@ examples: "500": application/json: {"error": {"code": 500, "message": "Internal Server Error"}} examplesVersion: 1.0.2 +releaseNotes: "## Python SDK Changes:\n* `open_router.batch.create_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[]` **Changed** (Breaking ⚠️)\n* `open_router.batch.get_batches()`: `response.results[].response.body.union(OpenResponsesResult).output[]` **Changed** (Breaking ⚠️)\n* `open_router.presets.create_presets_responses()`: \n * `request.input.union(Array<>)[].union(OutputMcpServerToolItem)` **Removed** (Breaking ⚠️)\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e49417cfc..46cc5ab46 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -37,7 +37,7 @@ generation: documentation: mintlify preApplyUnionDiscriminators: true python: - version: 1.3.126 + version: 1.3.127 additionalDependencies: dev: pytest: '>=8.3' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index a8da032a6..1aab2ceab 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -16472,7 +16472,6 @@ components: - $ref: '#/components/schemas/OutputToolSearchServerToolItem' - $ref: '#/components/schemas/OutputMemoryServerToolItem' - $ref: '#/components/schemas/OutputArmorBlockedItem' - - $ref: '#/components/schemas/OutputMcpServerToolItem' - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' - $ref: '#/components/schemas/OutputFusionServerToolItem' - $ref: '#/components/schemas/OutputAdvisorServerToolItem' @@ -17568,6 +17567,134 @@ components: - 'approval_request_id' - 'approve' type: 'object' + McpCallArgumentsDeltaEvent: + description: 'A partial update to the JSON-encoded arguments of an MCP tool call.' + example: + delta: '{"query":"text-to-image"}' + item_id: 'mcp_abc123' + output_index: 1 + sequence_number: 6 + type: 'response.mcp_call_arguments.delta' + properties: + delta: + type: 'string' + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_call_arguments.delta' + type: 'string' + required: + - 'type' + - 'delta' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpCallArgumentsDoneEvent: + description: 'Emitted when the JSON-encoded arguments of an MCP tool call are finalized.' + example: + arguments: '{"query":"text-to-image"}' + item_id: 'mcp_abc123' + output_index: 1 + sequence_number: 7 + type: 'response.mcp_call_arguments.done' + properties: + arguments: + type: 'string' + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_call_arguments.done' + type: 'string' + required: + - 'type' + - 'arguments' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpCallCompletedEvent: + description: 'Emitted when an MCP tool call completes successfully.' + example: + item_id: 'mcp_abc123' + output_index: 1 + sequence_number: 8 + type: 'response.mcp_call.completed' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_call.completed' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpCallFailedEvent: + description: 'Emitted when an MCP tool call fails.' + example: + item_id: 'mcp_abc123' + output_index: 1 + sequence_number: 8 + type: 'response.mcp_call.failed' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_call.failed' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpCallInProgressEvent: + description: 'Emitted when an MCP tool call begins executing.' + example: + item_id: 'mcp_abc123' + output_index: 1 + sequence_number: 5 + type: 'response.mcp_call.in_progress' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_call.in_progress' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' McpCallItem: description: 'An MCP tool call with its output or error' example: @@ -17623,6 +17750,78 @@ components: - 'code' - 'message' type: 'object' + McpListToolsCompletedEvent: + description: 'Emitted when tool discovery against an MCP server succeeds.' + example: + item_id: 'mcpl_abc123' + output_index: 0 + sequence_number: 2 + type: 'response.mcp_list_tools.completed' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_list_tools.completed' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpListToolsFailedEvent: + description: 'Emitted when tool discovery against an MCP server fails.' + example: + item_id: 'mcpl_abc123' + output_index: 0 + sequence_number: 2 + type: 'response.mcp_list_tools.failed' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_list_tools.failed' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' + McpListToolsInProgressEvent: + description: 'Emitted when tool discovery against an MCP server begins.' + example: + item_id: 'mcpl_abc123' + output_index: 0 + sequence_number: 1 + type: 'response.mcp_list_tools.in_progress' + properties: + item_id: + type: 'string' + output_index: + type: 'integer' + sequence_number: + type: 'integer' + type: + enum: + - 'response.mcp_list_tools.in_progress' + type: 'string' + required: + - 'type' + - 'item_id' + - 'output_index' + - 'sequence_number' + type: 'object' McpListToolsItem: description: 'List of available MCP tools from a server' example: @@ -25549,6 +25748,8 @@ components: file_search_call: '#/components/schemas/OutputFileSearchCallItem' function_call: '#/components/schemas/OutputFunctionCallItem' image_generation_call: '#/components/schemas/OutputImageGenerationCallItem' + mcp_call: '#/components/schemas/McpCallItem' + mcp_list_tools: '#/components/schemas/McpListToolsItem' message: '#/components/schemas/OutputMessageItem' openrouter:advisor: '#/components/schemas/OutputAdvisorServerToolItem' openrouter:apply_patch: '#/components/schemas/OutputApplyPatchServerToolItem' @@ -25562,7 +25763,6 @@ components: openrouter:files: '#/components/schemas/OutputFilesServerToolItem' openrouter:fusion: '#/components/schemas/OutputFusionServerToolItem' openrouter:image_generation: '#/components/schemas/OutputImageGenerationServerToolItem' - openrouter:mcp: '#/components/schemas/OutputMcpServerToolItem' openrouter:memory: '#/components/schemas/OutputMemoryServerToolItem' openrouter:shell: '#/components/schemas/OutputShellServerToolItem' openrouter:subagent: '#/components/schemas/OutputSubagentServerToolItem' @@ -25610,7 +25810,8 @@ components: - $ref: '#/components/schemas/OutputWebFetchServerToolItem' - $ref: '#/components/schemas/OutputToolSearchServerToolItem' - $ref: '#/components/schemas/OutputMemoryServerToolItem' - - $ref: '#/components/schemas/OutputMcpServerToolItem' + - $ref: '#/components/schemas/McpListToolsItem' + - $ref: '#/components/schemas/McpCallItem' - $ref: '#/components/schemas/OutputSearchModelsServerToolItem' - $ref: '#/components/schemas/OutputFusionServerToolItem' - $ref: '#/components/schemas/OutputAdvisorServerToolItem' @@ -25689,31 +25890,6 @@ components: - 'id' - 'status' type: 'object' - OutputMcpServerToolItem: - description: 'An openrouter:mcp server tool output item' - example: - id: 'mcp_tmp_abc123' - serverLabel: 'my-server' - status: 'completed' - toolName: 'get_data' - type: 'openrouter:mcp' - properties: - id: - type: 'string' - serverLabel: - type: 'string' - status: - $ref: '#/components/schemas/ToolCallStatus' - toolName: - type: 'string' - type: - enum: - - 'openrouter:mcp' - type: 'string' - required: - - 'status' - - 'type' - type: 'object' OutputMemoryServerToolItem: description: 'An openrouter:memory server tool output item' example: @@ -31577,6 +31753,14 @@ components: response.image_generation_call.partial_image: '#/components/schemas/ImageGenCallPartialImageEvent' response.in_progress: '#/components/schemas/OpenResponsesInProgressEvent' response.incomplete: '#/components/schemas/StreamEventsResponseIncomplete' + response.mcp_call_arguments.delta: '#/components/schemas/McpCallArgumentsDeltaEvent' + response.mcp_call_arguments.done: '#/components/schemas/McpCallArgumentsDoneEvent' + response.mcp_call.completed: '#/components/schemas/McpCallCompletedEvent' + response.mcp_call.failed: '#/components/schemas/McpCallFailedEvent' + response.mcp_call.in_progress: '#/components/schemas/McpCallInProgressEvent' + response.mcp_list_tools.completed: '#/components/schemas/McpListToolsCompletedEvent' + response.mcp_list_tools.failed: '#/components/schemas/McpListToolsFailedEvent' + response.mcp_list_tools.in_progress: '#/components/schemas/McpListToolsInProgressEvent' response.output_item.added: '#/components/schemas/StreamEventsResponseOutputItemAdded' response.output_item.done: '#/components/schemas/StreamEventsResponseOutputItemDone' response.output_text.annotation.added: '#/components/schemas/AnnotationAddedEvent' @@ -31666,6 +31850,14 @@ components: - $ref: '#/components/schemas/FusionCallAnalysisInProgressEvent' - $ref: '#/components/schemas/FusionCallAnalysisCompletedEvent' - $ref: '#/components/schemas/FusionCallCompletedEvent' + - $ref: '#/components/schemas/McpListToolsInProgressEvent' + - $ref: '#/components/schemas/McpListToolsCompletedEvent' + - $ref: '#/components/schemas/McpListToolsFailedEvent' + - $ref: '#/components/schemas/McpCallInProgressEvent' + - $ref: '#/components/schemas/McpCallArgumentsDeltaEvent' + - $ref: '#/components/schemas/McpCallArgumentsDoneEvent' + - $ref: '#/components/schemas/McpCallCompletedEvent' + - $ref: '#/components/schemas/McpCallFailedEvent' - $ref: '#/components/schemas/DebugEvent' StreamEventsResponseCompleted: allOf: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 22a7f016d..fdaf66608 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.803.2 sources: OpenRouter API: sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0fc27820c0b983fb35f6c4f1bf2915941e232624b24d70ec8733fe6672b97474 - sourceBlobDigest: sha256:dace67550b120fe035eb1e4cf368a21db11d18663fd9ca0799ccb17193c944e9 + sourceRevisionDigest: sha256:acc26b1769652a87388aefe0279de84ffa4566132bebb0b9ab72089539d88302 + sourceBlobDigest: sha256:6c069ebb3d59eb42605f31a3761ba27147972ef47574a54bb1fcd74ae968cafe tags: - latest - 1.0.0 @@ -11,10 +11,10 @@ targets: open-router: source: OpenRouter API sourceNamespace: open-router-chat-completions-api - sourceRevisionDigest: sha256:0fc27820c0b983fb35f6c4f1bf2915941e232624b24d70ec8733fe6672b97474 - sourceBlobDigest: sha256:dace67550b120fe035eb1e4cf368a21db11d18663fd9ca0799ccb17193c944e9 + sourceRevisionDigest: sha256:acc26b1769652a87388aefe0279de84ffa4566132bebb0b9ab72089539d88302 + sourceBlobDigest: sha256:6c069ebb3d59eb42605f31a3761ba27147972ef47574a54bb1fcd74ae968cafe codeSamplesNamespace: open-router-python-code-samples - codeSamplesRevisionDigest: sha256:6d658cc266b6cb091dbff97e1c1eef743f336af1117fd5e772bd7bd2d4e4f202 + codeSamplesRevisionDigest: sha256:15b4eef0e776f06ee52087c14ce8b4dbb186c6ddf151f1423a5dc2dcf887b02c workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.803.2 diff --git a/RELEASES.md b/RELEASES.md index 085a49b4b..74ea2d873 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4029,4 +4029,14 @@ Based on: ### Generated - [python v1.3.126] . ### Releases -- [PyPI v1.3.126] https://pypi.org/project/openrouter/1.3.126 - . \ No newline at end of file +- [PyPI v1.3.126] https://pypi.org/project/openrouter/1.3.126 - . + +## 2026-11-05 06:55:12 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.803.2 (2.950.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v1.3.127] . +### Releases +- [PyPI v1.3.127] https://pypi.org/project/openrouter/1.3.127 - . \ No newline at end of file diff --git a/docs/components/inputsunion1.mdx b/docs/components/inputsunion1.mdx index fb20a6372..15339c96c 100644 --- a/docs/components/inputsunion1.mdx +++ b/docs/components/inputsunion1.mdx @@ -166,12 +166,6 @@ value: components.OutputMemoryServerToolItem = /* values here */ value: components.OutputArmorBlockedItem = /* values here */ ``` -### `components.OutputMcpServerToolItem` - -```python -value: components.OutputMcpServerToolItem = /* values here */ -``` - ### `components.OutputSearchModelsServerToolItem` ```python diff --git a/docs/components/mcpcallargumentsdeltaevent.mdx b/docs/components/mcpcallargumentsdeltaevent.mdx new file mode 100644 index 000000000..93bb300b9 --- /dev/null +++ b/docs/components/mcpcallargumentsdeltaevent.mdx @@ -0,0 +1,16 @@ +--- +title: "McpCallArgumentsDeltaEvent" +--- + +A partial update to the JSON-encoded arguments of an MCP tool call. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `delta` | *str* | ✔️ | N/A | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpCallArgumentsDeltaEventType](../components/mcpcallargumentsdeltaeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcpcallargumentsdeltaeventtype.mdx b/docs/components/mcpcallargumentsdeltaeventtype.mdx new file mode 100644 index 000000000..7de1cf708 --- /dev/null +++ b/docs/components/mcpcallargumentsdeltaeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallArgumentsDeltaEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpCallArgumentsDeltaEventType +value: McpCallArgumentsDeltaEventType = "response.mcp_call_arguments.delta" +``` + + +## Values + +- `"response.mcp_call_arguments.delta"` diff --git a/docs/components/mcpcallargumentsdoneevent.mdx b/docs/components/mcpcallargumentsdoneevent.mdx new file mode 100644 index 000000000..a59b44143 --- /dev/null +++ b/docs/components/mcpcallargumentsdoneevent.mdx @@ -0,0 +1,16 @@ +--- +title: "McpCallArgumentsDoneEvent" +--- + +Emitted when the JSON-encoded arguments of an MCP tool call are finalized. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `arguments` | *str* | ✔️ | N/A | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpCallArgumentsDoneEventType](../components/mcpcallargumentsdoneeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcpcallargumentsdoneeventtype.mdx b/docs/components/mcpcallargumentsdoneeventtype.mdx new file mode 100644 index 000000000..faee14bf5 --- /dev/null +++ b/docs/components/mcpcallargumentsdoneeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallArgumentsDoneEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpCallArgumentsDoneEventType +value: McpCallArgumentsDoneEventType = "response.mcp_call_arguments.done" +``` + + +## Values + +- `"response.mcp_call_arguments.done"` diff --git a/docs/components/mcpcallcompletedevent.mdx b/docs/components/mcpcallcompletedevent.mdx new file mode 100644 index 000000000..555f1d0a3 --- /dev/null +++ b/docs/components/mcpcallcompletedevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallCompletedEvent" +--- + +Emitted when an MCP tool call completes successfully. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpCallCompletedEventType](../components/mcpcallcompletedeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcpcallcompletedeventtype.mdx b/docs/components/mcpcallcompletedeventtype.mdx new file mode 100644 index 000000000..6916a960b --- /dev/null +++ b/docs/components/mcpcallcompletedeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallCompletedEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpCallCompletedEventType +value: McpCallCompletedEventType = "response.mcp_call.completed" +``` + + +## Values + +- `"response.mcp_call.completed"` diff --git a/docs/components/mcpcallfailedevent.mdx b/docs/components/mcpcallfailedevent.mdx new file mode 100644 index 000000000..1548bb8c7 --- /dev/null +++ b/docs/components/mcpcallfailedevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallFailedEvent" +--- + +Emitted when an MCP tool call fails. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpCallFailedEventType](../components/mcpcallfailedeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcpcallfailedeventtype.mdx b/docs/components/mcpcallfailedeventtype.mdx new file mode 100644 index 000000000..0750b7a30 --- /dev/null +++ b/docs/components/mcpcallfailedeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallFailedEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpCallFailedEventType +value: McpCallFailedEventType = "response.mcp_call.failed" +``` + + +## Values + +- `"response.mcp_call.failed"` diff --git a/docs/components/mcpcallinprogressevent.mdx b/docs/components/mcpcallinprogressevent.mdx new file mode 100644 index 000000000..31edc5d5d --- /dev/null +++ b/docs/components/mcpcallinprogressevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallInProgressEvent" +--- + +Emitted when an MCP tool call begins executing. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpCallInProgressEventType](../components/mcpcallinprogresseventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcpcallinprogresseventtype.mdx b/docs/components/mcpcallinprogresseventtype.mdx new file mode 100644 index 000000000..2fe550a4c --- /dev/null +++ b/docs/components/mcpcallinprogresseventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpCallInProgressEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpCallInProgressEventType +value: McpCallInProgressEventType = "response.mcp_call.in_progress" +``` + + +## Values + +- `"response.mcp_call.in_progress"` diff --git a/docs/components/mcplisttoolscompletedevent.mdx b/docs/components/mcplisttoolscompletedevent.mdx new file mode 100644 index 000000000..d7ec79418 --- /dev/null +++ b/docs/components/mcplisttoolscompletedevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsCompletedEvent" +--- + +Emitted when tool discovery against an MCP server succeeds. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpListToolsCompletedEventType](../components/mcplisttoolscompletedeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcplisttoolscompletedeventtype.mdx b/docs/components/mcplisttoolscompletedeventtype.mdx new file mode 100644 index 000000000..0c0baacd5 --- /dev/null +++ b/docs/components/mcplisttoolscompletedeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsCompletedEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpListToolsCompletedEventType +value: McpListToolsCompletedEventType = "response.mcp_list_tools.completed" +``` + + +## Values + +- `"response.mcp_list_tools.completed"` diff --git a/docs/components/mcplisttoolsfailedevent.mdx b/docs/components/mcplisttoolsfailedevent.mdx new file mode 100644 index 000000000..820123488 --- /dev/null +++ b/docs/components/mcplisttoolsfailedevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsFailedEvent" +--- + +Emitted when tool discovery against an MCP server fails. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpListToolsFailedEventType](../components/mcplisttoolsfailedeventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcplisttoolsfailedeventtype.mdx b/docs/components/mcplisttoolsfailedeventtype.mdx new file mode 100644 index 000000000..f49828e3a --- /dev/null +++ b/docs/components/mcplisttoolsfailedeventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsFailedEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpListToolsFailedEventType +value: McpListToolsFailedEventType = "response.mcp_list_tools.failed" +``` + + +## Values + +- `"response.mcp_list_tools.failed"` diff --git a/docs/components/mcplisttoolsinprogressevent.mdx b/docs/components/mcplisttoolsinprogressevent.mdx new file mode 100644 index 000000000..e5774ad86 --- /dev/null +++ b/docs/components/mcplisttoolsinprogressevent.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsInProgressEvent" +--- + +Emitted when tool discovery against an MCP server begins. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `item_id` | *str* | ✔️ | N/A | +| `output_index` | *int* | ✔️ | N/A | +| `sequence_number` | *int* | ✔️ | N/A | +| `type` | [components.McpListToolsInProgressEventType](../components/mcplisttoolsinprogresseventtype.mdx) | ✔️ | N/A | \ No newline at end of file diff --git a/docs/components/mcplisttoolsinprogresseventtype.mdx b/docs/components/mcplisttoolsinprogresseventtype.mdx new file mode 100644 index 000000000..f15fd5700 --- /dev/null +++ b/docs/components/mcplisttoolsinprogresseventtype.mdx @@ -0,0 +1,15 @@ +--- +title: "McpListToolsInProgressEventType" +--- + +## Example Usage + +```python +from openrouter.components import McpListToolsInProgressEventType +value: McpListToolsInProgressEventType = "response.mcp_list_tools.in_progress" +``` + + +## Values + +- `"response.mcp_list_tools.in_progress"` diff --git a/docs/components/outputitems.mdx b/docs/components/outputitems.mdx index 5ade7f32a..f68ca9d3a 100644 --- a/docs/components/outputitems.mdx +++ b/docs/components/outputitems.mdx @@ -55,6 +55,18 @@ value: components.OutputFunctionCallItem = /* values here */ value: components.OutputImageGenerationCallItem = /* values here */ ``` +### `components.McpCallItem` + +```python +value: components.McpCallItem = /* values here */ +``` + +### `components.McpListToolsItem` + +```python +value: components.McpListToolsItem = /* values here */ +``` + ### `components.OutputMessageItem` ```python @@ -133,12 +145,6 @@ value: components.OutputFusionServerToolItem = /* values here */ value: components.OutputImageGenerationServerToolItem = /* values here */ ``` -### `components.OutputMcpServerToolItem` - -```python -value: components.OutputMcpServerToolItem = /* values here */ -``` - ### `components.OutputMemoryServerToolItem` ```python diff --git a/docs/components/outputmcpservertoolitem.mdx b/docs/components/outputmcpservertoolitem.mdx deleted file mode 100644 index 6df10a68b..000000000 --- a/docs/components/outputmcpservertoolitem.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "OutputMcpServerToolItem" ---- - -An openrouter:mcp server tool output item - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *Optional[str]* | ➖ | N/A | | -| `server_label` | *Optional[str]* | ➖ | N/A | | -| `status` | [components.ToolCallStatus](../components/toolcallstatus.mdx) | ✔️ | N/A | completed | -| `tool_name` | *Optional[str]* | ➖ | N/A | | -| `type` | [components.OutputMcpServerToolItemType](../components/outputmcpservertoolitemtype.mdx) | ✔️ | N/A | | \ No newline at end of file diff --git a/docs/components/outputmcpservertoolitemtype.mdx b/docs/components/outputmcpservertoolitemtype.mdx deleted file mode 100644 index b98202d9a..000000000 --- a/docs/components/outputmcpservertoolitemtype.mdx +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "OutputMcpServerToolItemType" ---- - -## Example Usage - -```python -from openrouter.components import OutputMcpServerToolItemType -value: OutputMcpServerToolItemType = "openrouter:mcp" -``` - - -## Values - -- `"openrouter:mcp"` diff --git a/docs/components/streamevents.mdx b/docs/components/streamevents.mdx index e4f5c1241..ab12eb306 100644 --- a/docs/components/streamevents.mdx +++ b/docs/components/streamevents.mdx @@ -205,6 +205,54 @@ value: components.OpenResponsesInProgressEvent = /* values here */ value: components.StreamEventsResponseIncomplete = /* values here */ ``` +### `components.McpCallArgumentsDeltaEvent` + +```python +value: components.McpCallArgumentsDeltaEvent = /* values here */ +``` + +### `components.McpCallArgumentsDoneEvent` + +```python +value: components.McpCallArgumentsDoneEvent = /* values here */ +``` + +### `components.McpCallCompletedEvent` + +```python +value: components.McpCallCompletedEvent = /* values here */ +``` + +### `components.McpCallFailedEvent` + +```python +value: components.McpCallFailedEvent = /* values here */ +``` + +### `components.McpCallInProgressEvent` + +```python +value: components.McpCallInProgressEvent = /* values here */ +``` + +### `components.McpListToolsCompletedEvent` + +```python +value: components.McpListToolsCompletedEvent = /* values here */ +``` + +### `components.McpListToolsFailedEvent` + +```python +value: components.McpListToolsFailedEvent = /* values here */ +``` + +### `components.McpListToolsInProgressEvent` + +```python +value: components.McpListToolsInProgressEvent = /* values here */ +``` + ### `components.StreamEventsResponseOutputItemAdded` ```python diff --git a/pyproject.toml b/pyproject.toml index fb9b6c688..2d6e74e8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openrouter" -version = "1.3.126" +version = "1.3.127" 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 cbb70cdf3..3d34c6fe5 100644 --- a/src/openrouter/_version.py +++ b/src/openrouter/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "openrouter" -__version__: str = "1.3.126" +__version__: str = "1.3.127" __openapi_doc_version__: str = "1.0.0" __gen_version__: str = "2.950.13" -__user_agent__: str = "speakeasy-sdk/python 1.3.126 2.950.13 1.0.0 openrouter" +__user_agent__: str = "speakeasy-sdk/python 1.3.127 2.950.13 1.0.0 openrouter" try: if __package__ is not None: diff --git a/src/openrouter/components/__init__.py b/src/openrouter/components/__init__.py index 94487b283..e9f2addc2 100644 --- a/src/openrouter/components/__init__.py +++ b/src/openrouter/components/__init__.py @@ -2639,8 +2639,48 @@ McpApprovalResponseItemType, McpApprovalResponseItemTypedDict, ) + from .mcpcallargumentsdeltaevent import ( + McpCallArgumentsDeltaEvent, + McpCallArgumentsDeltaEventType, + McpCallArgumentsDeltaEventTypedDict, + ) + from .mcpcallargumentsdoneevent import ( + McpCallArgumentsDoneEvent, + McpCallArgumentsDoneEventType, + McpCallArgumentsDoneEventTypedDict, + ) + from .mcpcallcompletedevent import ( + McpCallCompletedEvent, + McpCallCompletedEventType, + McpCallCompletedEventTypedDict, + ) + from .mcpcallfailedevent import ( + McpCallFailedEvent, + McpCallFailedEventType, + McpCallFailedEventTypedDict, + ) + from .mcpcallinprogressevent import ( + McpCallInProgressEvent, + McpCallInProgressEventType, + McpCallInProgressEventTypedDict, + ) from .mcpcallitem import McpCallItem, McpCallItemType, McpCallItemTypedDict from .mcphttperror import McpHTTPError, McpHTTPErrorType, McpHTTPErrorTypedDict + from .mcplisttoolscompletedevent import ( + McpListToolsCompletedEvent, + McpListToolsCompletedEventType, + McpListToolsCompletedEventTypedDict, + ) + from .mcplisttoolsfailedevent import ( + McpListToolsFailedEvent, + McpListToolsFailedEventType, + McpListToolsFailedEventTypedDict, + ) + from .mcplisttoolsinprogressevent import ( + McpListToolsInProgressEvent, + McpListToolsInProgressEventType, + McpListToolsInProgressEventTypedDict, + ) from .mcplisttoolsitem import ( McpListToolsItem, McpListToolsItemTool, @@ -3507,11 +3547,6 @@ OutputItemWebSearchCallTypedDict, UnknownOutputItemWebSearchCallActionUnion, ) - from .outputmcpservertoolitem import ( - OutputMcpServerToolItem, - OutputMcpServerToolItemType, - OutputMcpServerToolItemTypedDict, - ) from .outputmemoryservertoolitem import ( ActionEnum, OutputMemoryServerToolItem, @@ -6620,12 +6655,36 @@ "McpApprovalResponseItem", "McpApprovalResponseItemType", "McpApprovalResponseItemTypedDict", + "McpCallArgumentsDeltaEvent", + "McpCallArgumentsDeltaEventType", + "McpCallArgumentsDeltaEventTypedDict", + "McpCallArgumentsDoneEvent", + "McpCallArgumentsDoneEventType", + "McpCallArgumentsDoneEventTypedDict", + "McpCallCompletedEvent", + "McpCallCompletedEventType", + "McpCallCompletedEventTypedDict", + "McpCallFailedEvent", + "McpCallFailedEventType", + "McpCallFailedEventTypedDict", + "McpCallInProgressEvent", + "McpCallInProgressEventType", + "McpCallInProgressEventTypedDict", "McpCallItem", "McpCallItemType", "McpCallItemTypedDict", "McpHTTPError", "McpHTTPErrorType", "McpHTTPErrorTypedDict", + "McpListToolsCompletedEvent", + "McpListToolsCompletedEventType", + "McpListToolsCompletedEventTypedDict", + "McpListToolsFailedEvent", + "McpListToolsFailedEventType", + "McpListToolsFailedEventTypedDict", + "McpListToolsInProgressEvent", + "McpListToolsInProgressEventType", + "McpListToolsInProgressEventTypedDict", "McpListToolsItem", "McpListToolsItemTool", "McpListToolsItemToolTypedDict", @@ -7179,9 +7238,6 @@ "OutputItemWebSearchCallTypedDict", "OutputItems", "OutputItemsTypedDict", - "OutputMcpServerToolItem", - "OutputMcpServerToolItemType", - "OutputMcpServerToolItemTypedDict", "OutputMemoryServerToolItem", "OutputMemoryServerToolItemType", "OutputMemoryServerToolItemTypedDict", @@ -10145,12 +10201,36 @@ "McpApprovalResponseItem": ".mcpapprovalresponseitem", "McpApprovalResponseItemType": ".mcpapprovalresponseitem", "McpApprovalResponseItemTypedDict": ".mcpapprovalresponseitem", + "McpCallArgumentsDeltaEvent": ".mcpcallargumentsdeltaevent", + "McpCallArgumentsDeltaEventType": ".mcpcallargumentsdeltaevent", + "McpCallArgumentsDeltaEventTypedDict": ".mcpcallargumentsdeltaevent", + "McpCallArgumentsDoneEvent": ".mcpcallargumentsdoneevent", + "McpCallArgumentsDoneEventType": ".mcpcallargumentsdoneevent", + "McpCallArgumentsDoneEventTypedDict": ".mcpcallargumentsdoneevent", + "McpCallCompletedEvent": ".mcpcallcompletedevent", + "McpCallCompletedEventType": ".mcpcallcompletedevent", + "McpCallCompletedEventTypedDict": ".mcpcallcompletedevent", + "McpCallFailedEvent": ".mcpcallfailedevent", + "McpCallFailedEventType": ".mcpcallfailedevent", + "McpCallFailedEventTypedDict": ".mcpcallfailedevent", + "McpCallInProgressEvent": ".mcpcallinprogressevent", + "McpCallInProgressEventType": ".mcpcallinprogressevent", + "McpCallInProgressEventTypedDict": ".mcpcallinprogressevent", "McpCallItem": ".mcpcallitem", "McpCallItemType": ".mcpcallitem", "McpCallItemTypedDict": ".mcpcallitem", "McpHTTPError": ".mcphttperror", "McpHTTPErrorType": ".mcphttperror", "McpHTTPErrorTypedDict": ".mcphttperror", + "McpListToolsCompletedEvent": ".mcplisttoolscompletedevent", + "McpListToolsCompletedEventType": ".mcplisttoolscompletedevent", + "McpListToolsCompletedEventTypedDict": ".mcplisttoolscompletedevent", + "McpListToolsFailedEvent": ".mcplisttoolsfailedevent", + "McpListToolsFailedEventType": ".mcplisttoolsfailedevent", + "McpListToolsFailedEventTypedDict": ".mcplisttoolsfailedevent", + "McpListToolsInProgressEvent": ".mcplisttoolsinprogressevent", + "McpListToolsInProgressEventType": ".mcplisttoolsinprogressevent", + "McpListToolsInProgressEventTypedDict": ".mcplisttoolsinprogressevent", "McpListToolsItem": ".mcplisttoolsitem", "McpListToolsItemTool": ".mcplisttoolsitem", "McpListToolsItemToolTypedDict": ".mcplisttoolsitem", @@ -10839,9 +10919,6 @@ "OutputItemWebSearchCallTypeWebSearchCall": ".outputitemwebsearchcall", "OutputItemWebSearchCallTypedDict": ".outputitemwebsearchcall", "UnknownOutputItemWebSearchCallActionUnion": ".outputitemwebsearchcall", - "OutputMcpServerToolItem": ".outputmcpservertoolitem", - "OutputMcpServerToolItemType": ".outputmcpservertoolitem", - "OutputMcpServerToolItemTypedDict": ".outputmcpservertoolitem", "ActionEnum": ".outputmemoryservertoolitem", "OutputMemoryServerToolItem": ".outputmemoryservertoolitem", "OutputMemoryServerToolItemType": ".outputmemoryservertoolitem", diff --git a/src/openrouter/components/inputs_union.py b/src/openrouter/components/inputs_union.py index bea147ee6..398c4ae99 100644 --- a/src/openrouter/components/inputs_union.py +++ b/src/openrouter/components/inputs_union.py @@ -104,10 +104,6 @@ OutputImageGenerationServerToolItem, OutputImageGenerationServerToolItemTypedDict, ) -from .outputmcpservertoolitem import ( - OutputMcpServerToolItem, - OutputMcpServerToolItemTypedDict, -) from .outputmemoryservertoolitem import ( OutputMemoryServerToolItem, OutputMemoryServerToolItemTypedDict, @@ -398,7 +394,7 @@ def serialize_model(self, handler): OutputImageGenerationCallItemTypedDict, OutputWebSearchCallItemTypedDict, OutputWebSearchServerToolItemTypedDict, - OutputMcpServerToolItemTypedDict, + LocalShellCallItemTypedDict, ApplyPatchCallItemTypedDict, McpApprovalResponseItemTypedDict, OutputBrowserUseServerToolItemTypedDict, @@ -406,15 +402,14 @@ def serialize_model(self, handler): OutputTextEditorServerToolItemTypedDict, McpListToolsItemTypedDict, FunctionCallOutputItemTypedDict, - LocalShellCallItemTypedDict, OutputDatetimeItemTypedDict, OutputApplyPatchServerToolItemTypedDict, - OutputMemoryServerToolItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, ToolSearchOutputItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, ToolSearchCallItemTypedDict, InputsMessageTypedDict, OutputComputerCallItemTypedDict, + OutputMemoryServerToolItemTypedDict, AgentMessageItemTypedDict, OutputCodeInterpreterCallItemTypedDict, McpCallItemTypedDict, @@ -426,9 +421,9 @@ def serialize_model(self, handler): OutputWebFetchServerToolItemTypedDict, CustomToolCallItemTypedDict, OutputImageGenerationServerToolItemTypedDict, - OutputArmorBlockedItemTypedDict, ShellCallOutputItemTypedDict, OutputFusionServerToolItemTypedDict, + OutputArmorBlockedItemTypedDict, OutputShellServerToolItemTypedDict, OutputFilesServerToolItemTypedDict, FunctionCallItemTypedDict, @@ -458,7 +453,7 @@ def serialize_model(self, handler): OutputImageGenerationCallItem, OutputWebSearchCallItem, OutputWebSearchServerToolItem, - OutputMcpServerToolItem, + LocalShellCallItem, ApplyPatchCallItem, McpApprovalResponseItem, OutputBrowserUseServerToolItem, @@ -466,15 +461,14 @@ def serialize_model(self, handler): OutputTextEditorServerToolItem, McpListToolsItem, FunctionCallOutputItem, - LocalShellCallItem, OutputDatetimeItem, OutputApplyPatchServerToolItem, - OutputMemoryServerToolItem, - OutputSearchModelsServerToolItem, ToolSearchOutputItem, + OutputSearchModelsServerToolItem, ToolSearchCallItem, InputsMessage, OutputComputerCallItem, + OutputMemoryServerToolItem, AgentMessageItem, OutputCodeInterpreterCallItem, McpCallItem, @@ -486,9 +480,9 @@ def serialize_model(self, handler): OutputWebFetchServerToolItem, CustomToolCallItem, OutputImageGenerationServerToolItem, - OutputArmorBlockedItem, ShellCallOutputItem, OutputFusionServerToolItem, + OutputArmorBlockedItem, OutputShellServerToolItem, OutputFilesServerToolItem, FunctionCallItem, diff --git a/src/openrouter/components/mcpcallargumentsdeltaevent.py b/src/openrouter/components/mcpcallargumentsdeltaevent.py new file mode 100644 index 000000000..fe40ea00f --- /dev/null +++ b/src/openrouter/components/mcpcallargumentsdeltaevent.py @@ -0,0 +1,33 @@ +"""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 + + +McpCallArgumentsDeltaEventType = Literal["response.mcp_call_arguments.delta",] + + +class McpCallArgumentsDeltaEventTypedDict(TypedDict): + r"""A partial update to the JSON-encoded arguments of an MCP tool call.""" + + delta: str + item_id: str + output_index: int + sequence_number: int + type: McpCallArgumentsDeltaEventType + + +class McpCallArgumentsDeltaEvent(BaseModel): + r"""A partial update to the JSON-encoded arguments of an MCP tool call.""" + + delta: str + + item_id: str + + output_index: int + + sequence_number: int + + type: McpCallArgumentsDeltaEventType diff --git a/src/openrouter/components/mcpcallargumentsdoneevent.py b/src/openrouter/components/mcpcallargumentsdoneevent.py new file mode 100644 index 000000000..b7dcedaaf --- /dev/null +++ b/src/openrouter/components/mcpcallargumentsdoneevent.py @@ -0,0 +1,33 @@ +"""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 + + +McpCallArgumentsDoneEventType = Literal["response.mcp_call_arguments.done",] + + +class McpCallArgumentsDoneEventTypedDict(TypedDict): + r"""Emitted when the JSON-encoded arguments of an MCP tool call are finalized.""" + + arguments: str + item_id: str + output_index: int + sequence_number: int + type: McpCallArgumentsDoneEventType + + +class McpCallArgumentsDoneEvent(BaseModel): + r"""Emitted when the JSON-encoded arguments of an MCP tool call are finalized.""" + + arguments: str + + item_id: str + + output_index: int + + sequence_number: int + + type: McpCallArgumentsDoneEventType diff --git a/src/openrouter/components/mcpcallcompletedevent.py b/src/openrouter/components/mcpcallcompletedevent.py new file mode 100644 index 000000000..86cb37091 --- /dev/null +++ b/src/openrouter/components/mcpcallcompletedevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpCallCompletedEventType = Literal["response.mcp_call.completed",] + + +class McpCallCompletedEventTypedDict(TypedDict): + r"""Emitted when an MCP tool call completes successfully.""" + + item_id: str + output_index: int + sequence_number: int + type: McpCallCompletedEventType + + +class McpCallCompletedEvent(BaseModel): + r"""Emitted when an MCP tool call completes successfully.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpCallCompletedEventType diff --git a/src/openrouter/components/mcpcallfailedevent.py b/src/openrouter/components/mcpcallfailedevent.py new file mode 100644 index 000000000..9af444acb --- /dev/null +++ b/src/openrouter/components/mcpcallfailedevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpCallFailedEventType = Literal["response.mcp_call.failed",] + + +class McpCallFailedEventTypedDict(TypedDict): + r"""Emitted when an MCP tool call fails.""" + + item_id: str + output_index: int + sequence_number: int + type: McpCallFailedEventType + + +class McpCallFailedEvent(BaseModel): + r"""Emitted when an MCP tool call fails.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpCallFailedEventType diff --git a/src/openrouter/components/mcpcallinprogressevent.py b/src/openrouter/components/mcpcallinprogressevent.py new file mode 100644 index 000000000..16f4b5bce --- /dev/null +++ b/src/openrouter/components/mcpcallinprogressevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpCallInProgressEventType = Literal["response.mcp_call.in_progress",] + + +class McpCallInProgressEventTypedDict(TypedDict): + r"""Emitted when an MCP tool call begins executing.""" + + item_id: str + output_index: int + sequence_number: int + type: McpCallInProgressEventType + + +class McpCallInProgressEvent(BaseModel): + r"""Emitted when an MCP tool call begins executing.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpCallInProgressEventType diff --git a/src/openrouter/components/mcplisttoolscompletedevent.py b/src/openrouter/components/mcplisttoolscompletedevent.py new file mode 100644 index 000000000..be1daf34a --- /dev/null +++ b/src/openrouter/components/mcplisttoolscompletedevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpListToolsCompletedEventType = Literal["response.mcp_list_tools.completed",] + + +class McpListToolsCompletedEventTypedDict(TypedDict): + r"""Emitted when tool discovery against an MCP server succeeds.""" + + item_id: str + output_index: int + sequence_number: int + type: McpListToolsCompletedEventType + + +class McpListToolsCompletedEvent(BaseModel): + r"""Emitted when tool discovery against an MCP server succeeds.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpListToolsCompletedEventType diff --git a/src/openrouter/components/mcplisttoolsfailedevent.py b/src/openrouter/components/mcplisttoolsfailedevent.py new file mode 100644 index 000000000..e78732c4c --- /dev/null +++ b/src/openrouter/components/mcplisttoolsfailedevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpListToolsFailedEventType = Literal["response.mcp_list_tools.failed",] + + +class McpListToolsFailedEventTypedDict(TypedDict): + r"""Emitted when tool discovery against an MCP server fails.""" + + item_id: str + output_index: int + sequence_number: int + type: McpListToolsFailedEventType + + +class McpListToolsFailedEvent(BaseModel): + r"""Emitted when tool discovery against an MCP server fails.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpListToolsFailedEventType diff --git a/src/openrouter/components/mcplisttoolsinprogressevent.py b/src/openrouter/components/mcplisttoolsinprogressevent.py new file mode 100644 index 000000000..7959bd5ef --- /dev/null +++ b/src/openrouter/components/mcplisttoolsinprogressevent.py @@ -0,0 +1,30 @@ +"""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 + + +McpListToolsInProgressEventType = Literal["response.mcp_list_tools.in_progress",] + + +class McpListToolsInProgressEventTypedDict(TypedDict): + r"""Emitted when tool discovery against an MCP server begins.""" + + item_id: str + output_index: int + sequence_number: int + type: McpListToolsInProgressEventType + + +class McpListToolsInProgressEvent(BaseModel): + r"""Emitted when tool discovery against an MCP server begins.""" + + item_id: str + + output_index: int + + sequence_number: int + + type: McpListToolsInProgressEventType diff --git a/src/openrouter/components/outputitems.py b/src/openrouter/components/outputitems.py index c4933ca3b..9cadc1da1 100644 --- a/src/openrouter/components/outputitems.py +++ b/src/openrouter/components/outputitems.py @@ -1,6 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .mcpcallitem import McpCallItem, McpCallItemTypedDict +from .mcplisttoolsitem import McpListToolsItem, McpListToolsItemTypedDict from .outputadvisorservertoolitem import ( OutputAdvisorServerToolItem, OutputAdvisorServerToolItemTypedDict, @@ -71,10 +73,6 @@ OutputImageGenerationServerToolItem, OutputImageGenerationServerToolItemTypedDict, ) -from .outputmcpservertoolitem import ( - OutputMcpServerToolItem, - OutputMcpServerToolItemTypedDict, -) from .outputmemoryservertoolitem import ( OutputMemoryServerToolItem, OutputMemoryServerToolItemTypedDict, @@ -137,7 +135,7 @@ OutputFileSearchServerToolItemTypedDict, OutputCompactionItemTypedDict, OutputFileSearchCallItemTypedDict, - OutputMcpServerToolItemTypedDict, + McpListToolsItemTypedDict, OutputWebSearchCallItemTypedDict, OutputImageGenerationCallItemTypedDict, OutputApplyPatchCallItemTypedDict, @@ -145,25 +143,26 @@ OutputBrowserUseServerToolItemTypedDict, OutputWebSearchServerToolItemTypedDict, OutputApplyPatchServerToolItemTypedDict, - OutputSearchModelsServerToolItemTypedDict, + OutputMemoryServerToolItemTypedDict, OutputToolSearchCallItemTypedDict, OutputDatetimeItemTypedDict, - OutputMemoryServerToolItemTypedDict, + OutputSearchModelsServerToolItemTypedDict, OutputComputerCallItemTypedDict, OutputMessageItemTypedDict, OutputShellCallItemTypedDict, OutputCodeInterpreterCallItemTypedDict, - OutputCodeInterpreterServerToolItemTypedDict, + McpCallItemTypedDict, + OutputAdvisorServerToolItemTypedDict, OutputCustomToolCallItemTypedDict, OutputWebFetchServerToolItemTypedDict, OutputReasoningItemTypedDict, - OutputAdvisorServerToolItemTypedDict, + OutputCodeInterpreterServerToolItemTypedDict, OutputArmorBlockedItemTypedDict, - OutputImageGenerationServerToolItemTypedDict, OutputShellCallOutputItemTypedDict, + OutputImageGenerationServerToolItemTypedDict, OutputFusionServerToolItemTypedDict, - OutputShellServerToolItemTypedDict, OutputFunctionCallItemTypedDict, + OutputShellServerToolItemTypedDict, OutputFilesServerToolItemTypedDict, OutputSubagentServerToolItemTypedDict, OutputBashServerToolItemTypedDict, @@ -192,6 +191,8 @@ class UnknownOutputItems(BaseModel): "file_search_call": OutputFileSearchCallItem, "function_call": OutputFunctionCallItem, "image_generation_call": OutputImageGenerationCallItem, + "mcp_call": McpCallItem, + "mcp_list_tools": McpListToolsItem, "message": OutputMessageItem, "openrouter:advisor": OutputAdvisorServerToolItem, "openrouter:apply_patch": OutputApplyPatchServerToolItem, @@ -205,7 +206,6 @@ class UnknownOutputItems(BaseModel): "openrouter:files": OutputFilesServerToolItem, "openrouter:fusion": OutputFusionServerToolItem, "openrouter:image_generation": OutputImageGenerationServerToolItem, - "openrouter:mcp": OutputMcpServerToolItem, "openrouter:memory": OutputMemoryServerToolItem, "openrouter:shell": OutputShellServerToolItem, "openrouter:subagent": OutputSubagentServerToolItem, @@ -231,6 +231,8 @@ class UnknownOutputItems(BaseModel): OutputFileSearchCallItem, OutputFunctionCallItem, OutputImageGenerationCallItem, + McpCallItem, + McpListToolsItem, OutputMessageItem, OutputAdvisorServerToolItem, OutputApplyPatchServerToolItem, @@ -244,7 +246,6 @@ class UnknownOutputItems(BaseModel): OutputFilesServerToolItem, OutputFusionServerToolItem, OutputImageGenerationServerToolItem, - OutputMcpServerToolItem, OutputMemoryServerToolItem, OutputShellServerToolItem, OutputSubagentServerToolItem, diff --git a/src/openrouter/components/outputmcpservertoolitem.py b/src/openrouter/components/outputmcpservertoolitem.py deleted file mode 100644 index 58c215114..000000000 --- a/src/openrouter/components/outputmcpservertoolitem.py +++ /dev/null @@ -1,58 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from .toolcallstatus import ToolCallStatus -from openrouter.types import BaseModel, UNSET_SENTINEL -import pydantic -from pydantic import model_serializer -from typing import Literal, Optional -from typing_extensions import Annotated, NotRequired, TypedDict - - -OutputMcpServerToolItemType = Literal["openrouter:mcp",] - - -class OutputMcpServerToolItemTypedDict(TypedDict): - r"""An openrouter:mcp server tool output item""" - - status: ToolCallStatus - type: OutputMcpServerToolItemType - id: NotRequired[str] - server_label: NotRequired[str] - tool_name: NotRequired[str] - - -class OutputMcpServerToolItem(BaseModel): - r"""An openrouter:mcp server tool output item""" - - status: ToolCallStatus - - type: OutputMcpServerToolItemType - - id: Optional[str] = None - - server_label: Annotated[Optional[str], pydantic.Field(alias="serverLabel")] = None - - tool_name: Annotated[Optional[str], pydantic.Field(alias="toolName")] = None - - @model_serializer(mode="wrap") - def serialize_model(self, handler): - optional_fields = set(["id", "serverLabel", "toolName"]) - serialized = handler(self) - m = {} - - for n, f in type(self).model_fields.items(): - k = f.alias or n - val = serialized.get(k, serialized.get(n)) - - if val != UNSET_SENTINEL: - if val is not None or k not in optional_fields: - m[k] = val - - return m - - -try: - OutputMcpServerToolItem.model_rebuild() -except NameError: - pass diff --git a/src/openrouter/components/streamevents.py b/src/openrouter/components/streamevents.py index 0f44579de..ac2b33099 100644 --- a/src/openrouter/components/streamevents.py +++ b/src/openrouter/components/streamevents.py @@ -102,6 +102,32 @@ ImageGenCallPartialImageEvent, ImageGenCallPartialImageEventTypedDict, ) +from .mcpcallargumentsdeltaevent import ( + McpCallArgumentsDeltaEvent, + McpCallArgumentsDeltaEventTypedDict, +) +from .mcpcallargumentsdoneevent import ( + McpCallArgumentsDoneEvent, + McpCallArgumentsDoneEventTypedDict, +) +from .mcpcallcompletedevent import McpCallCompletedEvent, McpCallCompletedEventTypedDict +from .mcpcallfailedevent import McpCallFailedEvent, McpCallFailedEventTypedDict +from .mcpcallinprogressevent import ( + McpCallInProgressEvent, + McpCallInProgressEventTypedDict, +) +from .mcplisttoolscompletedevent import ( + McpListToolsCompletedEvent, + McpListToolsCompletedEventTypedDict, +) +from .mcplisttoolsfailedevent import ( + McpListToolsFailedEvent, + McpListToolsFailedEventTypedDict, +) +from .mcplisttoolsinprogressevent import ( + McpListToolsInProgressEvent, + McpListToolsInProgressEventTypedDict, +) from .openresponsescreatedevent import ( OpenResponsesCreatedEvent, OpenResponsesCreatedEventTypedDict, @@ -176,55 +202,63 @@ StreamEventsTypedDict = TypeAliasType( "StreamEventsTypedDict", Union[ - OpenResponsesCreatedEventTypedDict, + DebugEventTypedDict, OpenResponsesInProgressEventTypedDict, StreamEventsResponseCompletedTypedDict, StreamEventsResponseIncompleteTypedDict, StreamEventsResponseFailedTypedDict, - DebugEventTypedDict, - FusionCallCompletedEventTypedDict, - StreamEventsResponseOutputItemDoneTypedDict, - ImageGenCallInProgressEventTypedDict, - FusionCallInProgressEventTypedDict, + OpenResponsesCreatedEventTypedDict, + McpListToolsInProgressEventTypedDict, + CodeInterpreterCallInterpretingEventTypedDict, StreamEventsResponseOutputItemAddedTypedDict, + McpCallFailedEventTypedDict, + McpCallCompletedEventTypedDict, WebSearchCallCompletedEventTypedDict, WebSearchCallSearchingEventTypedDict, WebSearchCallInProgressEventTypedDict, + McpCallInProgressEventTypedDict, CodeInterpreterCallCompletedEventTypedDict, - CodeInterpreterCallInterpretingEventTypedDict, + McpListToolsFailedEventTypedDict, + McpListToolsCompletedEventTypedDict, + StreamEventsResponseOutputItemDoneTypedDict, + FusionCallCompletedEventTypedDict, CodeInterpreterCallInProgressEventTypedDict, ImageGenCallCompletedEventTypedDict, + FusionCallInProgressEventTypedDict, + ImageGenCallInProgressEventTypedDict, ImageGenCallGeneratingEventTypedDict, - CustomToolCallInputDoneEventTypedDict, - CodeInterpreterCallCodeDeltaEventTypedDict, - ErrorEventTypedDict, - FusionCallAnalysisCompletedEventTypedDict, - FusionCallPanelAddedEventTypedDict, ApplyPatchCallOperationDiffDoneEventTypedDict, + FusionCallPanelAddedEventTypedDict, + FusionCallAnalysisCompletedEventTypedDict, ApplyPatchCallOperationDiffDeltaEventTypedDict, - CustomToolCallInputDeltaEventTypedDict, - CodeInterpreterCallCodeDoneEventTypedDict, FunctionCallArgsDeltaEventTypedDict, - FusionCallPanelDeltaEventTypedDict, - FusionCallPanelReasoningDeltaEventTypedDict, - FunctionCallArgsDoneEventTypedDict, + CodeInterpreterCallCodeDeltaEventTypedDict, + CodeInterpreterCallCodeDoneEventTypedDict, + ErrorEventTypedDict, + McpCallArgumentsDeltaEventTypedDict, + McpCallArgumentsDoneEventTypedDict, + CustomToolCallInputDeltaEventTypedDict, + CustomToolCallInputDoneEventTypedDict, RefusalDoneEventTypedDict, - RefusalDeltaEventTypedDict, + ReasoningSummaryPartDoneEventTypedDict, + ReasoningSummaryTextDoneEventTypedDict, ReasoningSummaryTextDeltaEventTypedDict, - ReasoningDeltaEventTypedDict, + FusionCallPanelDeltaEventTypedDict, + FusionCallPanelReasoningDeltaEventTypedDict, + FusionCallPanelCompletedEventTypedDict, ContentPartAddedEventTypedDict, + FusionCallAnalysisInProgressEventTypedDict, ImageGenCallPartialImageEventTypedDict, + ReasoningSummaryPartAddedEventTypedDict, ReasoningDoneEventTypedDict, + ReasoningDeltaEventTypedDict, + FunctionCallArgsDoneEventTypedDict, ContentPartDoneEventTypedDict, - ReasoningSummaryPartAddedEventTypedDict, - ReasoningSummaryPartDoneEventTypedDict, - ReasoningSummaryTextDoneEventTypedDict, - FusionCallPanelCompletedEventTypedDict, - FusionCallAnalysisInProgressEventTypedDict, - FusionCallPanelFailedEventTypedDict, - AnnotationAddedEventTypedDict, - TextDeltaEventTypedDict, + RefusalDeltaEventTypedDict, TextDoneEventTypedDict, + TextDeltaEventTypedDict, + AnnotationAddedEventTypedDict, + FusionCallPanelFailedEventTypedDict, ], ) r"""Union of all possible event types emitted during response streaming""" @@ -274,6 +308,14 @@ class UnknownStreamEvents(BaseModel): "response.image_generation_call.partial_image": ImageGenCallPartialImageEvent, "response.in_progress": OpenResponsesInProgressEvent, "response.incomplete": StreamEventsResponseIncomplete, + "response.mcp_call_arguments.delta": McpCallArgumentsDeltaEvent, + "response.mcp_call_arguments.done": McpCallArgumentsDoneEvent, + "response.mcp_call.completed": McpCallCompletedEvent, + "response.mcp_call.failed": McpCallFailedEvent, + "response.mcp_call.in_progress": McpCallInProgressEvent, + "response.mcp_list_tools.completed": McpListToolsCompletedEvent, + "response.mcp_list_tools.failed": McpListToolsFailedEvent, + "response.mcp_list_tools.in_progress": McpListToolsInProgressEvent, "response.output_item.added": StreamEventsResponseOutputItemAdded, "response.output_item.done": StreamEventsResponseOutputItemDone, "response.output_text.annotation.added": AnnotationAddedEvent, @@ -328,6 +370,14 @@ class UnknownStreamEvents(BaseModel): ImageGenCallPartialImageEvent, OpenResponsesInProgressEvent, StreamEventsResponseIncomplete, + McpCallArgumentsDeltaEvent, + McpCallArgumentsDoneEvent, + McpCallCompletedEvent, + McpCallFailedEvent, + McpCallInProgressEvent, + McpListToolsCompletedEvent, + McpListToolsFailedEvent, + McpListToolsInProgressEvent, StreamEventsResponseOutputItemAdded, StreamEventsResponseOutputItemDone, AnnotationAddedEvent, diff --git a/uv.lock b/uv.lock index 6609962d6..2cb0c179b 100644 --- a/uv.lock +++ b/uv.lock @@ -231,7 +231,7 @@ wheels = [ [[package]] name = "openrouter" -version = "1.3.126" +version = "1.3.127" source = { editable = "." } dependencies = [ { name = "httpcore" }, From 6d7d66bd42290b6b2188978c1d3929ab0a13a45f Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Thu, 5 Nov 2026 06:58:20 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow