diff --git a/.gitignore b/.gitignore index d405f237..71220ec9 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /examples/nextjs-example/package-lock.json /examples/nextjs-example/package.lock.json /temp +.codanna/** diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index ffca49ba..015b3557 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -5,15 +5,15 @@ management: docVersion: 1.0.0 speakeasyVersion: 1.680.0 generationVersion: 2.788.4 - releaseVersion: 0.3.2 - configChecksum: e864b6ee968e465fd5d31f0e4dab7e85 + releaseVersion: 0.3.7 + configChecksum: 307fbb413f183f19cd9e45ff5e5a2212 repoURL: https://github.com/OpenRouterTeam/typescript-sdk.git installationURL: https://github.com/OpenRouterTeam/typescript-sdk published: true persistentEdits: - generation_id: a8636cf4-e67b-418f-b54f-85c26ca48898 - pristine_commit_hash: 5f158300984b0905d05d728c1b0eb4b0bdfd20d4 - pristine_tree_hash: 55f206771d8ffff9819a1c2942b2e5397bf9af7f + generation_id: 89ff75fc-55b0-4eb8-ad25-82572b9903a7 + pristine_commit_hash: 64d8d07c464614eda10ab00c5d6a1c1d25c943e3 + pristine_tree_hash: ffaecc36e84561dcf0fb0693f6a4a2318da99e0c features: typescript: acceptHeaders: 2.81.2 @@ -1952,1096 +1952,1096 @@ trackedFiles: pristine_git_object: 3023d20d49edb84df485d98777ec339f33b5ec6b examples/betaResponsesSend.example.ts: id: 66896eb477c6 - last_write_checksum: sha1:ce40b3ebed09f8f1542a22f0b8282ab9707e56cb - pristine_git_object: 3a7d364c1b1102e1c93e141c854901bd6f5d2b3c + last_write_checksum: sha1:1d2efd7c363ee1fa93688cfeeb4daddc0182a8f6 + pristine_git_object: 0a7386751210cd64e845dc32ed7b38d14f91cf09 examples/package.json: id: c1d7b0ec8e7e last_write_checksum: sha1:ce55578b5e4f5ea8dbe806eff6cf5d6bdd8172ac pristine_git_object: 410efafd6a7f50d91ccb87131fedbe0c3d47e15a jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:8bb7bd7f35567645abba6a8476a25178f24fd07b - pristine_git_object: e9222ebbeea6ef97b13071103c6e96fb93ea9eef + last_write_checksum: sha1:86b61d7f53f41cc886e34272588043abc42ce372 + pristine_git_object: 33a0a439a9e1692e39a89709ac03b89f25c13f30 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:ced8b7c5d93eea0909685879a77bb8d70a331e3c - pristine_git_object: 0408db65cab97ceebf26def65ac406a89366b135 + last_write_checksum: sha1:72caad1939114ecb1c01391384b6fb11e52fc19b + pristine_git_object: ac2454d305ef0d146cbf7a82ee529fe3d94af8c8 src/core.ts: id: f431fdbcd144 - last_write_checksum: sha1:7d73f90f2f018da0f1494d4f9a274788ae408db4 - pristine_git_object: e8f7c169b71be3f47fa8c81ffbfd7241110f4b92 + last_write_checksum: sha1:5aa66b0b6a5964f3eea7f3098c2eb3c0ee9c0131 + pristine_git_object: 8747345312bcc83a569602bf521f20f0e1559fb1 src/funcs/analyticsGetUserActivity.ts: id: 6525bcc66ab5 - last_write_checksum: sha1:f855827d2dc592c4b1fb501d58f1728a6e17a785 - pristine_git_object: 4fd234f42c3099487a9e71225cb411ad27d5d520 + last_write_checksum: sha1:add74757e0493e18f836f20ad7edb9f3e09ade4b + pristine_git_object: 4768169a8fa36c19b9005244790525da4cacaf11 src/funcs/apiKeysCreate.ts: id: 133e2c5f487c - last_write_checksum: sha1:36164aee3da383a50290a173b0df21dd442ad941 - pristine_git_object: d35c2dcfa97314ed0b9881a83bda80aec1a02b21 + last_write_checksum: sha1:a0071d5a8780621c57de720c485118420e48f56b + pristine_git_object: 2f05162d155120d366afe1a9a8733df53ef50d76 src/funcs/apiKeysDelete.ts: id: c151c399f75f - last_write_checksum: sha1:93228d6d07dbabe207748976bab64775c5132c33 - pristine_git_object: d23f73e33ba0097288bd1d10f4a6d770a712816f + last_write_checksum: sha1:3fad589d2766f083ea4fce78ce9d434a631cee0e + pristine_git_object: b365c6d47419218607b55902254b17e63a41e09f src/funcs/apiKeysGet.ts: id: 12a5c2abbddd - last_write_checksum: sha1:4fa93b47c6b13ffedd678b8bddfa77dc669ebcc1 - pristine_git_object: e7713c61c3dc14e36ac0c68541af6f36c8c00409 + last_write_checksum: sha1:d539985b64c009767c46e7dafa04e4f70a00c237 + pristine_git_object: f17999907d51da1e1ef18599f360cf9fad0b7961 src/funcs/apiKeysGetCurrentKeyMetadata.ts: id: d9449cb31931 - last_write_checksum: sha1:d5e6339089110a2549bc01bb226fd9c8847fbb27 - pristine_git_object: b73ac64debc38307d0092144781276f32b1e377f + last_write_checksum: sha1:a022d7d2ff5bdc0ba1b518f9bde4891da8dd876f + pristine_git_object: 1f0aab979cd07afc45d64c9785fa32cb0b147eaf src/funcs/apiKeysList.ts: id: 2afc8d8f1ce0 - last_write_checksum: sha1:b21633599b15b6c5c9eb377a7823d9f101a5d00e - pristine_git_object: 92de90df7ec8ccbb7d741de3c7ee7ca016088ec7 + last_write_checksum: sha1:8debc5536d58f61a5976d94cc6626551bd350e28 + pristine_git_object: cdce44605188fca3b86be4f00e3bcddea5f83a63 src/funcs/apiKeysUpdate.ts: id: 05700884934b - last_write_checksum: sha1:d42eade1bb462f897fb68177945a56ccbfeeddbb - pristine_git_object: dff65d4a24e89b4008090bb358ff4f237ddf6cbe + last_write_checksum: sha1:ba2c4e567f73b013767c99f39a15fb053746e373 + pristine_git_object: b41d43b0b84377f2834bce12265e1dd4cdef2899 src/funcs/betaResponsesSend.ts: id: c5c4ab0c3f76 - last_write_checksum: sha1:5354b960c90b09e37600b1e0dd12fd78cdb5673f - pristine_git_object: cddbbaef6196fd6ef90314bbf6d541c050d7e1bb + last_write_checksum: sha1:33b0c402b974f01eb56f5ca7abf80a9fd541af1a + pristine_git_object: 3f63d38e94d2b178dbb884560ff7935147f58d70 src/funcs/chatSend.ts: id: 8c3aa3c963bf - last_write_checksum: sha1:5602412df9d9e1073525f1eb8fb2af77e9cfca97 - pristine_git_object: a0891e85886a57e2834d93f6e599114ca81187f5 + last_write_checksum: sha1:5254e5d174b50ab9075114a8670766f47ae6fb91 + pristine_git_object: 3054ce2afd04f61594f4a2fb2c22de26e261bfc5 src/funcs/completionsGenerate.ts: id: 54a6e7c9b712 - last_write_checksum: sha1:79d77bd2027e4b33a927f5fba6cd2b9f4ffc566e - pristine_git_object: a34c5b8dbc14490bfc7cfe5f48a32a58a6eebe8d + last_write_checksum: sha1:36c6ea16d504bf3625f5dfb2ee614282781e05c5 + pristine_git_object: 90f94a93fd45c24a04fd0d173ea3cc3904b001ed src/funcs/creditsCreateCoinbaseCharge.ts: id: e07ee6831da3 - last_write_checksum: sha1:686d5be094f5be7852463f8bcb557e5c19763427 - pristine_git_object: c7b45be4c3b1757b9d3613114c37a5ddb1b71f46 + last_write_checksum: sha1:0e371bd82641c636104dbdfd646fc4c8db063c99 + pristine_git_object: 0acd1929c2aebd45f6f3a648e2e9336ac95e2cc1 src/funcs/creditsGetCredits.ts: id: 88fdc1315137 - last_write_checksum: sha1:4846b115cbf01f82390ecb4e7dc702871c7395ca - pristine_git_object: b2dfad0fc2b7138bc1434cfa3cd0788c94ca512b + last_write_checksum: sha1:815cbf4a2903acb91e264b2f1c310127b75e988b + pristine_git_object: 63149dcec7bc36e9502fd7a7140b26375116c540 src/funcs/embeddingsGenerate.ts: id: f6455fcfe2c8 - last_write_checksum: sha1:d2a39bdf0129faa1be3c7946110b2c66411753ff - pristine_git_object: 998f5969a49ef5361a524bddfa1399d5889726ff + last_write_checksum: sha1:05100d7c8466aaff3db0472c736e07e4f7790cd6 + pristine_git_object: 80464839594dfb09c288c5d9d76a187014fa1400 src/funcs/embeddingsListModels.ts: id: dbe9751f8369 - last_write_checksum: sha1:4352146465e4d45bd35c26d6147eaa6e5492374e - pristine_git_object: a07111e3bb6bfc02a6407545f8c22b48a859a37a + last_write_checksum: sha1:adc80e35a054e966ea0eaf51487449a2ceb41450 + pristine_git_object: 95d734bbf9d8b44d1d9b546c481f4b153de55f02 src/funcs/endpointsList.ts: id: ea932ec09987 - last_write_checksum: sha1:826d5a378bb1a9f844027dcc6ccf7f16a4ee5d32 - pristine_git_object: 5dae15ade19e5f04eda223ea7165a339d51909f8 + last_write_checksum: sha1:4b851f2c83be785579938a6519af28912d235a5a + pristine_git_object: 031c9fe22fd243bde09f1028f047eee6e3c60676 src/funcs/endpointsListZdrEndpoints.ts: id: 4efb7ea3e48f - last_write_checksum: sha1:e20185a97e22c8cdf99ca2934fd4ca35f8e79dc2 - pristine_git_object: 1eab561c5a4704974e1683d2fb93ca327c06b9ac + last_write_checksum: sha1:fa86602a78dcc7b73a5591c2eb993bb828a19063 + pristine_git_object: 5aaad36651ce90cd54c352927fee9279a6e41b64 src/funcs/generationsGetGeneration.ts: id: dac2d205a08d - last_write_checksum: sha1:5282c341d646d71238e1b3ca5b8349c4cade2020 - pristine_git_object: 094dd166a74340a43fb44b68ebd0748c4deade15 + last_write_checksum: sha1:c24ba6978d270d95c4dcc8368cea039c79afd33d + pristine_git_object: b8418b55aef4a6a3459ea23d92746b95d9522146 src/funcs/modelsCount.ts: id: 371adfc67b48 - last_write_checksum: sha1:79971b1f5d36766096cc438c88aaa99e7998ce51 - pristine_git_object: cd17643ceedaa589ae90342db41e62b8c254114a + last_write_checksum: sha1:c14a7b95052f30f2091146b2a2573df4c4ec93b4 + pristine_git_object: 1425d9110353cc5df54263418577187a0bd5248b src/funcs/modelsList.ts: id: deff050b46c5 - last_write_checksum: sha1:ddd39e6187ef1045f8f82af00b9a0eb43ad53bab - pristine_git_object: 2b9d404905221814b8de0633a8893408a85c3403 + last_write_checksum: sha1:6be44a81f92edfc0e7ec3baf5f35b96006058cac + pristine_git_object: 18f86201f9faa3eefeb852bdfa39a332bcc1f3f2 src/funcs/modelsListForUser.ts: id: db628dd3c179 - last_write_checksum: sha1:2ae6a0b5c5c5a2854789618efacc2d105f666c73 - pristine_git_object: 55de0c1c2072f967b884108863c0147e3e4006f1 + last_write_checksum: sha1:71168f31f9fe219badd889f8458f0d5eb12fc178 + pristine_git_object: e0877a54bc8568715ee951ee377107ef7209c52b src/funcs/oAuthCreateAuthCode.ts: id: 8a79f27722c0 - last_write_checksum: sha1:5bdfeb937e7512a1b5a14ca6f95014dae84bc285 - pristine_git_object: c27ef6d093aa1405ba9a5457fa60ab7113c68c4c + last_write_checksum: sha1:6072dab1d9970e0e63819206d0acf512770b5d8c + pristine_git_object: 227561e991c87e6ba6cdccf5e27889c3f4fba9fc src/funcs/oAuthExchangeAuthCodeForAPIKey.ts: id: 3386ec12d934 - last_write_checksum: sha1:80bb77baed1d0a468ea340f1f603c9d83ef5cc77 - pristine_git_object: 76630a814c7ba0792521d7e1c701572a1fc9179f + last_write_checksum: sha1:214fa6f6b50d4cf65d015d7985379f79c1ee8ee3 + pristine_git_object: 22eb8cd4452c452559063034cd2fde75518e57e8 src/funcs/parametersGetParameters.ts: id: 565ce9801e34 - last_write_checksum: sha1:5d9f9c6846a8b95f7ebace3f8451e4f9d46ccc6c - pristine_git_object: a5adc582370aaa67923e9a088a49ac846f8204c3 + last_write_checksum: sha1:ab11a60b9285cc34909b1b768c6058ec065374a0 + pristine_git_object: fe89f6f5f9fbaf9256e5826ef7631324a31ef602 src/funcs/providersList.ts: id: 8ad87e7210ae - last_write_checksum: sha1:a4754688ef1d35392a576696a44eebbc8d280210 - pristine_git_object: 98b6bc6bbe9f0ba7a3633f179da60cf16565f1e9 + last_write_checksum: sha1:387318fa9e1d6604f0f64450d137a1041c50bed3 + pristine_git_object: 790ffbf94c8231adaa569739fd52a97f4990c9c7 src/hooks/hooks.ts: id: a2463fc6f69b - last_write_checksum: sha1:7dd975bbcc46a32dd394f86a4652b74ecc70d874 - pristine_git_object: 7ed9e0445ac189e0f90687c6ef602212702bde90 + last_write_checksum: sha1:fca8fbb93caa95e04081273240c61985b717bd09 + pristine_git_object: ebc4ecc4b3ef338ce18bcd1df45d0557dba45517 src/hooks/index.ts: id: 5f2dab62b520 - last_write_checksum: sha1:1a11c073a6cd792932218e1d4ed36b8567bad8ef - pristine_git_object: f60ec7acd76141a71d78008c5a362eb0236d8335 + last_write_checksum: sha1:d6e9af6de9868405b9046d6035e8a431b16a1d7c + pristine_git_object: 9345e1adf171233bc43038c328fdce155725936a src/hooks/types.ts: id: 2a02d86ec24f - last_write_checksum: sha1:27a3444c4839bec58ae89820fd8c2483edafc3f4 - pristine_git_object: 9c36bf01332084f735909a71036c3544cc4c7e3a + last_write_checksum: sha1:622c2ac820271766bc4010bfc3904738c4c5ed0f + pristine_git_object: ccd5e5d812cb4d21a1013c89f04daad9d2f72190 src/index.ts: id: c5fb850250c7 - last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 - pristine_git_object: dbcba164a0082e3bb8c43cf21fa7f8ffb9d35dfc + last_write_checksum: sha1:7ed2a5fa061eff70d4a20f33fc3269c60a5b1821 + pristine_git_object: 35c2fb4c999bde2ca2b78b36088b052235d4bdff src/lib/base64.ts: id: "598522066688" - last_write_checksum: sha1:6773eb31ed4ea4b759916a730ae77d3a907495e1 - pristine_git_object: 962ea486e17eabe13bcf068493a556110c944df8 + last_write_checksum: sha1:26b234d589cc15afab76ac7aaba1dd1bd4b4a84c + pristine_git_object: a187e58707bdb726ca2aff74941efe7493422d4e src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:c692aabf394446bd502797b5fe9836a0841c2bd9 - pristine_git_object: 8ec4c22886700d58cb98bc9f46ea7a12cc91f804 + last_write_checksum: sha1:3e3d67911460cf995c91cbe540ff9de9d91ae3e0 + pristine_git_object: 19e037b620a9f45fd4d3fab34a0ec04f2f384b9d src/lib/dlv.ts: id: b1988214835a - last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 - pristine_git_object: e81091f5e536f82739f71379b1fddc2d147c49e2 + last_write_checksum: sha1:eaac763b22717206a6199104e0403ed17a4e2711 + pristine_git_object: f4c75aca30d4e0610454c7836af262a5a0cf7623 src/lib/encodings.ts: id: 3bd8ead98afd - last_write_checksum: sha1:d20c131976ab8ac68b22bdde2b7ed84b5b873922 - pristine_git_object: 31cd3733907afbee3641b9ab680ed417247a7d33 + last_write_checksum: sha1:a6a86a86dd18af4e266f1a9ec2c1bae2546589da + pristine_git_object: eaa7618d906d1b67b35f478de026531df31695c7 src/lib/env.ts: id: c52972a3b198 - last_write_checksum: sha1:d752e905d8ae68a3191289dcdabe84cf2b7cdd6c - pristine_git_object: 3d87d56861634c7ef3e0da0e8b76de8c4769eb4f + last_write_checksum: sha1:d06496e6dfdb7ea208fabe4cf406613c3a74e321 + pristine_git_object: 88ff8a654f83a9d36978c658c1fd0257dc95701f src/lib/event-streams.ts: id: 3f731f808a79 - last_write_checksum: sha1:450a8516564c07e0e6e5c7788867e4fecde8d793 - pristine_git_object: 04e4568bbe807cdf3e2065e1e7ec1f652e964b69 + last_write_checksum: sha1:b553c5eaad645fe7bdc000828d644a1d9598958f + pristine_git_object: d649d97971ba3229a5fd370fa92fc282588a6d48 src/lib/files.ts: id: e5efa54fcb95 - last_write_checksum: sha1:d0f325f445b8d22e7d73baf052c585ec2dd24841 - pristine_git_object: 0344cd046d033f9e8a55de02f7935c5cec5dc30b + last_write_checksum: sha1:8818f0bb05afac75b9a39f22989296cc0722909d + pristine_git_object: 457f4cedbcb15d70595b1d3083ee3289e8105fe2 src/lib/http.ts: id: 63a80782d37e - last_write_checksum: sha1:797cbf16d3c7c4d62d3ba0eedb08617524938457 - pristine_git_object: 13cf1fd7894a89f727b8d2db2ad24313a94f68c7 + last_write_checksum: sha1:e60a1f9c9ffffd11bcf7fd47e51ac93f4ec1ba2d + pristine_git_object: 326ee1a058794d1388fbb80359df9cb21e58566e src/lib/is-plain-object.ts: id: b9862591096a - last_write_checksum: sha1:df687f25a9590b6fd95d39df41a652ae3fd4e517 - pristine_git_object: 61070d3d7c7e5e95b1ed7e7ea21869eb0767db77 + last_write_checksum: sha1:7d043eeb4ab74f94b84076f2cd455e589ad0d7c5 + pristine_git_object: 096b49bf45db19c025e039486f55c6acfb021e81 src/lib/logger.ts: id: 7ee7741a02bf - last_write_checksum: sha1:0ec9d3a2a34c362746b767e4f9a746c055d57a7b - pristine_git_object: d181f2937d4128afbe9b0327e0f81d1fa9c877b7 + last_write_checksum: sha1:6615bc573f4a3922bb6c8cf8080142d9d8afd1ef + pristine_git_object: 323f1895a0266be873f16a924dd58fa500dc97e5 src/lib/matchers.ts: id: d54b2253b719 - last_write_checksum: sha1:d7a7b7c0119d7eaa648e1f31a24add8c7ee3cb9e - pristine_git_object: e8b016f554e634fc27c4d7dde97a31f676f1784a + last_write_checksum: sha1:53e62356daedab29dd01e0bde04f28ed3644a36a + pristine_git_object: 8acbcebd58f54f77be839fae65d167c072015fde src/lib/primitives.ts: id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 + last_write_checksum: sha1:ec6e7e036c52880b3dc5aab709d3b0395085e3a8 + pristine_git_object: bdff1670cd1cb5c37b39df43d8573616e7a568a7 src/lib/retries.ts: id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b + last_write_checksum: sha1:016edbbc4d9ac3b0be7760e034334e7bd7283a77 + pristine_git_object: 0059a5eb667527ef7ec58c24c9f95b634f3c992f src/lib/schemas.ts: id: deb4b531fae1 - last_write_checksum: sha1:0d1b5b0b31a3535b6f9616e6d6c4d67e482f6c18 - pristine_git_object: e06a37fe70b89c88b7a06d61df7100609b69ee50 + last_write_checksum: sha1:4a8427f476877249de45f6605ff3524a44bf3ec8 + pristine_git_object: 35b0fb3e60638aa3d9ed11c19da774255cb05052 src/lib/sdks.ts: id: 8a6d91f1218d - last_write_checksum: sha1:614294f64a6ade1808a8e24674cfbd58df85306a - pristine_git_object: 08b7e41be1460be3f4020a0aff013b835c66330b + last_write_checksum: sha1:2f0391a1eaea82605ca90325e89966b2765de8b1 + pristine_git_object: 89074c11bcb352d27dbbe12e7dac3febe0f932fc src/lib/security.ts: id: 0502afa7922e - last_write_checksum: sha1:43210e0519332896b1e0c0c91f2446f76ce354cb - pristine_git_object: 42613e5c8f1b21f65dd6ea6bf4e02648b069dcd7 + last_write_checksum: sha1:0662ea29ed0ba80e36ad54564d1c8ec5551ad304 + pristine_git_object: 93be85a25dc4e9bbc014e4db8bf6f1fbc2d4fa10 src/lib/url.ts: id: b0057e24ed76 - last_write_checksum: sha1:d124050c7e755c0cce233b9e029afb584ff65201 - pristine_git_object: f3a8de6c021de59c991707946cd294596cae954d + last_write_checksum: sha1:d20760633113236809e01329fa51899bc286721a + pristine_git_object: 99835829bf94169c99cfa82dbb933424972caed0 src/models/activityitem.ts: id: ee2d86453873 - last_write_checksum: sha1:c83167500483c1252f6b849400983fbf32f93290 - pristine_git_object: 435bfdf100b2780147330e9299e3ec5378bb9f57 + last_write_checksum: sha1:8e915d323967ad02633368b086192807830a38d5 + pristine_git_object: c13ce72558d6d7e328189266bca17c00b433ab2a src/models/assistantmessage.ts: id: 2147a953e992 - last_write_checksum: sha1:48f7fc6e9d4b01b9f219485e70d62b9e520db92c - pristine_git_object: 568292c4c8d837b4a5468962a00cefc7215bc8b1 + last_write_checksum: sha1:bdd482fd611591d7a930f858621edf63a42f6526 + pristine_git_object: 6bebeafe2be73485883fe19ecb1a0ab3900339cf src/models/badgatewayresponseerrordata.ts: id: de317517c298 - last_write_checksum: sha1:63b935cd105e2f7bc9dc061a8ba415521df1b388 - pristine_git_object: 48fbde970e35294dd5f224dee6c73c8702347119 + last_write_checksum: sha1:0c142f4aa9e808430a0caffe3c454146875e7c56 + pristine_git_object: d636dbfd200dc7a1bc07129004a043f32f175749 src/models/badrequestresponseerrordata.ts: id: 42d173ee6203 - last_write_checksum: sha1:08b488f36a19dfda862da4602b3fd53deb449c6d - pristine_git_object: c18d52bc6c7f7133685cd6a54b52ad62255b67cd + last_write_checksum: sha1:547c4982242ba692307c23e889e309d53f7f64c4 + pristine_git_object: f2adbe93cad88fc26324f6b9651e5bef9b93eb89 src/models/chatcompletionfinishreason.ts: id: 6b06a4d1562d - last_write_checksum: sha1:85dd018693c035b408e486434a4518afa02b2a99 - pristine_git_object: 57f8af1757ffb8f98afc1f8e964a16a6d75f8cbd + last_write_checksum: sha1:b8825306d92f2cb42eaf572e25e47c91b6216cda + pristine_git_object: 83a32911001440f84720f01833289f1de62171fd src/models/chaterror.ts: id: b107ec938dc1 - last_write_checksum: sha1:3166bfff3461784ce24f9afa427f1104bad53fd8 - pristine_git_object: 62185e7adf72339060d1ea20ba395d59598710b3 + last_write_checksum: sha1:a5b9d65842b3b45bd2f57ffb551aa56a331e167b + pristine_git_object: 9f509fc94bcb4b1c24b5046b3cb6e2b7b637c118 src/models/chatgenerationparams.ts: id: f98a2a558f3f - last_write_checksum: sha1:4a0dab1e303f588246a72cef0fb28603d7c608f0 - pristine_git_object: b9660761d4b1a8246025f203134d1ef2c6c09fb7 + last_write_checksum: sha1:026d8ac70ed0bcefe074a24421fc29e7ce4457a8 + pristine_git_object: 6f601cc60773f896a52ef0474e95f29fd7d0184b src/models/chatgenerationtokenusage.ts: id: 1d57b0d238b8 - last_write_checksum: sha1:8eef10ca15e005e7f20d3d905d3f2aeefac2fa4d - pristine_git_object: e3658f5e8c7623a7ee39ec00a1220f7535b825b2 + last_write_checksum: sha1:aa2f76df6e53bee3299c5984404daf2b64e33982 + pristine_git_object: 07e1115a94c28a6fac9a226af73d577775e156b0 src/models/chatmessagecontentitem.ts: id: bb7f6b29b93f - last_write_checksum: sha1:fa132049e8b4a79a37c98200e906d884b5d7a3bb - pristine_git_object: 6a3617988002a2211c5d2fa881664df8bea0894f + last_write_checksum: sha1:97181a656928af6a5685c7f979bcba9a208e65f2 + pristine_git_object: f1548c67c0983a5bee7ba4e48a5210b981762450 src/models/chatmessagecontentitemaudio.ts: id: 49b1cafcb338 - last_write_checksum: sha1:cbb879b9a569fafd9defb444c25db64d0d4082e6 - pristine_git_object: 288f044da6c2a1cede083eee69109ec13bc9519c + last_write_checksum: sha1:f14db38d815c5200cf67b430d4774df98f338e86 + pristine_git_object: afcdc4c15d5feca07853e6bf7859ad45192d080f src/models/chatmessagecontentitemcachecontrol.ts: id: b5c18e04e19c - last_write_checksum: sha1:02e08d6e619577b5c831293a0b30fff16b486380 - pristine_git_object: 17e69859d7a2f9a8918b9bd20275d0c1c374e174 + last_write_checksum: sha1:5b5b82f909ca6806bb474c6b2d4da5273c28bab5 + pristine_git_object: c368f9535a4557e2e2b00c847ebce3a97ff7b225 src/models/chatmessagecontentitemimage.ts: id: 3989cdc41817 - last_write_checksum: sha1:9a2cecf5a72cd38d6308759f7717b0709866f72e - pristine_git_object: 5e43bf4286f2adf349072f2c3599e3bcc5870dc5 + last_write_checksum: sha1:1350138399239ceae9e2550f339f808bcdc860b1 + pristine_git_object: 2d47383cd7a16fba7c9f3e967eb8e9d077646e46 src/models/chatmessagecontentitemtext.ts: id: 27089860fd98 - last_write_checksum: sha1:5e6b1851c17ebc17c90796e894522c222e5dcfb1 - pristine_git_object: c5218834a7f1232707bbe0288de4fc0f3f284e1d + last_write_checksum: sha1:e5bb74db5c23adf8c3dcc7cee12337dcaa67290b + pristine_git_object: aa527d53b91638159c3f6da7070dca6856f8a8d2 src/models/chatmessagecontentitemvideo.ts: id: 5a81301cb4a7 - last_write_checksum: sha1:b76bb46fac3a9330fcd31d6357b574faff3e8b80 - pristine_git_object: d4d3f3f3dbc9f5696aa52bb272f78f26bb987bbe + last_write_checksum: sha1:033ca3a33e579359fb717f3fabd6ce666df21f99 + pristine_git_object: 9847a91701eb1b038dccd549a763f68e69bf8a4c src/models/chatmessagetokenlogprob.ts: id: eed686a58eb1 - last_write_checksum: sha1:76209db642f0dd5bf1d0feb1157539d9e2f7c9a4 - pristine_git_object: c9364bfddebfd323ad945cdad111b7e52814727d + last_write_checksum: sha1:3e9a418f37f2d9ba5059acd16e1028d12fcb79c8 + pristine_git_object: 327bfbd14e5a110a542b352353195d84735bcab7 src/models/chatmessagetokenlogprobs.ts: id: 2dbd9fc61ed8 - last_write_checksum: sha1:a5647f667fdfbf62b79cef73c8bf47f963f9b0ca - pristine_git_object: cd2e58bf8f95b676d16984e50d608319470ca6ae + last_write_checksum: sha1:7ee84adbffe9c6abc3387568b19091201a14bab3 + pristine_git_object: d898f22a2064ece1393f0554c57c21d84571b1df src/models/chatmessagetoolcall.ts: id: b294b44052da - last_write_checksum: sha1:3fef961472a751d043eb8a799b69f5673db6f83f - pristine_git_object: 3e9a3fe07df82112b27bb2ffc6e8bc2760c1cc57 + last_write_checksum: sha1:ebbd3dde77665a760f24c94518a51f60795cfc47 + pristine_git_object: c6678412deeed6ccd753c5a21b488ffb57ca1f1e src/models/chatresponse.ts: id: 76c3703fa3d5 - last_write_checksum: sha1:258c31307c10f7394ccc61475aa88cc2269d60f5 - pristine_git_object: 81003fe9cb50cd9e5f558c36a0fe50a096e990d3 + last_write_checksum: sha1:539b61213bc60d718988e22076065d2ec606b913 + pristine_git_object: e1e9ede103eab06b70a8e4516485761e20e19640 src/models/chatresponsechoice.ts: id: 7db13c3cc866 - last_write_checksum: sha1:a7b2afbea92ba72355ace567e4a438bbcea72375 - pristine_git_object: 047d5f3f6ab2ac28124846dc62b3f3ac0f492578 + last_write_checksum: sha1:0162303f35fcd1dcabec8202296bb98c825aee76 + pristine_git_object: cfbb8a52398b94fefedc0a67e19efeca3248e9c2 src/models/chatstreamingchoice.ts: id: 15346f0b1bc4 - last_write_checksum: sha1:7e9159c4825b0118442781efc7d8a8b1d6ffcd7d - pristine_git_object: c1a817ce2d2bc412dabb081c0ff523434a8e6e53 + last_write_checksum: sha1:253079ffed3d4e533d1ea98f7b752ebe1d0b7bbd + pristine_git_object: 43fa1d4cf1de1de8bd7fdd33c8a8260a9f6b3602 src/models/chatstreamingmessagechunk.ts: id: 339ee7e4b920 - last_write_checksum: sha1:dec27cde370abd1d0a8155957e32c0781f0951f4 - pristine_git_object: a1813c97d5d909d27519d13fa2d8f223d336f0c7 + last_write_checksum: sha1:12094088ae0cd735b9ffda446baa51486fee1930 + pristine_git_object: 9e132964e29254758e1f809941672f3def5bca56 src/models/chatstreamingmessagetoolcall.ts: id: 74ba154581ba - last_write_checksum: sha1:52b7f11ea3281b9f7a2eb3e2cef5cbc52a9342b1 - pristine_git_object: 45835d9e015bb301d87e0e1667e380667ac06ace + last_write_checksum: sha1:bff3523e97b1d522d79810caaf849509d1d9d280 + pristine_git_object: fc2c3662370bbd065a0f28a9054063c61f28055c src/models/chatstreamingresponsechunk.ts: id: 00bf2ea52439 - last_write_checksum: sha1:29c23bf0fe8a6dc9a662b77af2d09af74d3dabad - pristine_git_object: def0e6c97a45c0cdda14430a88405abf1212faad + last_write_checksum: sha1:c0439824ebf5e916c7ca007b517b6467477de9af + pristine_git_object: b3e9a660ec8dbe9d562bc895bb64ff10f8bd84ff src/models/chatstreamoptions.ts: id: 83ba1c3db4bb - last_write_checksum: sha1:728373c8175f34c5c5e4e9d5f1f2abf697ea5ebe - pristine_git_object: 6a987f766f5285d4215a89ffc1fc13301c357ee1 + last_write_checksum: sha1:52843e897225ca36fe772600a59a39b500c13c27 + pristine_git_object: aee57eed1dd9b80028f71f082c5db3a2ebf6ee56 src/models/completionchoice.ts: id: 86092a0ff4c4 - last_write_checksum: sha1:2106743bedfe82f2321f93c42e6ce80232668501 - pristine_git_object: 326299b1fc39e414376a9efa2cd618b09d986f74 + last_write_checksum: sha1:5bbe7c6bb241ea65dd0597dfda1d43f2c34b15be + pristine_git_object: db6b2a5df71b2ffde7c39974a3008caf844cfb4a src/models/completioncreateparams.ts: id: 44cc0c9c4c06 - last_write_checksum: sha1:e477a4267b37bb98383816b5566ad9dd9b3c9746 - pristine_git_object: cd68cfa2eae53f470179a598cbbfa251e6f15bd7 + last_write_checksum: sha1:ccd442fb95695db1a90ede9a642460169c86cba9 + pristine_git_object: 0c5a338cda882b22badcf1639c043ab52e5478cb src/models/completionlogprobs.ts: id: b6552175348e - last_write_checksum: sha1:f3a01fb8507ecfcf0de753f5827e23e6d165c209 - pristine_git_object: 929d528665b6a6cf8caa977fe873692d84524918 + last_write_checksum: sha1:ebd3444277bf1c26c2258f369e3dfc09efc76850 + pristine_git_object: 17fb1848a39d1c32846b3844aa91ce8ee300101e src/models/completionresponse.ts: id: 316ab9f7e558 - last_write_checksum: sha1:7578f49798897728b388e3a2b7bf257f016a7fbf - pristine_git_object: 9dc714bf1fb0e92fb832df1c92953cb89f3b4f45 + last_write_checksum: sha1:01dbbabca4835817b57d5aebff0667215d427740 + pristine_git_object: 242ad6bdf7710164dd5217caac486d13a96522b0 src/models/completionusage.ts: id: 4a222248409d - last_write_checksum: sha1:d070efe4332641b5c29b9e91e3ba0dbdac50e6f8 - pristine_git_object: c5cf5a17189f34ffd6af76caa27ed7a53a3d8f7b + last_write_checksum: sha1:a1c18df2112d51b3a4e98a2c0c13d8eb6f308adb + pristine_git_object: d278ff1d4fc502bddbc7703a7f1a881c4271a37c src/models/createchargerequest.ts: id: c342dc72d1f4 - last_write_checksum: sha1:d745f830c99af4baab7f0e25005832a48d1582d8 - pristine_git_object: 7d5ad28860b88aae88eecf8d02a708c1fd5a429c + last_write_checksum: sha1:c57248f3591179c079ee972d6e5fed7ae0cfa50f + pristine_git_object: bd6860c3f634b462352ea4ef1c9df35983435161 src/models/datacollection.ts: id: fa417e9ad79a - last_write_checksum: sha1:4f506509603e4c0d4f54b6e883a112f334984416 - pristine_git_object: d2dfe960e9fca9e5d165421d4ab46528d10c0a2e + last_write_checksum: sha1:2245458d063c9185e8a0be3cc77fff435750853b + pristine_git_object: e075ba95073bbb9e5e43b32d75dcc1c48a1cf9ce src/models/defaultparameters.ts: id: 8da6fac53cb5 - last_write_checksum: sha1:8105657bfad4d231260eb87e9baa6c09162ad109 - pristine_git_object: a9161e79dde147c3b4cd2bd0a1ea9485018955d5 + last_write_checksum: sha1:f80ad4685bda90bbf12e6e56c20991e89839c05e + pristine_git_object: 25444216c0d85142b45910c918e47e8cd5808e42 src/models/edgenetworktimeoutresponseerrordata.ts: id: d86e84250105 - last_write_checksum: sha1:57d62f5a62dc76692e5d437bc5af3e81f61cfd4a - pristine_git_object: 4f119ada10ce54c1fcc4034718dc55487d93e0e2 + last_write_checksum: sha1:97f1a32869159e48b331c2bcd5fcb220e6895dc8 + pristine_git_object: 913dc5af515933a3c58b3f0bc0d90953198a720f src/models/endpointstatus.ts: id: 83efda25dcf0 - last_write_checksum: sha1:6e4cda25d68c2254bd3ddc1744c29ff14ff826f7 - pristine_git_object: 0a64d91d073ca974b904842f223bc751c4c2d84f + last_write_checksum: sha1:524ec06d8573df95f0a5d2daa1782106d1f7c7fb + pristine_git_object: afd9fedd3b5285d3929fb4c6f3069b7423412d10 src/models/errors/badgatewayresponseerror.ts: id: 6264bb9f01d6 - last_write_checksum: sha1:d3d8bb6d3425fa029c483412465b5084d2769871 - pristine_git_object: e7882291889b19372978e5969d717ae5ef68cc46 + last_write_checksum: sha1:32c26e4f3668a52b04dba2400c7d0fb31f460a57 + pristine_git_object: b958b87cdbf1b9b8406a475a46f1c47a87b1108f src/models/errors/badrequestresponseerror.ts: id: beddfd22a313 - last_write_checksum: sha1:cdf3261ab31c89270ad58436d3efefb331539157 - pristine_git_object: 78ee4b48e4d138ed4d85ac0bca92148cac09072f + last_write_checksum: sha1:03d18a4e841ab897dc6c4a207c008def161679f8 + pristine_git_object: 7d2b7ba7cc3294067cebc9cd82784971f6336183 src/models/errors/chaterror.ts: id: a3b18e48f494 - last_write_checksum: sha1:8bd76a816df1759116c0d3db6b4c9316f670acd4 - pristine_git_object: 6b59af29764189c8fd16b9dfe9ba82285513a0ea + last_write_checksum: sha1:8502eef27ec1004acd59bd2e2cd8b6806ee8ac02 + pristine_git_object: 33cb7e5abe27c4ef70e9be5c8f86c1f398364912 src/models/errors/edgenetworktimeoutresponseerror.ts: id: da53f308c771 - last_write_checksum: sha1:fc8071346c5e764fb158daed90e84a1c02d3dff2 - pristine_git_object: 6e76cb1b050a2db98631f757d37f1da49611462e + last_write_checksum: sha1:746eafb997c4d7ebcbd22327bd72f935a4fd3798 + pristine_git_object: 6bd7dedf022a34142a5b146a6620509e161d22b7 src/models/errors/forbiddenresponseerror.ts: id: d08a9d9ee588 - last_write_checksum: sha1:ec6ac749b7091a4d17cc8987e5193c79027323e0 - pristine_git_object: efc9de83ab26ac64698726c71983af0a3e094423 + last_write_checksum: sha1:36bb725e627333d99c86d9a42f2e14dba57497a1 + pristine_git_object: 1d464f8b92632a3e7dfceba3ca4717fe6180a7a0 src/models/errors/httpclienterrors.ts: id: 6948de76af99 - last_write_checksum: sha1:994ced121c54fecd0af038ccfb7855fbfd3868ec - pristine_git_object: b34f612124c797c2a1106b9735708f679a90b74f + last_write_checksum: sha1:ecfe6470690d643550eb3f425796c18ff9311aa7 + pristine_git_object: 53bb3cfae157b89fda8e4a5b0f1dd709da82c1c9 src/models/errors/index.ts: id: c4e22507cb83 - last_write_checksum: sha1:dc922cc8e432cac6dd7de0c511b7cfbeb980ce7a - pristine_git_object: e0890b3da57a39d77d72904b7cc0211a6ab33439 + last_write_checksum: sha1:7d4d84edaf25b9b9b70b3f56d00188ac30c75e2e + pristine_git_object: c5ddaff0616208d105296f039ef1131e8e9c3f76 src/models/errors/internalserverresponseerror.ts: id: 02b76cec85f0 - last_write_checksum: sha1:e6bdad48c9d6cc4ae0d7b012411a3a7b771ec0a7 - pristine_git_object: bde8483e484ec23cda52b77cc00414ecb762a855 + last_write_checksum: sha1:f1064e995c554473167d4b55284ad1e55283e4e4 + pristine_git_object: c55187c8babb85a71ea386e946aa32a5389be3b2 src/models/errors/notfoundresponseerror.ts: id: 1914d6d7fbaf - last_write_checksum: sha1:9a893ee9d2b64dfe4e529d5067632f136356d183 - pristine_git_object: e3e8f126144f85e13df4cee1643c858b29ba9bc7 + last_write_checksum: sha1:67ce64147c1cc826a18666126d84b61c8de76225 + pristine_git_object: 012d7fc70f6bfdd383d3e964ce71dfa7014f6a63 src/models/errors/openrouterdefaulterror.ts: id: 8a3f2faf1848 - last_write_checksum: sha1:ae348cddd0a1bc951168ee2b9f01fde49aef220a - pristine_git_object: a60c29d3c4bdce3e42ca1c4d582c19f76909f94b + last_write_checksum: sha1:9df2adcf5a6810efd42bbf81eb34d00d3d164d27 + pristine_git_object: ed1b4f735b5bbf7a71e7abf1d1d0c153312c5d63 src/models/errors/openroutererror.ts: id: b030240a8442 - last_write_checksum: sha1:ee0b042319a993d42f3586113e0864ab69c0967d - pristine_git_object: 0ef8d3bdd3bd1c0f58721cb2df11a16385bf0f51 + last_write_checksum: sha1:ed9a58ec59b483f0c4d7e2a13f7e74040624c9b1 + pristine_git_object: 2c0023c429fbf19f335fef603c6f7c1f031fde9c src/models/errors/payloadtoolargeresponseerror.ts: id: f1e472cb7b51 - last_write_checksum: sha1:78216f13f781af1eaae62a55ea9961203f560a8f - pristine_git_object: ff30548b8c165cdf8b7a4b4ea2b82418fed3bb71 + last_write_checksum: sha1:6523fbd7eba5e365cb2962584c6b44523fd5bada + pristine_git_object: ad0ab4bd5121808e7a650021a7c06abb77e00415 src/models/errors/paymentrequiredresponseerror.ts: id: f70439757fb9 - last_write_checksum: sha1:e511bf33046ed00ddeec211471246cd139dbffd9 - pristine_git_object: 7943bcd5993c24a6f475ae3211cb96d2543d1a4b + last_write_checksum: sha1:592e71e2207a2fc1da0cb427525365c94cc37ef2 + pristine_git_object: 70f8350ecb52321481a9bbc73657d35cc9ac7383 src/models/errors/provideroverloadedresponseerror.ts: id: ba8edf813fa0 - last_write_checksum: sha1:e18fb8952ba8adbdac2ff98426ab4cd599a6d649 - pristine_git_object: 977f9f3e78988ad62d0ad3df00abf7cf3ed93b48 + last_write_checksum: sha1:61aa6336268151598a1f2dc3cf1f06b258f29762 + pristine_git_object: 6af814f9b2462518afe9035ecd6ca31882a4d2b7 src/models/errors/requesttimeoutresponseerror.ts: id: 3a4a755c8536 - last_write_checksum: sha1:7ebc27c7709affbd621226990df478ea0340fb08 - pristine_git_object: 0a4dbca1abb83044dd779d5fef612c041cd6ffe3 + last_write_checksum: sha1:64434d5c356c22a392d0f4718139e7ceff87eb6f + pristine_git_object: b30969dbbe3aa5c0df6bdbbbb5e946e432b187d3 src/models/errors/responsevalidationerror.ts: id: 88ff98a41be9 - last_write_checksum: sha1:e794f3e94d1804d0f20774433e0348f183892549 - pristine_git_object: dbc35f5f7228ecc066a2a591baf832629159ad70 + last_write_checksum: sha1:f848de7d3e7ecfed234c0324f53852e419dd5349 + pristine_git_object: be62cb8a3d4915c759e4fb7656e1fc530afbf230 src/models/errors/sdkvalidationerror.ts: id: fb6b2b49c445 - last_write_checksum: sha1:92771987c251f02fd86cfd824a3be709cd3c2837 - pristine_git_object: db00022e05d55600252f401eb0e6ab46278e0b07 + last_write_checksum: sha1:e2528d1783b4b63ad93bedd9e6ace66d8d4939e5 + pristine_git_object: 35e71438cbf0fdff25ab016d161d5f5bc6f58454 src/models/errors/serviceunavailableresponseerror.ts: id: 1259f9d051c8 - last_write_checksum: sha1:46e31bced94d8a014695b7565b6c382908c05124 - pristine_git_object: 2398a2d400ee221f2bf9e46a739c5332a1a71dea + last_write_checksum: sha1:7038fa6d1b4b7a75c40a177e9115045e3604756d + pristine_git_object: 1b11022a6e003e1d1112345c460c89259d931621 src/models/errors/toomanyrequestsresponseerror.ts: id: ab15bfa145f3 - last_write_checksum: sha1:c1e5b2533fb640100ef7c4a95b7691367a3bd64b - pristine_git_object: 72f952e6e7995f26b1ad23d1bc7445a0a0ab284a + last_write_checksum: sha1:381f7aec1bea98b2f15d6e0de1ad3ac77baab629 + pristine_git_object: c67e4d8409f0c21c42b06501cee4668873bd20d6 src/models/errors/unauthorizedresponseerror.ts: id: 79ab0861cf08 - last_write_checksum: sha1:3cff59ca5e6ca0a322bcb750bcc4de03896893e6 - pristine_git_object: 714c269fe8f0bc675508e23380230ad54be7d526 + last_write_checksum: sha1:ef8b7edbb61ac25b202ae494cafccabd461c8d7e + pristine_git_object: d6258e103bcda2502c6ca31b77e134304aab95b6 src/models/errors/unprocessableentityresponseerror.ts: id: d81e01bbb5e3 - last_write_checksum: sha1:4ee6addba89fdbc1c9443d3e945b43f5bb0ae971 - pristine_git_object: 2c35cd2c4466ef967b9057a188d9315163a9c219 + last_write_checksum: sha1:eb2a71c92c627a2e1988f64b780c0071425024b6 + pristine_git_object: 4ece53ed4524690d931bc6e093745191778ad965 src/models/filecitation.ts: id: 0e609723dbc8 - last_write_checksum: sha1:661d4a913fc443eecce2b8bb29edb4ff4bfd85fd - pristine_git_object: 00b7a5d751d95e79dc2a2a527fb6369304e42e58 + last_write_checksum: sha1:b823780174bbb546e312d6b149d47bb00e0d8318 + pristine_git_object: 665445c5db6cb969c75fdbb7063462e6bd33e43a src/models/filepath.ts: id: 0f8d4008ed8e - last_write_checksum: sha1:def5315ec45c84408db4213bcaa544cb7755b6ba - pristine_git_object: 08abb4110231944dabb86b9d1f570398be2a10dc + last_write_checksum: sha1:e1f7983eec9a1c7c19fd9e704ccd7546c77e117d + pristine_git_object: 90ff601bb8ca46eaba0d038c745163a5c8493d6c src/models/forbiddenresponseerrordata.ts: id: cc3fdc45a2fd - last_write_checksum: sha1:e94944b71821e29ea72eb19b0c98cc163257bbef - pristine_git_object: 95d7139adf56ae94e21c8354f588b80871adb2b3 + last_write_checksum: sha1:81bef9546eb570e81c3bf3c6fa65175361411860 + pristine_git_object: 2d84cb3df1c56b7e9403eeeb39be1a98f9871e76 src/models/imagegenerationstatus.ts: id: 2a72a5923e5a - last_write_checksum: sha1:e73d18f248e5a2ca1b6b75b55e6ca939a0fa672d - pristine_git_object: 448a4bc9688f2bde040a79dafd799e8d31eca3b8 + last_write_checksum: sha1:54850900dd3ae1504340efdc87f6435f4dc4e21e + pristine_git_object: db61647cd182502b2b3b5333ee3a0bba66542645 src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:0b3713e62f2be27a1e412cecce6c958cd80c9060 - pristine_git_object: 75a970068825ee8213ad6205302f32c05d145668 + last_write_checksum: sha1:4c6711366cae8318ef49436b6954263af7b268ad + pristine_git_object: 1d8403af8887cfa0744292621fa0f15a4557001e src/models/inputmodality.ts: id: 771d5d4c91ec - last_write_checksum: sha1:04d402a4a95a9b212222c4ba2e660606d142063a - pristine_git_object: 7ce05bfff824d2f334abc94eaf801bb1fdb6711f + last_write_checksum: sha1:7f742bf5a1e6b7953ea96df4c4cef29c602accad + pristine_git_object: a92bcc401c21e9213243e53629ccd4e673a94c12 src/models/instructtype.ts: id: 970f140dadec - last_write_checksum: sha1:f43dff30edf3e9d9fd18c284ab9e7d4cc2f19f24 - pristine_git_object: 2353fbb01e1afa407886a12377e17382ce3bb313 + last_write_checksum: sha1:2ae5a96b5b1b17262191d656b6daebc594966684 + pristine_git_object: 339d2ae8ea1481ce2773571d214d8ba0966161be src/models/internalserverresponseerrordata.ts: id: 48c17eec376a - last_write_checksum: sha1:83305c345ce601e59f9f366f1143e2a272ebe892 - pristine_git_object: cba306821a14922d3d5f9622d3056b5abffbfc67 + last_write_checksum: sha1:dd8ef69e1787fe3a496c4142a1c47cf38cf62ffc + pristine_git_object: 1676c40a5b6dc5646acad69089007f2e43a1bd61 src/models/jsonschemaconfig.ts: id: a5dbdd0305ec - last_write_checksum: sha1:2544250b3217841e77a2b2727d4826cc701010b8 - pristine_git_object: cc17f5eedae6b9fb1540f459e28d50f8f12834d8 + last_write_checksum: sha1:045b19a579875de278fd4ad5b9868c593368bfeb + pristine_git_object: 4ea4757a1a0a9e26f469bbaa98935a2ef72574e9 src/models/listendpointsresponse.ts: id: 5178e92a44ba - last_write_checksum: sha1:9ce7fac127a95163a3a36b7e56ba2e2cffb780b9 - pristine_git_object: 184395b4844cb0dd5fe0568023c0fb2938e3fa32 + last_write_checksum: sha1:f14d4f1bb0115f6de83613d6d946bd75ec47322a + pristine_git_object: b6d6af839a15e92f869817c5cb03cab07a8461bd src/models/message.ts: id: 34645e53d993 - last_write_checksum: sha1:88b34cf06c2305e624ad6a3803ea8b00bcb57093 - pristine_git_object: 616bb49849bc2334f96dd5c7c4158da57efa20fb + last_write_checksum: sha1:87f83e2d3e3838a320389445e934d4eb190af9e5 + pristine_git_object: 9c6974a680e006fc1cb3f31cf6ef42aa828d6af9 src/models/model.ts: id: b99d4c14e794 - last_write_checksum: sha1:a18bf75010e41d7b69c87065a8bf0c67d1513cad - pristine_git_object: 656b3ff5eb4a2e485ce69a0a8bc35012058087cb + last_write_checksum: sha1:bf33e24172cf4069a8bf60dcd70b9076678fa65d + pristine_git_object: 6248dbe49301a0cf6f4e23794b6e0ecd0c1b0ade src/models/modelarchitecture.ts: id: 57607576095f - last_write_checksum: sha1:4f4ba8e4474e49dced3226b71063e4993d5fd220 - pristine_git_object: cc1af3ba009fdbd7aee7d85aeda18373d8c31740 + last_write_checksum: sha1:bb77b74a29ec13ae559b909ba2d03b5bbd4bdb42 + pristine_git_object: 7b404df1aaaf83c01d4d02e47a63539d56cb65bc src/models/modelgroup.ts: id: b65482ec4223 - last_write_checksum: sha1:77c55027cd02669568ecd0d7e9651efa14f86af7 - pristine_git_object: 46567fe6f9a8599d970b3336862a818babb39875 + last_write_checksum: sha1:71c1363901abacdf5016cdc23c6642825e3b7818 + pristine_git_object: 9c40d281d50644248ff88cc05e7f63514b519504 src/models/modelscountresponse.ts: id: cf41f6279453 - last_write_checksum: sha1:2115a0b97e0fb9bffc2a363cf56b185f79718192 - pristine_git_object: 370d489b3a7340fd366cdfc300e21c51d86da2c0 + last_write_checksum: sha1:fd465602592fa0ddf0b22bdf05a97866c31e5503 + pristine_git_object: cb6c47ea1a24e1f6e63221ddf7ce3e46183b34b9 src/models/modelslistresponse.ts: id: ea0e62a13d8d - last_write_checksum: sha1:5d909a1db72e0a30c9d2aa868447cc5a2b5162c2 - pristine_git_object: b36813b7feff3419606333f152eb47b78a98a92f + last_write_checksum: sha1:0beae3a59e783ff5e4a4b444b16e6227a5024f1a + pristine_git_object: f3fae481c3a9a4c1461521e18e9693de9c291846 src/models/namedtoolchoice.ts: id: db68e36b6a77 - last_write_checksum: sha1:f9d776092138ceda19f935352588cf01720cb420 - pristine_git_object: acc523e53cf32a4bbf1b26ef94d0d9b5dde888ae + last_write_checksum: sha1:9e527a0fd2b2f0deb5a8eb82a5d4d1cd8cf5f10b + pristine_git_object: 1603f2c885891df5f3ed6c4e5e9ba57eac02e573 src/models/notfoundresponseerrordata.ts: id: 6c2943dd4f02 - last_write_checksum: sha1:714a58d39f73ed1e6c5157df67ef1df5b3dd94e9 - pristine_git_object: ba991ce7084c0895b2a6697a7bd4a6421dfeb16d + last_write_checksum: sha1:cd0ce3ea1fc6a309f88347c58a6d62cf9814f354 + pristine_git_object: aa237f7f6b89ed4a65adbff5d1fc12514cfa11b2 src/models/openairesponsesannotation.ts: id: 5828fa2314e3 - last_write_checksum: sha1:58d10118b964394bdd3d854fe022826aea2c4d91 - pristine_git_object: 7720e9dc180b202fca98de2ef9caac7162260d4d + last_write_checksum: sha1:98d25d1c2d24ac1734d757ddae32f5cee7354589 + pristine_git_object: c402006e91b690092d1597532b555f8656de100c src/models/openairesponsesincludable.ts: id: 3b5ed15267fc - last_write_checksum: sha1:ca9804b78c15186008f15b4173046cb9174c9afb - pristine_git_object: f377c38ac9d409a683d3aaf6fc3ca7b717c3d0ec + last_write_checksum: sha1:59c7e3013bf68b904ed02938a87e9c2f45a1fa9c + pristine_git_object: ca3d42fe6b546ef89e51d6444d3c7111793702d4 src/models/openairesponsesincompletedetails.ts: id: f2aabee6a438 - last_write_checksum: sha1:0bf77bda66d42720f60ed31056e7d06cb943c9d0 - pristine_git_object: 03fb41a8b1d84cfe6592106bf75840fa4c6e76ff + last_write_checksum: sha1:12dc455862896cd6cb259761d6b25582e1fcdd4a + pristine_git_object: 0e524e09e7708246e4b647b921f62cde3c580eba src/models/openairesponsesinputunion.ts: id: 0b061e126936 - last_write_checksum: sha1:4b88e9836df2d35a7c10b286629ec63680f89149 - pristine_git_object: 73702880274805d14046f351a552c528847e6701 + last_write_checksum: sha1:b03f752917570119deffae3584738191e4b24be3 + pristine_git_object: b840e4148f928d3fec131643b1107319456d1e26 src/models/openairesponsesprompt.ts: id: c583d897e9d2 - last_write_checksum: sha1:ed092f47fcb4e10a33194bf9ca313e34fc7f5fb9 - pristine_git_object: 91c80fb2b35f210629ac412124e35136c50eecda + last_write_checksum: sha1:894340f6bb585e936e0b62459ca01521b2a420ab + pristine_git_object: faf39e855f59fde332184d397e47fbb32502eeb5 src/models/openairesponsesreasoningconfig.ts: id: 60a66fbc6068 - last_write_checksum: sha1:23943df1fafbdf0f03c61121f336dbad6acf88ec - pristine_git_object: f8b75c5c5047bd1e0ada349440d055f64797f707 + last_write_checksum: sha1:00ef6efa11d19d9c294b889025ee06ce4f890a27 + pristine_git_object: eeea2c05c4e1d2d9e9b80e8c335f0f64f40621d0 src/models/openairesponsesreasoningeffort.ts: id: af69873eff63 - last_write_checksum: sha1:910ef8201949751ea2ab308d0014f5dff7935a81 - pristine_git_object: 97d8746dad246f6678fca722ae8ab3e884c0bd44 + last_write_checksum: sha1:293ef33861d72420cdef63e867b3dee972e69a1c + pristine_git_object: 9d53b5f5bfd8d0440d519c6540db9953c731ad96 src/models/openairesponsesrefusalcontent.ts: id: 5445ae4a5385 - last_write_checksum: sha1:1a3b8e656ef77b9cc0453de7529677637022f231 - pristine_git_object: dd3273b1fd9ef23636664388590865a388972739 + last_write_checksum: sha1:b72f18c622cecdddcef3151129be6c253c87ba8a + pristine_git_object: 2252e00a46bf9fe84addb125cf30c4b23a536028 src/models/openairesponsesresponsestatus.ts: id: b721d7085e40 - last_write_checksum: sha1:0b342c7f7219cc54d3d2985f140a33ecab2255ae - pristine_git_object: 7d0c0764de51ff514e7f362e01cb95df084f37ee + last_write_checksum: sha1:7c43c337905b898b35a2b379a9a2eb5af6effc12 + pristine_git_object: aea8bf92ec7d91eb7439ded4155f8d82ba244974 src/models/openairesponsesservicetier.ts: id: 88b4cb1f9919 - last_write_checksum: sha1:2843242dfb584627af72541fc7af6460566d778f - pristine_git_object: 6189fd19f5911b6f1bd2f4d13f0d8f2e93675737 + last_write_checksum: sha1:92beac700b8d4d2ab177bea088dc8ee238c244aa + pristine_git_object: 8299718db69b926f5c2822924b1437d2ae630665 src/models/openairesponsestoolchoiceunion.ts: id: 73d80db9cd46 - last_write_checksum: sha1:4933b5658695678d5310d69dab89ef42a9a25db5 - pristine_git_object: 5c98f0158141d9ed86dffc8caa9c7e5a5aba43be + last_write_checksum: sha1:cd842307394659cb6c333d534ee3e589a5c6b826 + pristine_git_object: f35263df3e3a8492a0ddcdbfa786ecab3b4464cd src/models/openairesponsestruncation.ts: id: 03de9ac74888 - last_write_checksum: sha1:6ef1e45daf94eca65390c4cc1d842b9094151345 - pristine_git_object: f556163bf8728dce4b7e83135f571786aa3b1819 + last_write_checksum: sha1:ff47af51453cdcd62a077ccec9e4d7c8d7fd2925 + pristine_git_object: b307aa9dee0c43f804012a762e4aee6dac13b2a2 src/models/openresponseseasyinputmessage.ts: id: 9cae543ceb47 - last_write_checksum: sha1:9ddffe9c088680ac390dd58ae94f77937aed2928 - pristine_git_object: 5e75df15e4e84d63daa7b167ba593c041cad34fd + last_write_checksum: sha1:c7d593f736a7a9f8d2c8ae79d53fb0a4d8dc97a3 + pristine_git_object: dedeed37a16718c81574e0a8d3d05c68d71997ae src/models/openresponseserrorevent.ts: id: 508880501ed2 - last_write_checksum: sha1:b2b7f3092bb1adc15c9bfead4a487cda97174470 - pristine_git_object: ad39bdadee1486c999aff47012af28b85b1254cb + last_write_checksum: sha1:f64fc658f9aa9aa938d12df43f0bb42febedeb89 + pristine_git_object: 6585539c0ed65de9839ef4cc08e686ba47601b8f src/models/openresponsesfunctioncalloutput.ts: id: 5e801f7b2903 - last_write_checksum: sha1:06f5452d25a971be0d204bef03831b137cea851c - pristine_git_object: 58f5bb1770f8c0a2787bf5575c00e18942553230 + last_write_checksum: sha1:34c7f9aafb0eb39fbd9bf25451a74655366c7c76 + pristine_git_object: 0fe2b77d6be7c11e7d622254a27eae7c0cff7372 src/models/openresponsesfunctiontoolcall.ts: id: b028e3118a4e - last_write_checksum: sha1:6dd570ce1a1519c2c170ed8a6e9acbd5a1059cac - pristine_git_object: e39788321ff6ff55ad64915ca768977c91add9a6 + last_write_checksum: sha1:d8a6947650a52575bdd82a5506dba09ae5af9ac2 + pristine_git_object: b3b12fcad5e6d68a753a919e6903cf06c1c3860a src/models/openresponsesimagegencallcompleted.ts: id: 8f2a1c3fbf5d - last_write_checksum: sha1:9fd2153adea9fd863251dee6c8f1cbb939156cfc - pristine_git_object: 83345a07a62bf8c5a80da6df6087a056a2038361 + last_write_checksum: sha1:6ac3e1ffa3b64f64699fb7df64e62d42f6bb7e2e + pristine_git_object: 7b5eff27f46addc739eca488889c5103502441bb src/models/openresponsesimagegencallgenerating.ts: id: 97b22c3fad75 - last_write_checksum: sha1:8077dc02f791a5fefc0c437befdbb8082a43c3c8 - pristine_git_object: 71facbf7f7c57cba980fbc21a09086d7d1e897ac + last_write_checksum: sha1:ce16fb0852f7bb526ecee9cee8d0b0221aa0715f + pristine_git_object: b06bf7fde55b2b7b1972f7bb91a4c4e28038b725 src/models/openresponsesimagegencallinprogress.ts: id: 402a8da9c8da - last_write_checksum: sha1:7b2b38404a4f7f61460d8d34d7058807cc1afa0a - pristine_git_object: 04bb03c9fc4b8b2b6f306d0adedaad74fb25925f + last_write_checksum: sha1:6ae1b427492c1235875f28ffd22599a3db472eca + pristine_git_object: c04765b174db0cbc7c5af53769541a4d86e00dcc src/models/openresponsesimagegencallpartialimage.ts: id: 053a18912617 - last_write_checksum: sha1:fdffcd35d7b1a5e33c18dbd74364a63ad8531218 - pristine_git_object: e21d39d528ac08ec2cf055f8532b54b339816aa4 + last_write_checksum: sha1:e3333a3fd5d2347fc2f437b39c0e3ad90d15974d + pristine_git_object: aedca4024109efcfb80bb8082b57795e66b3bcc2 src/models/openresponsesinput.ts: id: cc6c94fdea13 - last_write_checksum: sha1:990112ca283ab45969cf9093551a47f3d98eb0aa - pristine_git_object: ce9a2391a3b3854d81a025164cbcda6923a34f50 + last_write_checksum: sha1:1f5ecddff0c350568af1c58addbf6fd550580a21 + pristine_git_object: 7f007b7afb5455aef6460bf3a382239e0bf6fb1b src/models/openresponsesinputmessageitem.ts: id: cccc4eb21a9b - last_write_checksum: sha1:71a8fe7bec5710b6e8a08d6a7c5642fdbb058d9f - pristine_git_object: 4f21075391b91c9d6b1eb145bcd2e8d2c88f7f59 + last_write_checksum: sha1:628174dd61c90ba8867d7d3d07630705e1e4d001 + pristine_git_object: d95f5d2900cde5020d37e3c83f62a6651efe6b46 src/models/openresponseslogprobs.ts: id: 7ec69a3158fc - last_write_checksum: sha1:0e2f66e51829ea803937714d7d203622eee31483 - pristine_git_object: 567cdfc49f813abfc807f0ef640a81c32ced6882 + last_write_checksum: sha1:35ad33aa6ae476ba091a2741035a9eaae2eba655 + pristine_git_object: ea0b9a92edcb6803a0f5a691859f11ec5a62561c src/models/openresponsesnonstreamingresponse.ts: id: ffd6f7198dd7 - last_write_checksum: sha1:e06be2151c68648f4601f35d0ed9c5bc567f9d7a - pristine_git_object: 2467beaa042ed9a6e8c6d6aaf3d3336d974775f4 + last_write_checksum: sha1:ceb40e97b8ebe234991492a37a7e5f7f0e5be1fd + pristine_git_object: 5577126769d0a1d8795c1eb913f13a82ed5e40f6 src/models/openresponsesreasoning.ts: id: 296442f2d24a - last_write_checksum: sha1:124f44af8098e521e0926e4ec0b66fe124fccca4 - pristine_git_object: 22ec11c4e763ec6d28012ab9f91628cb47d52081 + last_write_checksum: sha1:866baeff37e619389173aafe2a28252df8100998 + pristine_git_object: 2bf9ff6b318e600f6e6b69b181af6589164f06f9 src/models/openresponsesreasoningconfig.ts: id: c2f9d074fbd4 - last_write_checksum: sha1:dab6edbd0760c6d2c941d181ec57737a6efcc2b4 - pristine_git_object: f4e607ba3a5c509c7f66ac0e46793101c4e43ef6 + last_write_checksum: sha1:fa4a78f97745f137635f0cfc25d6ea083d620906 + pristine_git_object: 6c2046fad179a3bd3a0ea49ce879007250b63235 src/models/openresponsesreasoningdeltaevent.ts: id: 32b751d1d3d7 - last_write_checksum: sha1:de61342cdbe537b6a9787bc4428c5371284c86d3 - pristine_git_object: 82853c016e824f7894ca70b3f76060a223cbd6dc + last_write_checksum: sha1:db1e33644b6b4d57c087be3e43e1c93fed5ded39 + pristine_git_object: d306e0a7f83952bd044a605021698ec6451202ef src/models/openresponsesreasoningdoneevent.ts: id: f76803b0bdd0 - last_write_checksum: sha1:16b84307df7011d6a6998999758f02d576426451 - pristine_git_object: 5d0374173359f06d1f8de84ade7c6a010fd2c2fa + last_write_checksum: sha1:a6a836273321173c2f174950267f61a46f5ffc0a + pristine_git_object: adafa6bf7982ae5adbb45ec77775a0712956c77a src/models/openresponsesreasoningsummarypartaddedevent.ts: id: e83b9ca2ee64 - last_write_checksum: sha1:29a8dc7b2693824a57edcf494ff6f7a0564c313d - pristine_git_object: 2aed51bbfb96d6ccc2a4de0c40a20ec79723da83 + last_write_checksum: sha1:b0ff4bfa98f15500691f3499c387a414fbe6db23 + pristine_git_object: 1a65568c35681319943567bb1fc50d3543e09148 src/models/openresponsesreasoningsummarytextdeltaevent.ts: id: 61ee69f0a41f - last_write_checksum: sha1:053afc7f7bfe8ffe692ad048440be52af2479570 - pristine_git_object: c0160cd6369e7e51fe9dbc3437c29782f12ef9c9 + last_write_checksum: sha1:e1e77ef37fc15d734b98cecd7b2f0c2ef58ec27f + pristine_git_object: f29f6bbeffeed871afba75e5545b89f00e2c26fd src/models/openresponsesreasoningsummarytextdoneevent.ts: id: 0519f084cea8 - last_write_checksum: sha1:f0e96ad9ce2fe08a74226ccfb4ead662a3c5db8a - pristine_git_object: cced6a236d8c0805037103185c849d60a77d82bf + last_write_checksum: sha1:11a20eff2c1da0df0fa601bd229263940e57d322 + pristine_git_object: 438e3268f5050c6e3e4899d019e9671f0ef9a556 src/models/openresponsesrequest.ts: id: ff8a31d46b1c - last_write_checksum: sha1:2d717a750c127666de8f4616aa93e7071596dabc - pristine_git_object: c53f8ce597e1281789728ff535b750ef0b006109 + last_write_checksum: sha1:ea3cc2e6244845f2f1c072bd47f787f0fd30cef5 + pristine_git_object: b415f732bb31bf8198b94704ae64193ed393cfc2 src/models/openresponsesresponsetext.ts: id: aded1ce23b04 - last_write_checksum: sha1:924732505d56228922aad89847905d723b4fd08c - pristine_git_object: ee8a07de394798ca2c28a195af85f261a0850635 + last_write_checksum: sha1:5046f904e0b5db52fbae46d9bbed94d651b7b0ef + pristine_git_object: 56f6d642e41d2a119132b241393635773351a023 src/models/openresponsesstreamevent.ts: id: bdd51c7b4bd0 - last_write_checksum: sha1:97374f8906b62e662f421c9be90a17c6d92707ac - pristine_git_object: f38f9125de92422689b2775ab8302c2444c9c39a + last_write_checksum: sha1:c153529e5933f62f3c594b7317a299d94bcae921 + pristine_git_object: 40398c799a376c4cef10861666ff9a62f2739c76 src/models/openresponsestoplogprobs.ts: id: 9deb0a6359d1 - last_write_checksum: sha1:5636c4a49078ef7dbbccb6850d7a81cb8893b22a - pristine_git_object: 88ce3acda7cc1865bc839a5c7b653de00b3daac4 + last_write_checksum: sha1:4cb5a273ab1f51f765bf80e3370eaec7562a0f35 + pristine_git_object: 12a5897e511d949f84f8bf5510f754dcd28c1721 src/models/openresponsesusage.ts: id: 806527de3bfd - last_write_checksum: sha1:c193d8d26c795958a2f117912cefb08a22533628 - pristine_git_object: f083cbbd1e34342ff12cd5f4ec923ace2adfe276 + last_write_checksum: sha1:9da14e86f7f6f2dca385ee64a82e19078851ee47 + pristine_git_object: 736c97893118d919b02df9604d8a92ffc469f1ab src/models/openresponseswebsearch20250826tool.ts: id: 7650f38c7184 - last_write_checksum: sha1:f58e326ece947a4e0fdf372f6b913f165bd70ea3 - pristine_git_object: 2b54b4f118236a16e04ee8d103616e83ea01469e + last_write_checksum: sha1:ec2fafa444d8b9f83c30e10116ae377974cc2504 + pristine_git_object: a8ec3ef2ef257fb04a500ccf42a5c93c2cf06e6e src/models/openresponseswebsearchpreview20250311tool.ts: id: d450efb8b660 - last_write_checksum: sha1:c1da0b3d6883f8fe248cb0208a097eb2ce46dcd3 - pristine_git_object: a2ef0debf7c33f5e11268dea452a3f710889a7b1 + last_write_checksum: sha1:dbc159c5fbd1123d49cf4982f7a79563c7182f21 + pristine_git_object: 767d79d8399fdd78d9611afdbb924e6a277de030 src/models/openresponseswebsearchpreviewtool.ts: id: 7d594dd37b72 - last_write_checksum: sha1:57c5bee5fbb84f3e5367a24a66ca97ecc5b71a94 - pristine_git_object: 02bf2042d2ec005c1fd3899988b69a300917cac7 + last_write_checksum: sha1:9674952f3b0e76bfdb7369b70f3323ea33c87071 + pristine_git_object: 53d80f9263b8de8f5366d25b34fa11b80dbcb385 src/models/openresponseswebsearchtool.ts: id: 510ab58460c2 - last_write_checksum: sha1:a088eea3aaa691cb3acfac35ff5768887101e3e9 - pristine_git_object: 2413740828f937ae5520c2047296761d9cd94f95 + last_write_checksum: sha1:940de7803d5e9ee96958d6c325adf8ceee7864e6 + pristine_git_object: 187fdd5a1ce0b2c67c4b7ea37ef56a02e0c0a0a1 src/models/operations/createauthkeyscode.ts: id: 1443f6afbf40 - last_write_checksum: sha1:b76a8f766558d90f06f601358b9e3cccc434295f - pristine_git_object: 5dc902ac9e2619eb9e51c89ca3388ee26130f2a3 + last_write_checksum: sha1:0289820397bbe1c94fc0f2b47f48b43458ffa468 + pristine_git_object: 5309dfd7fa28344bc60a09f9c6b17a415fc95597 src/models/operations/createcoinbasecharge.ts: id: 1e75ac2debf2 - last_write_checksum: sha1:be193f56bdeb746f4f542f90c395cafc336d05e5 - pristine_git_object: bab9d0e92defe881de0a98c183d8c2f9e2e77ca5 + last_write_checksum: sha1:aa78c1ea317be5589fb17d16398ae55427e184ff + pristine_git_object: a16d5a04feb6d0e9a13df912023f0f7f24dd36bd src/models/operations/createembeddings.ts: id: 7c210337fdff - last_write_checksum: sha1:5a28fc99bd1a7c89a3778c2a2ee4755ed237d457 - pristine_git_object: ceb5e6bf6de4905883052e281492ca0281b724e5 + last_write_checksum: sha1:9c2714a9345d366f153734691f264ca1b559b67b + pristine_git_object: fa8b758697e3e9577e0f6fdf526873d180b1db9b src/models/operations/createkeys.ts: id: e7a250c8b7bb - last_write_checksum: sha1:85a747b821fc6821bc31fd3e4074a67d27f8f72c - pristine_git_object: da22a19b2da60f3d3f66aa6324f4dae943d12a4f + last_write_checksum: sha1:e63049a8dd410aab8ff447e174f17d8ac9971aac + pristine_git_object: 24aa727929c9693dc451a73fa2737d6e44fc8ce1 src/models/operations/createresponses.ts: id: 7ad611b27e9d - last_write_checksum: sha1:d3fa700228ed775ececd97e36bbf5e1799f8c433 - pristine_git_object: 19fa18fb0284304f3b7d5c753b3b6e25dc01a058 + last_write_checksum: sha1:4352ab9d0ddf017ba89a1ecdc65a68e51a9957a0 + pristine_git_object: 5e74e0c6b0f64d536e453cc62fae5f667bbea3a0 src/models/operations/deletekeys.ts: id: efa22339a3d6 - last_write_checksum: sha1:a85fab4e7b2f190cc2f5834861b534c1ff24dc0a - pristine_git_object: 9fc5fc7363256480581a30f284ba0bd064412f2f + last_write_checksum: sha1:5308578320c5132007d054ce844840c513ee02d0 + pristine_git_object: f939ec4441a78e8c50844d05ce6fc5f5d1bbec16 src/models/operations/exchangeauthcodeforapikey.ts: id: 440595fac2ad - last_write_checksum: sha1:4d9ad6d1d9abe4d9eed60617c4261ad378770693 - pristine_git_object: 4b04707e1a6c7decc976a86c94287103478ed8fe + last_write_checksum: sha1:b05f1537d42ef590e3396848e6a4bf8645c02673 + pristine_git_object: 95540a83c1a0501a51c28f12f0f88778b1e46484 src/models/operations/getcredits.ts: id: 0e5a438307ae - last_write_checksum: sha1:5e7d1dc35cc534b7d3c2e343018d0e0ede829fb6 - pristine_git_object: 6a9562ec44fa926bcba738666c0b61948a7a4b02 + last_write_checksum: sha1:54e8ebe1057865b58f36651efac306eebce33234 + pristine_git_object: 4fe313fe8bd3f7c26522c5ed962e7bcc4b9fa0bb src/models/operations/getcurrentkey.ts: id: ddb4fa558414 - last_write_checksum: sha1:8bf467a93791cdc424e862fff836bd2176c5ea08 - pristine_git_object: 9a1a8dabbd0c3370fb34fe4c804a065cde5947e3 + last_write_checksum: sha1:c5c876db632a5fddac20e04a5ae8d1c748d075ee + pristine_git_object: 2c7c2dc7982e4f70c88a08e1f0841b8eb93625e7 src/models/operations/getgeneration.ts: id: 5cdb2959d2a5 - last_write_checksum: sha1:57ea64bcac3fa681c3b9c6d51f6be6965a4e3cb3 - pristine_git_object: 30a163ee8a27066c568223383323338701c24a5d + last_write_checksum: sha1:f07995081b53a760e200435d8f8d39710084ba67 + pristine_git_object: 98e74eb75a7ea6afc835f05c63e4298dfa18b041 src/models/operations/getkey.ts: id: 27d0f86c087f - last_write_checksum: sha1:4df31f8cb9e4d1a5e32e064ce4f4c551a6d46748 - pristine_git_object: ecef05609f15a766d6f14d7664ccd1815f6fb6a7 + last_write_checksum: sha1:c54e8a824da1672c0cd5d1766071a05a14b58ad3 + pristine_git_object: 55d4f0f87a4fa655d9ef7a827878853a1ce867c4 src/models/operations/getmodels.ts: id: f1343fbaaed5 - last_write_checksum: sha1:4c17f6364f64afe61ea10f1c96cc1f3967cc951b - pristine_git_object: aa1233a7545f7b8af96bcb99aa10f1dba678dfbd + last_write_checksum: sha1:a4144955632abfc56ee7a4e1adae8c2b5e08689d + pristine_git_object: 97bb2f81b0c43907b9169b9ff98a263ed3d6179a src/models/operations/getparameters.ts: id: 9b364a4cca61 - last_write_checksum: sha1:ee4e6b9de7b8503567e7a6d9fd152676bd5fa55d - pristine_git_object: 4a98767887d72b71a7d64e2947c8ec06eacda73b + last_write_checksum: sha1:1e76a4bfab0e5b7040c36f36e9742ab94a75f793 + pristine_git_object: 8efe05feb1e1ea2bdb180aede9a7fb57e489e65d src/models/operations/getuseractivity.ts: id: 19535b4511a4 - last_write_checksum: sha1:ee60c530b70bd081877ef727cdf41d18d7f75029 - pristine_git_object: 6691a27a50c1b31734f09d853156c2359315359b + last_write_checksum: sha1:61b5124510cd7e03d75a781a8612de3e47b9a7ec + pristine_git_object: fa427fbdf540e037bc53828a462a2ec76d3e99d7 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:c51a14dcaed1c9133b1fb04ac8dac62c6c819f02 - pristine_git_object: 42e9912a2a960d1a6fe645c7fbc83d731c49e064 + last_write_checksum: sha1:11990dade539ea99185f57a97614573f99dbc58e + pristine_git_object: 5293b3417985d3e85b520f0e56207f90aabbb9ca src/models/operations/list.ts: id: ce11386ad30f - last_write_checksum: sha1:e088670d535ac1747a0d8e7941b8633ae903f9b3 - pristine_git_object: 2d056b0e6d72d2a4030ac4fde339614baa29c565 + last_write_checksum: sha1:b07c14174ede31b9179eea67071f40373023ca05 + pristine_git_object: 64016f5bf50ba4a32ff58ef05ec1ea5b04c58f2b src/models/operations/listendpoints.ts: id: 253a81bc10af - last_write_checksum: sha1:d5784ab1c2318ccdf524322d3cf356f6082569b6 - pristine_git_object: 5a2891de8f06ff67b89b9831f62c009237e45bd7 + last_write_checksum: sha1:b1f3266ab7e3742ed8048c0cd09d6ad70b56503b + pristine_git_object: de8fe54bb17cae543414a5f9041fb12d5edf8555 src/models/operations/listendpointszdr.ts: id: d52e6aeefb5e - last_write_checksum: sha1:861b4d7963d79b8293ef7f5a797ec2deafe3acbc - pristine_git_object: 10c81042ff48db5a992e83cf68542d1c5824e405 + last_write_checksum: sha1:4d663d82382cb5d8415608811070a481a3fa796a + pristine_git_object: 9cbbeba469f117c54877fd746309c7410b2a3b66 src/models/operations/listmodelsuser.ts: id: 0846aac6be02 - last_write_checksum: sha1:4e55a027e80500483741ee0645afebf87f63b185 - pristine_git_object: 53219054f1fd7f89b912ba5708aa49bf83d24d1e + last_write_checksum: sha1:39e902b313c46fbd5d21d368eb4694f473639e1d + pristine_git_object: c0201c38057db3289341c78d3464b7baa0a425d0 src/models/operations/listproviders.ts: id: 76a35169de06 - last_write_checksum: sha1:58adcf3a9917d580f4936d1617b33df6ff79aa79 - pristine_git_object: 93c7f3bed691fa035f6ddf5f94999568c1f3941b + last_write_checksum: sha1:a06c3b57379fcf360ce0216fe5e9ad704230a8f4 + pristine_git_object: 45baf6eb67916684efe340bcd53d42a2fd1f67a6 src/models/operations/sendchatcompletionrequest.ts: id: 52a55a780d2d - last_write_checksum: sha1:596e5aa0449472c2d38e02afef92194306a267aa - pristine_git_object: c14e884c6db5923cf4646ec144a4bffe17f39090 + last_write_checksum: sha1:e23e1ac47baf5ea366fffcccf576a8c45a801bf8 + pristine_git_object: 80091bf56e6274d6cc2debf87ccf5fba40a37370 src/models/operations/updatekeys.ts: id: 30a0942aa2b9 - last_write_checksum: sha1:5bcd2a1b079de6987cdc5b07109c1fa69ba2b8d1 - pristine_git_object: 61095dfaed902416836ef4b64cd0baa2873ca72e + last_write_checksum: sha1:8c01df0bc39337d7841a647dbfb2f641b9508ed2 + pristine_git_object: 2cfcfae88b00feacb9d86014d3004dd5022363a5 src/models/outputitemimagegenerationcall.ts: id: 9c3ac6a7a9ad - last_write_checksum: sha1:9d6481f3c68baac3d98b92ed9308e51d93cc198a - pristine_git_object: 266766d3cfd541edc5c9e6c55cd415fb0f2d4a76 + last_write_checksum: sha1:70477f8472cc02a0e13ca4f1ce5d64a87c7d49c6 + pristine_git_object: 1a292f676d050c8cc0937eb3245d36af5cb47d1a src/models/outputmessage.ts: id: fa128cf87d51 - last_write_checksum: sha1:e1232006c632d3afc8e1943eb9577a98c95299ae - pristine_git_object: 4f63fed3cb32481b8539416ad2085071a5eaf1d7 + last_write_checksum: sha1:30630df21e172e6eecd829a3995ce982cd92dc81 + pristine_git_object: 76b98b2c304bc6d1221d0a07eb4a47d196f00c74 src/models/outputmodality.ts: id: 6b2d2af692c7 - last_write_checksum: sha1:01a8d756773e4f658dbf8c5d44da6f05bce86dd1 - pristine_git_object: 29f6c937905acaea39c33c63a2af8f6a1ca18bb1 + last_write_checksum: sha1:d36b55c9b4089c3198a94f2cc379c03f0b43aab1 + pristine_git_object: fa1993618e8c58a3ce10e5c785707067e70c6801 src/models/parameter.ts: id: 066287ded212 - last_write_checksum: sha1:17d013f725e2dea1350c11045b59498b6370b3c6 - pristine_git_object: 51cddbfd06b8ba1f57ec3c058e93c2554bf615d3 + last_write_checksum: sha1:7cb843fedcaccbbabc94189d512da6192cbf835d + pristine_git_object: df6c3118905a0b50965ed54cd64ad8f543bdfc68 src/models/payloadtoolargeresponseerrordata.ts: id: 59c2c424ea9b - last_write_checksum: sha1:3543c2ef68f0d0e1c4c515c31ee134a7397ea407 - pristine_git_object: 2638b5397ea887800e7c7e16deaa6709dd83575b + last_write_checksum: sha1:e2e645fdd2310f5725c6651411a7ba1ffb829cf6 + pristine_git_object: 7be7855679f263b25da5b582e67af02df5b5d38d src/models/paymentrequiredresponseerrordata.ts: id: b38a7e0e1166 - last_write_checksum: sha1:474ec378c4d074cd10b03998b16bab3a344fbfd1 - pristine_git_object: 1ea9f353b2f2e06a3a74b6bdd20b445ae51660aa + last_write_checksum: sha1:001cb675c6b20e8b3319ff414d260b1c9d65ab2c + pristine_git_object: e11a0a71853b6eecd2ee79f4ac3fe50afb0038dc src/models/pdfparserengine.ts: id: 3c0c5ac60652 - last_write_checksum: sha1:53b2ad8103295270d5e5af668889ab08a61d50dd - pristine_git_object: 2d7b48ee1bc3fa0afd462bba103fc5f3b6698963 + last_write_checksum: sha1:e9f9c2cf5c7dbe8aae91611b9a97b5a696404396 + pristine_git_object: dcbfbed022173b028b3c2e375b5c64520dd13293 src/models/pdfparseroptions.ts: id: 704f51d4a5f7 - last_write_checksum: sha1:bac6115ec95f25bbec3b5e1d3e4925143d273a29 - pristine_git_object: f68c84b8212ed6b0bc6e291fc950e213639981dc + last_write_checksum: sha1:1830a046687a63576259d7d2f534154df86e69b9 + pristine_git_object: d32dc10b8d734d48a15721a479831c4b2ff96ece src/models/perrequestlimits.ts: id: 2b2b6cf6a019 - last_write_checksum: sha1:785e985bc759b7eda3b9f519b5549342d6534521 - pristine_git_object: d7ebb6ce6ca3750daa5a5fbce0976ea6a420c547 + last_write_checksum: sha1:b301eb57f0a4eef19f3fa62e6a3e54e44dfa3913 + pristine_git_object: a5bfb5dc6be9438a7b61dcab0944f70377916862 src/models/providername.ts: id: 89e536fb023a - last_write_checksum: sha1:ec7e4a3f34c4e487a37bc2623fd5edb208919301 - pristine_git_object: 0999cb108ea90a9fb278bcb6c67942cb8845ec9a + last_write_checksum: sha1:4b76c862538275e5909530ed6c01ec44433da820 + pristine_git_object: db7996c05a501db9f0ffc1fd8b166a9d8d6abf76 src/models/provideroverloadedresponseerrordata.ts: id: 379f1256314f - last_write_checksum: sha1:b63193f0f0ec8deca10450363f003fba2764dd91 - pristine_git_object: a76b7f367f937eb6a71dae5ac11d8724bf6bc6aa + last_write_checksum: sha1:0458b6a8454adfa7c415e3bd7f49f2879cc6093e + pristine_git_object: a42994698e17df9b87b470212766b7d9a5c0ddb8 src/models/providerpreferences.ts: id: 3a47295d7b91 - last_write_checksum: sha1:597d14c5887036a9d72a095f6264eb2696c28270 - pristine_git_object: b58a7cfa2c209ef3615aa30f5fc51ed6b046a783 + last_write_checksum: sha1:b3773f306a628044087bb993c03533fc5dd82b9e + pristine_git_object: d783498df7eb035e92f750e6ab0d8eec31fd2af7 src/models/providersort.ts: id: 7d1e919d1ec3 - last_write_checksum: sha1:4b4719a2b1daf19bea595a200add4383a9fd12c4 - pristine_git_object: 763d4a5f53b8d08d06372eaa14df02bb854640e1 + last_write_checksum: sha1:79757871ce1ce3fea1a1e0457286dbf45a32b35e + pristine_git_object: 2d28a6168824150ab179230f6656f310c7615b5f src/models/providersortconfig.ts: id: 1491329aae16 - last_write_checksum: sha1:ec63f7b87a78adc6ecde185a86ef5d1a561858a2 - pristine_git_object: 978c094c1db307a136655402b25af8d5fca3052e + last_write_checksum: sha1:cc9f54498fbe219de77cc6744ea1817a1b9db1dd + pristine_git_object: 56f70b245b5a23bfcf20d25c43389ad53b680203 src/models/providersortunion.ts: id: 7a2d23baab80 - last_write_checksum: sha1:ec6e5cb3dcee6e1f8028175a1e92cc384a6b7033 - pristine_git_object: 461955ca133793fb0be6252b2044e2afc819de98 + last_write_checksum: sha1:ec0fe732ada2fae9665df9a25b3522a728b33e94 + pristine_git_object: ab212a4c43bd6e099ce33c01c8152e54d47ce0bd src/models/publicendpoint.ts: id: 396ce3186017 - last_write_checksum: sha1:43661ff00a2b7ca3cd9b31bb08d1a60d3d2e5740 - pristine_git_object: 4580d3446e1a7d45a81023fb9f2ba491cf4d6242 + last_write_checksum: sha1:bf6cc8481b427363e525eca01932209115a04498 + pristine_git_object: 23f47a3070d3c0c7b717497ea148a35cec067d97 src/models/publicpricing.ts: id: 0a44a1c3bab5 - last_write_checksum: sha1:d9dc0aaf5407cbdc798b8345c230956dac15774f - pristine_git_object: 22d325a4ddba5babb52ff3bf78d262b1347f518d + last_write_checksum: sha1:d89d4b227df690ac55a72bf9e7394bfff6e43882 + pristine_git_object: 7b271af066314c2e0f41d0de7698d8385c39c3ec src/models/quantization.ts: id: b28328f1822c - last_write_checksum: sha1:b7c078112480d5fa874db87363419f2f39c192d5 - pristine_git_object: ba97cd53864d19ac0833bd859cbee6c659a05544 + last_write_checksum: sha1:4d10d34237fddb881f2c49c3e27342487e5fca47 + pristine_git_object: 55082b7e886b01408398431244ebcf4ecef0f605 src/models/reasoningsummarytext.ts: id: 9c06c18de6d6 - last_write_checksum: sha1:fa234d7a8ca146e596b41b1a2a9661e58125438a - pristine_git_object: a00f733104092897fd767df0379660d0601d7d4c + last_write_checksum: sha1:a4cad2def2f1c17142fb524927190f0d3e571037 + pristine_git_object: b9720f5172dfa1efaf77e3c0adb991bbf994c989 src/models/reasoningsummaryverbosity.ts: id: a51c85f04729 - last_write_checksum: sha1:e31a4310fcec2c0be14eabde7e057dd2e933a148 - pristine_git_object: 8b95035c41cecaef1ea0e1d38da0358bc7868797 + last_write_checksum: sha1:70be5cfadcb8aa43583833971df69cfe5906cf00 + pristine_git_object: 58291795f0be63e21552ef0e336261f55bb838d5 src/models/reasoningtextcontent.ts: id: e5520210e3cb - last_write_checksum: sha1:e66c513095757960fe31c83ff7a50216bab70228 - pristine_git_object: 5347eb07e1c6bea9516df2d3e328def593525be4 + last_write_checksum: sha1:5e2ef062b80ea5cc465273c9869b3b311a42ba15 + pristine_git_object: 10912a9034bd83a2a205dbf4a1ccb1a87f2ec857 src/models/requesttimeoutresponseerrordata.ts: id: a08eeff8786c - last_write_checksum: sha1:7ca041b0f2d3dcdb2955bd1c22b2a4962e642b29 - pristine_git_object: 49b6fa932db56ac73d3504533129156c01d2114d + last_write_checksum: sha1:5429dbc4ea062c63e6dc613d74c3ece63f218903 + pristine_git_object: c9eac87a0c41f81c8ab40f4634f943a0a896ae59 src/models/responseformatjsonschema.ts: id: ff0b42f802dc - last_write_checksum: sha1:8f0f1144df7d0925cf757da1e7b0a53aa49b5355 - pristine_git_object: 3fe19d90d0e91f9ed85d919cee2a21edf2c4cae6 + last_write_checksum: sha1:a02e6171bd3cd6f4935c784145b41db9263275fe + pristine_git_object: cb2913fd93c6afe6de471e4a3da5c6583691638f src/models/responseformattextconfig.ts: id: 4408142ee314 - last_write_checksum: sha1:5208d773448f1ab068d8f013742f273fb4920bf4 - pristine_git_object: 1deaf3cf18078d1a108f830c96f5071b266e5166 + last_write_checksum: sha1:ca323a03f8d9bf2407fd1e084f6b30a05525df8e + pristine_git_object: 09480e22ce53625c7845c9ed783684ecdc21cf64 src/models/responseformattextgrammar.ts: id: 5bc0a32fad4c - last_write_checksum: sha1:94ca460ec401ceb88d1c2f3a04b1e450abc4e0c0 - pristine_git_object: 0743dfdb71a724dac8162201dba193d25eb31e28 + last_write_checksum: sha1:411c19a592ad720bda0b1795bcd305a9f8109eef + pristine_git_object: 407bdc0120f425b9b121791fe8f174e4cf749ef3 src/models/responseinputaudio.ts: id: 259dfb8718b4 - last_write_checksum: sha1:4829baf5d92fadf882de9d69ff6d3dc0af09ae5a - pristine_git_object: da7b24b1ded48a5caf6d88566dfb532b8304554a + last_write_checksum: sha1:46b603165b97e287d6787590c4793ac395843aa0 + pristine_git_object: 9201796dbb5e59669d4a91526a68bd0d3a55021e src/models/responseinputfile.ts: id: f449677cc221 - last_write_checksum: sha1:61d7a5602eef1719682f79981dd1568854c9e847 - pristine_git_object: 8f59ccd20ee20750128ccb9a9f8e4b4fc0fb9317 + last_write_checksum: sha1:8bf06e768106d6969f55f7a4cf1a365ab42f289a + pristine_git_object: 1d2aefa1736bab3a5a9ccfba558e30e28119ceb0 src/models/responseinputimage.ts: id: 9c7a50d121df - last_write_checksum: sha1:055762178d77ac27cb2142e75b9f0fb9fe083b20 - pristine_git_object: 1e26f22bc1e1297235c4174d79a2255eaf72f8a3 + last_write_checksum: sha1:d07e884f4d44290344b750664fb3679099edc15d + pristine_git_object: 44c63262b203130bebd37d1125d44d1598586ae0 src/models/responseinputtext.ts: id: 841523070a3c - last_write_checksum: sha1:9651c7da918ace73d8d4efabc9c5a04a93cbf533 - pristine_git_object: 56f8bb7aa015f00173602fc37bb6251473dc4a6a + last_write_checksum: sha1:2eced62f2909cf540be019bb5fb30c79ddac7112 + pristine_git_object: 5b8f3dec6cc58c5d09176bed64ab170881fbbaf2 src/models/responseoutputtext.ts: id: 2d5e61e53c46 - last_write_checksum: sha1:8a5c5af37567a8122306caa2b9f60da1a9ee6215 - pristine_git_object: 6b6f99bb932e0840eccab48c08a934ac5dc89d7e + last_write_checksum: sha1:e6790fca2772d5e46f3b0915a9fa163ef6a4bb2d + pristine_git_object: 5028e794264cb6763be48f5c5aeee157fc887aef src/models/responseserrorfield.ts: id: 830ea3d3b590 - last_write_checksum: sha1:8ff94584c948906ba5cad0603a462e1ff4bbbd41 - pristine_git_object: 1c81b4b9f38ffd3ac09eb4acbae86f3610d95e2f + last_write_checksum: sha1:776be0716ffd7975f6e36f67179d31c49013f2af + pristine_git_object: 9672f19f64566b65b24322f523f25b1629554e9f src/models/responsesformatjsonobject.ts: id: cd67052e598c - last_write_checksum: sha1:eb706ce2aba2fef4112107f31b3b9768dbcf5db6 - pristine_git_object: a13fdf60c07bf86cf871cb512a05aeaa6502827d + last_write_checksum: sha1:08c8bf0e6d7fef5be95181a910ee18677a52a817 + pristine_git_object: 8da5d102020c8276b116b2ed43f96e02b387fb51 src/models/responsesformattext.ts: id: 30c4a4421b1d - last_write_checksum: sha1:67fdc3da6d41fef30136417230924fc7c4ddbed1 - pristine_git_object: 3e45270aff85fd1ae372f866c258d7055e4f3331 + last_write_checksum: sha1:c8c68573d40c346e3baa49b258093d77434a8fca + pristine_git_object: ae37ccd5e4bafe045de963b62178be1cde6ac077 src/models/responsesformattextjsonschemaconfig.ts: id: 631c61a1b658 - last_write_checksum: sha1:efde22e634cb85d07de31dce404c6859e98b87f2 - pristine_git_object: e5c98a85fbcc1df992fa447d2a8ad7a63d4e3c2e + last_write_checksum: sha1:a85a1fefdd80a8aa36ff19717c849a2081aa17ea + pristine_git_object: c41018841cd563a33cb9811f8a652b6381cc200a src/models/responsesimagegenerationcall.ts: id: 51f0104f0dbf - last_write_checksum: sha1:c94ed236cb49dbd7f312681ed1f736f38e18eae9 - pristine_git_object: d3daf416a2e6affe92f547fbac47c088d6b8a2cd + last_write_checksum: sha1:4fb63f5b51d3dd1624c14d0bc2fd97e372d525d9 + pristine_git_object: c27555dd4566dbdb93b57d38a266e6b4888212f9 src/models/responsesoutputitem.ts: id: 4e7df3e415cd - last_write_checksum: sha1:12a909eedf11470c9070c0a0480588c1489db929 - pristine_git_object: 3ae6f029464ce552134fc1522ea0fcaa4298d98e + last_write_checksum: sha1:df013dd26f28fce96fe9aa7c798d230d0ee08237 + pristine_git_object: 796f37fded0b21e1f72474dda0ecb24a7319e3df src/models/responsesoutputitemfilesearchcall.ts: id: e5ac80adf28b - last_write_checksum: sha1:74eb8a0e0e059d75a61ddd6728427d9ada8fca62 - pristine_git_object: 86c6b0b2beb2a202a0c9354686e14c328e70ec3c + last_write_checksum: sha1:4de53de9724a3188b591c02af303edda70424f26 + pristine_git_object: 740c6fecc72febf1d8157951f646caf61ffc81de src/models/responsesoutputitemfunctioncall.ts: id: ff553c6d83b4 - last_write_checksum: sha1:b13d9b8eeb45123cd9f3304841b9e22eff714bbc - pristine_git_object: d870232c06073424f1183f351addec7c034e0443 + last_write_checksum: sha1:348270343d7345e54a3ea1128012459beece91dc + pristine_git_object: 4b2a84ba49afe91cfeb0b7947bf4028524b49713 src/models/responsesoutputitemreasoning.ts: id: 191f7f61ea84 - last_write_checksum: sha1:0e9b9757449ac6e959b0013ee80eb14f4c4615c9 - pristine_git_object: 4a046785ba04a25fa53c9e0167e8b8e0f7419034 + last_write_checksum: sha1:59ca3515ea228a3c3f9054e2d5a60ce71c845534 + pristine_git_object: 60b06c0e742c175f6a504b4c7690913a4d0a2afb src/models/responsesoutputmessage.ts: id: 32cb33488ea2 - last_write_checksum: sha1:1dd5476d0228f02efb313596b34a6855e0a36668 - pristine_git_object: 154a30fb857ba933c784f7c12760df487cd648e2 + last_write_checksum: sha1:82e6697b5617027faa4d6e65791eebbd4c46724c + pristine_git_object: dc3999bae9a4a8783e6273f237cf5ef56c8d0973 src/models/responsessearchcontextsize.ts: id: 3c1dd9e04db4 - last_write_checksum: sha1:5b7d2038e8c4a4c57ec885a6e9dc518e5c3c78ba - pristine_git_object: 5bb9e554e913c5a39c3a1f7540b1e1da210252cd + last_write_checksum: sha1:6280fd261d048367d14726add6a077657833f16f + pristine_git_object: cd2595864845c232d470eb334ddd1a7fa2b5942d src/models/responseswebsearchcalloutput.ts: id: c1c0ab68e92c - last_write_checksum: sha1:eaa42accbf828d8a1aa82bdc2d0466dc4fd8c88a - pristine_git_object: e7a4b3ee61e42d068c01970d70eda1a381b1623b + last_write_checksum: sha1:d3d41aa388c92483e10434f52494a61ae7e4eba4 + pristine_git_object: 8858d5bba58cd344e4b5dc35b1611c4622efff38 src/models/responseswebsearchuserlocation.ts: id: 08377a5f88b1 - last_write_checksum: sha1:e1ba2666cd6deb165da0d68c956cac50af930d26 - pristine_git_object: ffe619c461a367fe35c2cc32f88486ddce4269eb + last_write_checksum: sha1:48aedbecb0b91d0ceb61ac25cbfbc9ea58581ed9 + pristine_git_object: 036cdd23faac125826279007acd62be9c357349c src/models/responsetextconfig.ts: id: 0f516033ff9c - last_write_checksum: sha1:5856eb4a2fa5b4434b909df518e1aebdf263d156 - pristine_git_object: e36ea2948843f03832e3394d94debfe4711f26ee + last_write_checksum: sha1:c0290bc80b219e511eae7abeb33514d08cd57d40 + pristine_git_object: ad0047e3ee3baf0dea29abdfda2f3b7681c03519 src/models/schema0.ts: id: 14bff3bd8497 - last_write_checksum: sha1:0750a1d36cf3791ea192ed1401c900a744b9be6a - pristine_git_object: 7d8a43837df528211593970c831705b87f6433c9 + last_write_checksum: sha1:3058207a8cc35341a322560bd665627bf9ac8779 + pristine_git_object: b2669445d4371d8f8b6d10885e0aad47efab821d src/models/schema3.ts: id: 6f7380bcbcea - last_write_checksum: sha1:05e7bd2e98efcaab3aad70c2c922746a9272956e - pristine_git_object: 4c60f355fae394fb149bed93d0eb7aded9a0b5c2 + last_write_checksum: sha1:1684d7aaa4a521191b2f2f63ba797f07438c3795 + pristine_git_object: 366ab7b1fb3f3e548a79687befdc10013b1a59d3 src/models/security.ts: id: d90c6c784ca5 - last_write_checksum: sha1:923d7a0f210a893546c581bf9ff0563be61f4b32 - pristine_git_object: 9a9e7534ff7dc9c688c5c2e24d5e153ae543c184 + last_write_checksum: sha1:90d7a8903f46cd2ea5428527343a003511fc78c9 + pristine_git_object: af44b3ab6c4b542d720f0b5b5bb31e2aa51c1862 src/models/serviceunavailableresponseerrordata.ts: id: 842927f7dc14 - last_write_checksum: sha1:737915b11016d6c6ce00446dba18d980262a2fcd - pristine_git_object: 5468d2072137fe1335d25519c70ca4df4b21cddc + last_write_checksum: sha1:ab49b8701f90961b240f514a2be3c89ff63f46d9 + pristine_git_object: f6242052cf481213a36c0389e3e3483f23d3bca5 src/models/systemmessage.ts: id: 2a179ca48627 - last_write_checksum: sha1:cae5a4540df5851180d3b9aaa6ade4b7007e3792 - pristine_git_object: 8a634d7ed5cec09de4581228cc0dfaf1c0394e51 + last_write_checksum: sha1:64861bd0196bf5eed94b1273658105140502476d + pristine_git_object: 68f3666fb3d96cb8a9076f86793dc25213d13906 src/models/toolcallstatus.ts: id: 54eb9c06bedb - last_write_checksum: sha1:d06b9ae914b7fc7dacf1953130921f781e7a4c4b - pristine_git_object: 79485fd7a1a0720c543e65fd92f58c170fc6fbfa + last_write_checksum: sha1:28d8c73463fd784616838c285a0cf5a6b83b7b4c + pristine_git_object: 1585e3f90f3f774a0b955cb671e7745c5b95473b src/models/tooldefinitionjson.ts: id: 546c340f3013 - last_write_checksum: sha1:439c1139e1b6f4da7f0403b925efca30862ea8a2 - pristine_git_object: 52240c6cb82f51191b5b96ae78514a95a2b1b6fd + last_write_checksum: sha1:554556b413cd0b845ddcf77a614ea71375de2c24 + pristine_git_object: 8456579f999ff223573519e0595978297d10c8e6 src/models/toolresponsemessage.ts: id: 1122bbfb530b - last_write_checksum: sha1:c4d262d6e13a34625c56c2f8cf070ef7dc9fc807 - pristine_git_object: 31c998baf46463aae153cd7821133e3450b9e8f4 + last_write_checksum: sha1:81695fbc02de3945d966a1f7de981c58bee89773 + pristine_git_object: 1cadd6837ee9183ec6168c386d9dfeb886f52f8b src/models/toomanyrequestsresponseerrordata.ts: id: ff9492357bd9 - last_write_checksum: sha1:d977449c83ace95ea833d90eb48f6620efced797 - pristine_git_object: d2b2c10ec22297b59cbeb703a3ac63335388f41e + last_write_checksum: sha1:0ec65f87b4b129d107d23eab65206c26f7f80435 + pristine_git_object: 5b47d7723fc7f54b5f961411306204d8424e080d src/models/topproviderinfo.ts: id: 7439c7b1a9c6 - last_write_checksum: sha1:0d9e43c045050bac3c6fc2dcc6db95f69671478e - pristine_git_object: c1cf18b162ba790ad906176908d48d1b33c4c8af + last_write_checksum: sha1:ffdff42721b0cfc90d8fc96c63044624dad078bb + pristine_git_object: c95a2f1288611c754ac2958146966badc90c5c6e src/models/unauthorizedresponseerrordata.ts: id: d335c48e0c3e - last_write_checksum: sha1:b92b6b6f8ffb0a9a4be15d302802f3359458dc12 - pristine_git_object: a5d3f69bd75e7184fc2aed618c4f9803bb2224bb + last_write_checksum: sha1:0aeb2103469f3dad0c04196c8470d851d7e09142 + pristine_git_object: 3b24025f18893e96d15b6ae2f71de60a4ad721ee src/models/unprocessableentityresponseerrordata.ts: id: "557063315301" - last_write_checksum: sha1:2198115b164eec935a107083d1034aa603fdce43 - pristine_git_object: 48619818e0b6c15a72fb485008599b3fdb173279 + last_write_checksum: sha1:77a2c2515bda14c3d700340277b8762cb0067688 + pristine_git_object: 0c68c6962a0dde28d6804dadfb3385c965f10c96 src/models/urlcitation.ts: id: ccd6ecd62c64 - last_write_checksum: sha1:3cdcea2fbebbc0d6e3f3a3a43cd0d3cc74cdc362 - pristine_git_object: 69471973fa4698f932b80fc82f5323b870ebb719 + last_write_checksum: sha1:3b6e62096e04ba3049c1cf2ee72ec591f45dfbaa + pristine_git_object: 4d03e2fd769dbe3f2c6bde3ac3f642a1343ebafd src/models/usermessage.ts: id: e34f73b285e1 - last_write_checksum: sha1:9b7c1cdcb635a08a59c92efdefe6bc8d4d21ff14 - pristine_git_object: 9cfcc7ae01e2e3fe5c1ca89b1eea1c68bf74f261 + last_write_checksum: sha1:4c49b3a864caca0de3b3c6b5289d13820cbdedb6 + pristine_git_object: ec761e7f2d614cf5d588f7f372dd0452f5beb949 src/models/websearchengine.ts: id: 49b0152fd59a - last_write_checksum: sha1:1c79a6d793a2fb5727c5d0145e753061d7cb9106 - pristine_git_object: f486570b5f50630a9c18c3f21b58675f7a23204a + last_write_checksum: sha1:78c4e85f1e3e73741af8b3ed45ce7450d1cb802f + pristine_git_object: 5d8c6ef92f077048e9585bf9744ec9b738436aff src/models/websearchpreviewtooluserlocation.ts: id: cb1960e09942 - last_write_checksum: sha1:055fd33ed802b99daa2d3bd8b7fe6ce870212eec - pristine_git_object: 8c162ac5439175a70de6cd7362f1c622a9a736bd + last_write_checksum: sha1:accf2094ffb5eaf7e43c805e079b0e2467b777fc + pristine_git_object: 38b0d83fbe36702f50ab907bc0be5e4d95162a69 src/models/websearchstatus.ts: id: 55795920a937 - last_write_checksum: sha1:42994444a435b4566cff6748654f20cc7292e9f2 - pristine_git_object: ac6dbc70d16c5da19fb12c4dbb49adba22b9963c + last_write_checksum: sha1:cf0c6874146a4be7c3d9cc08e2ae7eb22a0d5691 + pristine_git_object: 3243a6ae8b530c7944cfda29a0ef1d0eafd88ca1 src/sdk/analytics.ts: id: 411d91261be3 - last_write_checksum: sha1:f843c47f4b355adf11f375a868ec1269b502d7d2 - pristine_git_object: ea9660063353105bd99e61e8600deaf9d58dc7d3 + last_write_checksum: sha1:aa143ca884d9b71df0d4afbb1f9f555ff4e7c14d + pristine_git_object: 41f17bc8dcf4ffd95e21104a983719589a6a5a24 src/sdk/apikeys.ts: id: 5dda931501e1 - last_write_checksum: sha1:10b390c68dcd914652b3e47f5e1b5f054e5ca3c1 - pristine_git_object: 38a955a88310db35f686104f870c1a6bbbb68cd9 + last_write_checksum: sha1:84b76bfe54111f14770b1323e5a4c3f5154f7cac + pristine_git_object: 87017a4d5bcc9a25e2dd68a219b92fa165ce8566 src/sdk/beta.ts: id: afeac65e28f8 - last_write_checksum: sha1:a11995d0aead64d5cc218970f2c21f3d8c6e24c9 - pristine_git_object: 69bee63ffd23f0e984ea9a58547c69d8c7b456be + last_write_checksum: sha1:a8a8fe18d0fe7dcf8a7ecb6cc56bd9c9af800ad5 + pristine_git_object: 0fe9a46a9e7b3bef6618cb60ac2eb7003531ccf8 src/sdk/chat.ts: id: c56babc22a20 - last_write_checksum: sha1:ebe1f1003a54ce8f34f93aa2f833d4a2fa171158 - pristine_git_object: d1a2aeac9abb8850aea1149b877794f3053cd2d4 + last_write_checksum: sha1:c58b6184c6987a2478fb4822ba630483834708c7 + pristine_git_object: fe7bba6e3e8439685df7452ea5094bb10eb256b2 src/sdk/completions.ts: id: b452d35d53b4 - last_write_checksum: sha1:450fa6fbd4d7742a99b73774438b72979c169cc6 - pristine_git_object: 3c79bd7f04d6c3dc492ec681b092a46ea9cfe962 + last_write_checksum: sha1:bff7a8209b81637292e692993aa744af36a5dd07 + pristine_git_object: ac2caf3a7b882135f1a1154c2de8c3180d1ceabc src/sdk/credits.ts: id: c72074b5f165 - last_write_checksum: sha1:0e17364dff2d8497f0b6d1c204d67f753d3c1818 - pristine_git_object: c8035fff42f5aa76aaa4cc55cf6e62918ec52591 + last_write_checksum: sha1:c5c439455cf7544ff67215829ad7ce305da7f501 + pristine_git_object: 9c43c6dd64ff8326107781888462fd3ac8dc925a src/sdk/embeddings.ts: id: 70cbb18bedaf - last_write_checksum: sha1:bad5b4cf58eec346c5c64c0a75c12cb6dc9eebd2 - pristine_git_object: 45313d01d9825345a03613334a28c7015f600d2b + last_write_checksum: sha1:ef2acbb69212cea123d5e87380043d8805e52a27 + pristine_git_object: 1607646abdd9d6320290f29887b8d2a9267d194d src/sdk/endpoints.ts: id: f159be23d878 - last_write_checksum: sha1:6bf38133931fcfcc15c5584dc721126c86c849cd - pristine_git_object: cd981d509862d4ec197734c268c2d50506ecb5ea + last_write_checksum: sha1:31072191d8d3e87e83d2884b445b5e8d16e77ba2 + pristine_git_object: 1951a884407c6922b3e77e40cb4eb12c1a0bba68 src/sdk/generations.ts: id: e28b205da063 - last_write_checksum: sha1:f9470175cdfef4769503203101a68aa747368b32 - pristine_git_object: c2eb0a0b5a68f2802e2732a8d401fbba716f0b42 + last_write_checksum: sha1:c012b7fd729854f87471da5eed0712fb7e30fea6 + pristine_git_object: ebd85c57507e8982774ccd26c3d9efe4a727bb90 src/sdk/index.ts: id: a857902a703f - last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f - pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 + last_write_checksum: sha1:54cdd8319bfbee269b54b8c56988fc0a678f2ec3 + pristine_git_object: 5c82fe389f888827f98aa52788b850ef43422e07 src/sdk/models.ts: id: 8c761ab180fd - last_write_checksum: sha1:d6c9ee41a83c7c542a5d164308db58a23b1fd650 - pristine_git_object: 7fd2396d91b1e83d58482f43463f6e8c0a80bafc + last_write_checksum: sha1:32331c6f85a8a098003c064335866494e2172e46 + pristine_git_object: bb38b40427200e0d63b8e5b59c7b557239ac5102 src/sdk/oauth.ts: id: 37b7f9b2970b - last_write_checksum: sha1:f3fc6cf344b1634eed38902aee00f469502d8346 - pristine_git_object: 1cae78b74149dca4cdb8f86db98cb53271b40aaf + last_write_checksum: sha1:9066fa7baf0b904ca1aa96b654fbc79b3d6c3236 + pristine_git_object: 12f35868fad83b3b6ce20fa340d2d9f8df7bbbd1 src/sdk/parameters.ts: id: 6e4ef00c29b7 - last_write_checksum: sha1:6fa35d8dc08359dffa3887bdc394f3cdcd4d08bf - pristine_git_object: 5279660e7654695bb2b3bcec489261fed7b1d514 + last_write_checksum: sha1:7e24ad2dfe41aa7a22db6db309466433ddf8ebdb + pristine_git_object: f6e0e9338209e5211f4a4b3f3c50b17ea5f8354c src/sdk/providers.ts: id: fb8faa7013d0 - last_write_checksum: sha1:9722a40f1bbd4ad901fce7031128512dfdca53f3 - pristine_git_object: f57c3987fb8ed08a22080436ca913e98e50a9e51 + last_write_checksum: sha1:a64efc2e527526cca454dee5c09a52cb7da95574 + pristine_git_object: dc6908e0621ee9f92c9db7d0e90783e6d61d7989 src/sdk/responses.ts: id: fc4b535757c5 - last_write_checksum: sha1:08d58e556994c3064311cb23544249d2a7ca55a5 - pristine_git_object: a906114b0d4dbc9d5d74ae30d6fb0fdd32855ea8 + last_write_checksum: sha1:cddca9f27cfbb796b540a4428cbe1e148e8e7668 + pristine_git_object: fc8f29b98cfb1a5aaf4e79aa4bf6572f0ca41e53 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:c099685e3e39172301521ec1130075fb9db15ef2 - pristine_git_object: fbaf5fd5e61c5bcf1bf562e78470e907b54f33a4 + last_write_checksum: sha1:bcdd07970af60b24f60bc596fb20d3c0dbddb31d + pristine_git_object: ec947c79916d4fb0e88b9c257b1941c6b19388cc src/types/async.ts: id: fac8da972f86 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 + last_write_checksum: sha1:e2a7c53b428567587741f38e6da489f596de6227 + pristine_git_object: 634e549aca9ff3ed96d8f3e7898f78ac6d752d60 src/types/blobs.ts: id: f8ab9b326c86 - last_write_checksum: sha1:1dcdf2005400337cd976280f317de266049e1810 - pristine_git_object: babb51eebc5a0579b734092072df8b8a3379da9a + last_write_checksum: sha1:04915516c0497520443cce5fc8730b5d79dbae9d + pristine_git_object: 6986071c324f00bbe1b6da69d563d7154793cc08 src/types/constdatetime.ts: id: 0f7b6f513917 - last_write_checksum: sha1:d311ebc1fe8ef04b961c0a4ef8cf50d8779cd6dc - pristine_git_object: 2a21bec6d580cd5c7ff45192b064a0eda4eed0bb + last_write_checksum: sha1:0086958ada149677b29e355f9b771530bed68070 + pristine_git_object: 6e667b0ec6b2e96f1782e8fa65011716ccc0b99a src/types/discriminatedUnion.ts: id: 44cf2d277540 - last_write_checksum: sha1:defa1c158fe9de64f2948972ecf5d1315ab296c2 - pristine_git_object: d8774298b9259f89b01bf26035d59431c28294e6 + last_write_checksum: sha1:3fe2d9bc4571598552a077b81e843a758e989a82 + pristine_git_object: 3527dc3810d41aabf284513722e346c356c14c7e src/types/enums.ts: id: 4d03ddfe5100 - last_write_checksum: sha1:c8dc30d8b92b586d7e4c039661c04586f6f97e1a - pristine_git_object: 12f862a1481504c7afb98bb89ffdcb35c76c0a2e + last_write_checksum: sha1:51421a4a1584fad5cbe63e56697b9b9bb6b51bdb + pristine_git_object: f13dbd9ec20b8bf8a7dff0d099c81ebda2d14605 src/types/fp.ts: id: ae9f0fb8aab6 - last_write_checksum: sha1:d24994d58f37a1ca106847fcc6d2e976c6f1c093 - pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 + last_write_checksum: sha1:fcf17e51e79a8e6894d0bea905f9be991617d23a + pristine_git_object: 7d4f9f139bcbd770fe3d0850eaa6761758311b50 src/types/index.ts: id: cd7a0a5ed005 - last_write_checksum: sha1:bf43b3dccb960ca9ae9c5ab940da4786255881cd - pristine_git_object: abf0b7ab8f196829df8946da40d627a46da68e3c + last_write_checksum: sha1:c95d4489bb6f76ce9beec00e8d964760ab106d86 + pristine_git_object: dfb23ead96c6a85cdeda6bb1aeded06501e78b86 src/types/operations.ts: id: 314da01dca47 - last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 - pristine_git_object: beb81e10f0b9eee2ed398a853fe6f737b743f818 + last_write_checksum: sha1:9afd9181120305f6916039b5bfc350b60db8fd51 + pristine_git_object: a1c2b38ea4c7cf6e4751168b55750a047ab3d1a2 src/types/rfcdate.ts: id: 9eb64906dcd6 - last_write_checksum: sha1:8e5f382e02fe21c2f2e24deb1b7bbf8cddd3dd16 - pristine_git_object: c79b3f53a3dd922aa2ace5a4191c8652cf9a8e89 + last_write_checksum: sha1:a00ef5838da2b85c35da290dc01660845f8dbeb4 + pristine_git_object: 05a12a9ea1c818e7cb49104f009b6cc6376bac25 src/types/streams.ts: id: f99be9c4bf14 - last_write_checksum: sha1:cc9ced2dd34a76c3a1bd7784ccda1cc3b37ab9a9 - pristine_git_object: a0163e7a99cea88f21d0ad4ce3af1c720180ee20 + last_write_checksum: sha1:21b75828c957ee30985ddcc9f9f2704991242a58 + pristine_git_object: 88c11154994b57fb078cef64729ba329636827a9 src/types/unrecognized.ts: id: 476605c40716 - last_write_checksum: sha1:d33ac686528492f4cdc0dbf81ed343b4afe020fe - pristine_git_object: b7a2a13f3dff50663429df24ae2f55b647ff1084 + last_write_checksum: sha1:cd795949ae6d8f7e1945340607be6ebd1e3f0760 + pristine_git_object: 4ccb9fff749ad463884a4375063cc21884883d92 tsconfig.json: id: 61ebb9fd6e8c last_write_checksum: sha1:2e344714e2df3cf6ecf3f8c8df0dd773fccdc1e4 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index cade7cb9..8ada5ecc 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -25,14 +25,15 @@ generation: schemas: allOfMergeStrategy: shallowMerge requestBodyFieldName: "" - persistentEdits: {} + persistentEdits: + enabled: "true" tests: generateTests: false generateNewTests: true skipResponseBodyAssertions: false preApplyUnionDiscriminators: true typescript: - version: 0.3.2 + version: 0.3.7 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 95b735c7..5fef387c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -13,8 +13,6 @@ targets: sourceNamespace: open-router-chat-completions-api sourceRevisionDigest: sha256:9825a9d9dd018739535efcfcd22e5cad96efd1ce991aeaa4b4e7fe5b9d40f0fa sourceBlobDigest: sha256:6f9ef0c822dc240348641c51d5824e49681a2e3ac0132d2c19cd2abb3bcfdd03 - codeSamplesNamespace: open-router-chat-completions-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:4ce44ce842fb432db3bc01ef54b2728d4120c57a8dfc887399297d53dd79a774 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.680.0 diff --git a/examples/anthropic-multimodal-tools.example.ts b/examples/anthropic-multimodal-tools.example.ts new file mode 100644 index 00000000..ca643695 --- /dev/null +++ b/examples/anthropic-multimodal-tools.example.ts @@ -0,0 +1,350 @@ +import dotenv from "dotenv"; + +dotenv.config(); + +/** + * Example demonstrating a multi-turn conversation with images and tool use + * using Claude-style message format with the anthropic-compat helper functions. + * + * This example shows how to: + * 1. Send messages with image inputs (both URL and base64) + * 2. Handle tool calls and tool results in conversation history + * 3. Convert between Claude format and OpenResponses format across multiple turns + * 4. Build a 3-turn conversation with complex multimodal interactions + * + * The conversation flow: + * - Turn 1: User sends an image and asks about it + * - Turn 2: Model uses tools to analyze the image, user provides tool results + * - Turn 3: User asks follow-up question based on tool results + * + * To run this example from the examples directory with Bun: + * bun run anthropic-multimodal-tools.example.ts + */ + +import type { ClaudeMessageParam } from "../src/models/claude-message.js"; +import { + OpenRouter, + fromClaudeMessages, + toClaudeMessage, + ToolType, +} from "../src/index.js"; +import { z } from "zod/v4"; + +if (!process.env["OPENROUTER_API_KEY"]) { + throw new Error("Missing OPENROUTER_API_KEY environment variable"); +} + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +// Mock tool definition for image analysis +const tools = [ + { + type: ToolType.Function, + function: { + name: "analyze_image_details", + description: "Analyzes detailed visual features of an image including colors, objects, and composition", + inputSchema: z.object({ + image_id: z.string().describe("The ID of the image to analyze"), + analysis_type: z.enum(["color_palette", "object_detection", "scene_classification"]).describe("Type of analysis to perform"), + }), + outputSchema: z.object({ + colors: z.array(z.string()).optional(), + dominant_objects: z.array(z.string()).optional(), + composition: z.string().optional(), + lighting: z.string().optional(), + }), + }, + }, + { + type: ToolType.Function, + function: { + name: "get_image_metadata", + description: "Retrieves metadata about an image such as dimensions, format, and creation date", + inputSchema: z.object({ + image_id: z.string().describe("The ID of the image"), + }), + outputSchema: z.object({ + width: z.number(), + height: z.number(), + format: z.string(), + created: z.string(), + file_size: z.string(), + }), + }, + }, +]; + +async function multiTurnMultimodalConversation() { + // Using GPT-5 as requested + const model = "openai/gpt-5"; + + // Initialize message history with Claude-style message format + // Turn 1: User sends an image with a question + const messages: ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { + type: "text", + text: "I have this image of a sunset landscape. Can you analyze its visual features?", + }, + { + type: "image", + source: { + type: "url", + url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4", + }, + }, + ], + }, + ]; + + console.log("=== Turn 1 ==="); + console.log("User: I have this image of a sunset landscape. Can you analyze its visual features?"); + console.log("User: [Image URL: https://images.unsplash.com/photo-1506905925346-21bda4d32df4]"); + console.log(); + + // First turn - convert Claude messages to OpenResponses format and call with tools + const result1 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + tools, + toolChoice: "auto", + }); + + // Get the response and convert back to Claude format + const response1 = await result1.getResponse(); + const claudeMessage1 = toClaudeMessage(response1); + + console.log("Assistant response:"); + console.log("Stop reason:", claudeMessage1.stop_reason); + + // Extract content and tool calls + const textContent1: string[] = []; + const toolCalls1: Array<{ id: string; name: string; input: Record }> = []; + + for (const block of claudeMessage1.content) { + if (block.type === "text") { + textContent1.push(block.text); + } else if (block.type === "tool_use") { + toolCalls1.push({ + id: block.id, + name: block.name, + input: block.input, + }); + } + } + + if (textContent1.length > 0) { + console.log("Text:", textContent1.join("\n")); + } + + if (toolCalls1.length > 0) { + console.log("\nTool calls made:"); + for (const call of toolCalls1) { + console.log(`- ${call.name} (${call.id})`); + console.log(` Arguments:`, JSON.stringify(call.input, null, 2)); + } + } + + console.log(); + + // Add assistant response to history (as Claude-style message) + messages.push({ + role: "assistant", + content: claudeMessage1.content.map(block => { + if (block.type === "text") { + return { type: "text" as const, text: block.text }; + } else if (block.type === "tool_use") { + return { + type: "tool_use" as const, + id: block.id, + name: block.name, + input: block.input, + }; + } + // Handle other block types if needed + return { type: "text" as const, text: "" }; + }).filter(block => block.type !== "text" || block.text !== ""), + }); + + // Turn 2: User provides tool results with an image result + console.log("=== Turn 2 ==="); + console.log("User provides tool results:"); + + const toolResults: ClaudeMessageParam = { + role: "user", + content: toolCalls1.map((call, idx) => { + if (call.name === "analyze_image_details") { + // Simulate a tool result with text + console.log(`Tool result for ${call.id}:`); + console.log(" Analysis: The image shows warm orange and pink hues typical of sunset."); + + return { + type: "tool_result" as const, + tool_use_id: call.id, + content: JSON.stringify({ + colors: ["#FF6B35", "#F7931E", "#FDC830", "#F37335"], + dominant_objects: ["sky", "clouds", "mountains", "horizon"], + composition: "rule_of_thirds", + lighting: "golden_hour", + }), + }; + } else if (call.name === "get_image_metadata") { + console.log(`Tool result for ${call.id}:`); + console.log(" Metadata: 3840x2160, JPEG format"); + + return { + type: "tool_result" as const, + tool_use_id: call.id, + content: JSON.stringify({ + width: 3840, + height: 2160, + format: "JPEG", + created: "2023-06-15T18:45:00Z", + file_size: "2.4MB", + }), + }; + } + return { + type: "tool_result" as const, + tool_use_id: call.id, + content: "Tool execution successful", + }; + }), + }; + + messages.push(toolResults); + console.log(); + + // Second API call with tool results + const result2 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + tools, + }); + + const response2 = await result2.getResponse(); + const claudeMessage2 = toClaudeMessage(response2); + + console.log("Assistant response:"); + const textContent2: string[] = []; + + for (const block of claudeMessage2.content) { + if (block.type === "text") { + textContent2.push(block.text); + } + } + + console.log(textContent2.join("\n")); + console.log(); + + // Add assistant response to history + messages.push({ + role: "assistant", + content: textContent2.join("\n"), + }); + + // Turn 3: User asks a follow-up question with another image using base64 + console.log("=== Turn 3 ==="); + + // Create a simple base64 encoded 1x1 pixel PNG (for demonstration) + const base64Image = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="; + + messages.push({ + role: "user", + content: [ + { + type: "text", + text: "Great! Now I have another image here. How would you compare these two images in terms of color composition?", + }, + { + type: "image", + source: { + type: "base64", + media_type: "image/png", + data: base64Image, + }, + }, + ], + }); + + // Third API call + const result3 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + tools, + }); + + const response3 = await result3.getResponse(); + const claudeMessage3 = toClaudeMessage(response3); + + console.log("Assistant response:"); + const textContent3: string[] = []; + const toolCalls3: Array<{ id: string; name: string; input: Record }> = []; + + for (const block of claudeMessage3.content) { + if (block.type === "text") { + textContent3.push(block.text); + } else if (block.type === "tool_use") { + toolCalls3.push({ + id: block.id, + name: block.name, + input: block.input, + }); + } + } + + console.log(textContent3.join("\n")); + + if (toolCalls3.length > 0) { + console.log("\nTool calls made:"); + for (const call of toolCalls3) { + console.log(`- ${call.name} (${call.id})`); + console.log(` Arguments:`, JSON.stringify(call.input, null, 2)); + } + } + + console.log(); + + // Add final assistant response to history + messages.push({ + role: "assistant", + content: claudeMessage3.content.map(block => { + if (block.type === "text") { + return { type: "text" as const, text: block.text }; + } else if (block.type === "tool_use") { + return { + type: "tool_use" as const, + id: block.id, + name: block.name, + input: block.input, + }; + } + return { type: "text" as const, text: "" }; + }).filter(block => block.type !== "text" || block.text !== ""), + }); + + console.log("=== Conversation Complete ==="); + console.log(`Total messages in history: ${messages.length}`); + + // Show the final Claude message structure + console.log("\n=== Final Claude Message Structure ==="); + console.log("Stop reason:", claudeMessage3.stop_reason); + console.log("Model:", claudeMessage3.model); + console.log("Usage:", claudeMessage3.usage); + + return messages; +} + +async function main() { + try { + await multiTurnMultimodalConversation(); + } catch (error) { + console.error("Error:", error); + } +} + +main(); diff --git a/examples/anthropic-reasoning.example.ts b/examples/anthropic-reasoning.example.ts new file mode 100644 index 00000000..00c133e2 --- /dev/null +++ b/examples/anthropic-reasoning.example.ts @@ -0,0 +1,158 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import dotenv from "dotenv"; + +dotenv.config(); + +/** + * Example demonstrating multi-turn conversations using Claude-style messages + * with the anthropic-compat helper functions. + * + * This example shows how to: + * 1. Use Claude-style message format (ClaudeMessageParam) + * 2. Convert between Claude format and OpenResponses format + * 3. Build a 3-turn conversation carrying message history forward + * + * To run this example from the examples directory with Bun: + * bun run anthropic-reasoning.example.ts + */ + +import type { ClaudeMessageParam } from "../src/models/claude-message.js"; +import { + OpenRouter, + fromClaudeMessages, + toClaudeMessage, +} from "../src/index.js"; + +if (!process.env["OPENROUTER_API_KEY"]) { + throw new Error("Missing OPENROUTER_API_KEY environment variable"); +} + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function multiTurnClaudeConversation() { + const model = "anthropic/claude-sonnet-4"; + + // Initialize message history with Claude-style message format + const messages: ClaudeMessageParam[] = [ + { + role: "user", + content: "What are the key differences between functional and object-oriented programming?", + }, + ]; + + console.log("=== Turn 1 ==="); + console.log("User:", messages[0].content); + console.log(); + + // First turn - convert Claude messages to OpenResponses format + const result1 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + }); + + // Get the response and convert back to Claude format + const response1 = await result1.getResponse(); + const claudeMessage1 = toClaudeMessage(response1); + + // Extract text content from Claude message + const content1 = extractTextContent(claudeMessage1.content); + console.log("Assistant:", content1); + console.log(); + + // Add assistant response to history (as Claude-style message) + messages.push({ + role: "assistant", + content: content1, + }); + + // Add next user message + messages.push({ + role: "user", + content: "Can you show me an example of how the same problem would be solved differently in each paradigm?", + }); + + console.log("=== Turn 2 ==="); + console.log("User:", messages[messages.length - 1].content); + console.log(); + + // Second turn + const result2 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + }); + + const response2 = await result2.getResponse(); + const claudeMessage2 = toClaudeMessage(response2); + const content2 = extractTextContent(claudeMessage2.content); + console.log("Assistant:", content2); + console.log(); + + // Add to history + messages.push({ + role: "assistant", + content: content2, + }); + + messages.push({ + role: "user", + content: "Which paradigm would you recommend for building a large-scale web application and why?", + }); + + console.log("=== Turn 3 ==="); + console.log("User:", messages[messages.length - 1].content); + console.log(); + + // Third turn + const result3 = await openRouter.callModel({ + model, + input: fromClaudeMessages(messages), + }); + + const response3 = await result3.getResponse(); + const claudeMessage3 = toClaudeMessage(response3); + const content3 = extractTextContent(claudeMessage3.content); + console.log("Assistant:", content3); + console.log(); + + // Final message history + messages.push({ + role: "assistant", + content: content3, + }); + + console.log("=== Conversation Complete ==="); + console.log(`Total messages in history: ${messages.length}`); + + // Show the final Claude message structure + console.log("\n=== Final Claude Message Structure ==="); + console.log("Stop reason:", claudeMessage3.stop_reason); + console.log("Model:", claudeMessage3.model); + console.log("Usage:", claudeMessage3.usage); +} + +/** + * Helper to extract text content from Claude message content blocks + */ +function extractTextContent( + content: Array<{ type: string; text?: string }> +): string { + return content + .filter((block) => block.type === "text" && block.text) + .map((block) => block.text) + .join(""); +} + +async function main() { + try { + await multiTurnClaudeConversation(); + } catch (error) { + console.error("Error:", error); + } +} + +main(); diff --git a/examples/betaResponsesSend.example.ts b/examples/betaResponsesSend.example.ts index 3a7d364c..0a738675 100644 --- a/examples/betaResponsesSend.example.ts +++ b/examples/betaResponsesSend.example.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 66896eb477c6 */ import dotenv from "dotenv"; diff --git a/examples/callModel.example.ts b/examples/callModel.example.ts new file mode 100644 index 00000000..77c1a4e6 --- /dev/null +++ b/examples/callModel.example.ts @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import dotenv from "dotenv"; +dotenv.config(); +/** + * Example usage of the @openrouter/sdk SDK + * + * To run this example from the examples directory: + * npm run build && npx tsx betaResponsesSend.example.ts + */ + +import { OpenRouter } from "../src/index.js"; +import type { OpenResponsesEasyInputMessage } from "../src/models"; + + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +const text = "Hello! What is your name?"; +const responsesMessages: OpenResponsesEasyInputMessage[] = [ + { + type: "message", + role: "user", + content: [ + { + type: "input_text", + text: "What is your name?", + }, + ], + }, +]; + +const supportedInputSchemas = [text, responsesMessages]; + +for (const input of supportedInputSchemas) { + const result = await openRouter.callModel({ + instructions: "You are a helpful assistant. Your name is Mark", + model: "openai/gpt-4", + input: input, + }); + + // get resulting output each time in... + + // text format + console.log(await result.getText()); + + // response message format + console.log(await result.getResponse().then((response) => response.output)); + + // stream response message format + console.log(await result.getFullResponsesStream()); + + // stream text format + console.log(await result.getTextStream()); + + // stream just the messages (simpler than full response but more than just text) + console.log(await result.getNewMessagesStream()); + + // stream tool calls... (structured tool calls with parsed arguments) + console.log(await result.getToolCallsStream()); + + // get all tool calls... (structured tool calls with parsed arguments) + console.log(await result.getToolCalls()); +} diff --git a/examples/chat-reasoning.example.ts b/examples/chat-reasoning.example.ts new file mode 100644 index 00000000..1b842d2f --- /dev/null +++ b/examples/chat-reasoning.example.ts @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import dotenv from "dotenv"; + +dotenv.config(); + +/** + * Example demonstrating multi-turn chat conversations with reasoning models. + * + * This example shows how to build a conversation over 3 turns, + * carrying the message history forward with each request. + * + * To run this example from the examples directory with Bun: + * bun run chat-reasoning.example.ts + */ + +import type { Message } from "../src/models/index.js"; +import { OpenRouter } from "../src/index.js"; + +if (!process.env["OPENROUTER_API_KEY"]) { + throw new Error("Missing OPENROUTER_API_KEY environment variable"); +} + +const openRouter = new OpenRouter({ + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", +}); + +async function multiTurnConversation() { + const model = "google/gemini-3-pro-preview"; + + // Initialize message history with the first user message + const messages: Message[] = [ + { + role: "user", + content: "What are the three most important principles of good software architecture?", + }, + ]; + + console.log("=== Turn 1 ==="); + console.log("User:", messages[0].content); + console.log(); + + // First turn + const result1 = await openRouter.chat.send({ + model, + messages, + stream: false, + }); + + if (!("choices" in result1)) { + throw new Error("Unexpected response format"); + } + + const assistant1 = result1.choices[0].message; + console.log("Assistant:", assistant1.content); + console.log(); + + // Add assistant response and next user message to history + messages.push(assistant1); + messages.push({ + role: "user", + content: "Can you elaborate on the second principle? Give me a concrete example.", + }); + + console.log("=== Turn 2 ==="); + console.log("User:", messages[messages.length - 1].content); + console.log(); + + // Second turn + const result2 = await openRouter.chat.send({ + model, + messages, + stream: false, + }); + + if (!("choices" in result2)) { + throw new Error("Unexpected response format"); + } + + const assistant2 = result2.choices[0].message; + console.log("Assistant:", assistant2.content); + console.log(); + + // Add assistant response and next user message to history + messages.push(assistant2); + messages.push({ + role: "user", + content: "How would you apply this in a TypeScript project specifically?", + }); + + console.log("=== Turn 3 ==="); + console.log("User:", messages[messages.length - 1].content); + console.log(); + + // Third turn + const result3 = await openRouter.chat.send({ + model, + messages, + stream: false, + }); + + if (!("choices" in result3)) { + throw new Error("Unexpected response format"); + } + + const assistant3 = result3.choices[0].message; + console.log("Assistant:", assistant3.content); + console.log(); + + // Final message history + messages.push(assistant3); + + console.log("=== Conversation Complete ==="); + console.log(`Total messages in history: ${messages.length}`); +} + +async function main() { + try { + await multiTurnConversation(); + } catch (error) { + console.error("Error:", error); + } +} + +main(); diff --git a/examples/chatCompletions.example.ts b/examples/chatCompletions.example.ts index 4fc5622a..9529c6d7 100644 --- a/examples/chatCompletions.example.ts +++ b/examples/chatCompletions.example.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import dotenv from 'dotenv'; +import dotenv from "dotenv"; dotenv.config(); @@ -13,39 +13,40 @@ dotenv.config(); * bun run chatCompletions.example.ts */ -import { OpenRouter } from '@openrouter/sdk'; +import { OpenRouter } from "../src/index.js"; -if (!process.env['OPENROUTER_API_KEY']) { - throw new Error('Missing OPENROUTER_API_KEY environment variable'); +if (!process.env["OPENROUTER_API_KEY"]) { + throw new Error("Missing OPENROUTER_API_KEY environment variable"); } const openRouter = new OpenRouter({ - apiKey: process.env['OPENROUTER_API_KEY'] ?? '', + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", debugLogger: console, }); async function nonStreamingExample() { const result = await openRouter.chat.send({ - model: 'qwen/qwen3-max', + model: "qwen/qwen3-max", messages: [ { - role: 'user', - content: 'Tell me a short joke about programming', + role: "user", + content: "Tell me a short joke about programming", }, ], stream: false, }); - if ('choices' in result) { + if ("choices" in result) { + console.log(result.choices[0].message.content); } } async function streamingExample() { const result = await openRouter.chat.send({ - model: 'qwen/qwen3-max', + model: "qwen/qwen3-max", messages: [ { - role: 'user', - content: 'Write a haiku about TypeScript', + role: "user", + content: "Write a haiku about TypeScript", }, ], stream: true, @@ -54,9 +55,9 @@ async function streamingExample() { }, }); - if (result && typeof result === 'object' && Symbol.asyncIterator in result) { + if (result && typeof result === "object" && Symbol.asyncIterator in result) { const stream = result; - let _fullContent = ''; + let _fullContent = ""; for await (const chunk of stream) { if (chunk.choices?.[0]?.delta?.content) { @@ -66,6 +67,7 @@ async function streamingExample() { } if (chunk.usage) { + console.log(chunk.usage); } } } @@ -75,7 +77,9 @@ async function main() { try { await nonStreamingExample(); await streamingExample(); - } catch (_error) {} + } catch (_error) { + console.error(_error); + } } main(); diff --git a/examples/embeddings.example.ts b/examples/embeddings.example.ts index fa03b09a..5523e509 100644 --- a/examples/embeddings.example.ts +++ b/examples/embeddings.example.ts @@ -1,4 +1,4 @@ -import dotenv from 'dotenv'; +import dotenv from "dotenv"; dotenv.config(); @@ -9,35 +9,37 @@ dotenv.config(); * bun run embeddings.example.ts */ -import { OpenRouter } from '@openrouter/sdk'; +import { OpenRouter } from "../src/index.js"; -if (!process.env['OPENROUTER_API_KEY']) { - throw new Error('Missing OPENROUTER_API_KEY environment variable'); +if (!process.env["OPENROUTER_API_KEY"]) { + throw new Error("Missing OPENROUTER_API_KEY environment variable"); } const openRouter = new OpenRouter({ - apiKey: process.env['OPENROUTER_API_KEY'] ?? '', + apiKey: process.env["OPENROUTER_API_KEY"] ?? "", }); /** * Basic embedding generation with a single text input */ async function singleTextEmbedding() { - console.log('=== Single Text Embedding ===\n'); + console.log("=== Single Text Embedding ===\n"); const response = await openRouter.embeddings.generate({ - input: 'The quick brown fox jumps over the lazy dog', - model: 'openai/text-embedding-3-small', + input: "The quick brown fox jumps over the lazy dog", + model: "openai/text-embedding-3-small", }); - if (typeof response === 'object' && 'data' in response) { + if (typeof response === "object" && "data" in response) { console.log(`Model: ${response.model}`); console.log(`Number of embeddings: ${response.data.length}`); const embedding = response.data[0]; if (embedding && Array.isArray(embedding.embedding)) { console.log(`Embedding dimensions: ${embedding.embedding.length}`); - console.log(`First 5 values: [${embedding.embedding.slice(0, 5).join(', ')}...]`); + console.log( + `First 5 values: [${embedding.embedding.slice(0, 5).join(", ")}...]` + ); } if (response.usage) { @@ -45,28 +47,30 @@ async function singleTextEmbedding() { } } - console.log(''); + console.log(""); } /** * Batch embedding generation with multiple text inputs */ async function batchEmbeddings() { - console.log('=== Batch Embeddings ===\n'); + console.log("=== Batch Embeddings ===\n"); const texts = [ - 'Machine learning is a subset of artificial intelligence.', - 'Natural language processing helps computers understand text.', - 'Embeddings represent text as numerical vectors.', + "Machine learning is a subset of artificial intelligence.", + "Natural language processing helps computers understand text.", + "Embeddings represent text as numerical vectors.", ]; const response = await openRouter.embeddings.generate({ input: texts, - model: 'openai/text-embedding-3-small', + model: "openai/text-embedding-3-small", }); - if (typeof response === 'object' && 'data' in response) { - console.log(`Generated ${response.data.length} embeddings for ${texts.length} texts`); + if (typeof response === "object" && "data" in response) { + console.log( + `Generated ${response.data.length} embeddings for ${texts.length} texts` + ); response.data.forEach((item, index) => { if (item && Array.isArray(item.embedding)) { @@ -79,22 +83,22 @@ async function batchEmbeddings() { } } - console.log(''); + console.log(""); } /** * Generate embeddings with custom dimensions (if supported by the model) */ async function customDimensionsEmbedding() { - console.log('=== Custom Dimensions Embedding ===\n'); + console.log("=== Custom Dimensions Embedding ===\n"); const response = await openRouter.embeddings.generate({ - input: 'This text will be embedded with reduced dimensions.', - model: 'openai/text-embedding-3-small', + input: "This text will be embedded with reduced dimensions.", + model: "openai/text-embedding-3-small", dimensions: 256, // Request smaller embedding size }); - if (typeof response === 'object' && 'data' in response) { + if (typeof response === "object" && "data" in response) { const embedding = response.data[0]; if (embedding && Array.isArray(embedding.embedding)) { console.log(`Requested dimensions: 256`); @@ -102,14 +106,14 @@ async function customDimensionsEmbedding() { } } - console.log(''); + console.log(""); } /** * List available embedding models */ async function listEmbeddingModels() { - console.log('=== Available Embedding Models ===\n'); + console.log("=== Available Embedding Models ===\n"); const response = await openRouter.embeddings.listModels(); @@ -129,14 +133,14 @@ async function listEmbeddingModels() { } } - console.log(''); + console.log(""); } /** * Calculate cosine similarity between two embeddings */ function cosineSimilarity(a: number[], b: number[]): number { - if (a.length !== b.length) throw new Error('Vectors must have same length'); + if (a.length !== b.length) throw new Error("Vectors must have same length"); let dotProduct = 0; let normA = 0; @@ -155,20 +159,20 @@ function cosineSimilarity(a: number[], b: number[]): number { * Demonstrate semantic similarity using embeddings */ async function semanticSimilarity() { - console.log('=== Semantic Similarity ===\n'); + console.log("=== Semantic Similarity ===\n"); const texts = [ - 'The cat sat on the mat.', - 'A feline rested on the rug.', - 'The stock market crashed today.', + "The cat sat on the mat.", + "A feline rested on the rug.", + "The stock market crashed today.", ]; const response = await openRouter.embeddings.generate({ input: texts, - model: 'openai/text-embedding-3-small', + model: "openai/text-embedding-3-small", }); - if (typeof response === 'object' && 'data' in response) { + if (typeof response === "object" && "data" in response) { const embeddings = response.data .map((item) => (Array.isArray(item?.embedding) ? item.embedding : null)) .filter((e): e is number[] => e !== null); @@ -178,7 +182,7 @@ async function semanticSimilarity() { const sim02 = cosineSimilarity(embeddings[0], embeddings[2]); const sim12 = cosineSimilarity(embeddings[1], embeddings[2]); - console.log('Comparing semantic similarity:\n'); + console.log("Comparing semantic similarity:\n"); console.log(` "${texts[0]}"`); console.log(` "${texts[1]}"`); console.log(` Similarity: ${(sim01 * 100).toFixed(2)}%\n`); @@ -191,11 +195,11 @@ async function semanticSimilarity() { console.log(` "${texts[2]}"`); console.log(` Similarity: ${(sim12 * 100).toFixed(2)}%\n`); - console.log('Note: Higher similarity = more semantically related'); + console.log("Note: Higher similarity = more semantically related"); } } - console.log(''); + console.log(""); } async function main() { @@ -206,9 +210,9 @@ async function main() { await listEmbeddingModels(); await semanticSimilarity(); - console.log('All examples completed successfully!'); + console.log("All examples completed successfully!"); } catch (error) { - console.error('Error running examples:', error); + console.error("Error running examples:", error); process.exit(1); } } diff --git a/jsr.json b/jsr.json index e9222ebb..33a0a439 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@openrouter/sdk", - "version": "0.3.2", + "version": "0.3.7", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 0408db65..ac2454d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/sdk", - "version": "0.3.2", + "version": "0.3.7", "author": "OpenRouter", "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.", "keywords": [ diff --git a/src/core.ts b/src/core.ts index e8f7c169..87473453 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f431fdbcd144 */ import { ClientSDK } from "./lib/sdks.js"; diff --git a/src/funcs/analyticsGetUserActivity.ts b/src/funcs/analyticsGetUserActivity.ts index 4fd234f4..4768169a 100644 --- a/src/funcs/analyticsGetUserActivity.ts +++ b/src/funcs/analyticsGetUserActivity.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6525bcc66ab5 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysCreate.ts b/src/funcs/apiKeysCreate.ts index d35c2dcf..2f05162d 100644 --- a/src/funcs/apiKeysCreate.ts +++ b/src/funcs/apiKeysCreate.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 133e2c5f487c */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysDelete.ts b/src/funcs/apiKeysDelete.ts index d23f73e3..b365c6d4 100644 --- a/src/funcs/apiKeysDelete.ts +++ b/src/funcs/apiKeysDelete.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c151c399f75f */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysGet.ts b/src/funcs/apiKeysGet.ts index e7713c61..f1799990 100644 --- a/src/funcs/apiKeysGet.ts +++ b/src/funcs/apiKeysGet.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 12a5c2abbddd */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysGetCurrentKeyMetadata.ts b/src/funcs/apiKeysGetCurrentKeyMetadata.ts index b73ac64d..1f0aab97 100644 --- a/src/funcs/apiKeysGetCurrentKeyMetadata.ts +++ b/src/funcs/apiKeysGetCurrentKeyMetadata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d9449cb31931 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysList.ts b/src/funcs/apiKeysList.ts index 92de90df..cdce4460 100644 --- a/src/funcs/apiKeysList.ts +++ b/src/funcs/apiKeysList.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2afc8d8f1ce0 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/apiKeysUpdate.ts b/src/funcs/apiKeysUpdate.ts index dff65d4a..b41d43b0 100644 --- a/src/funcs/apiKeysUpdate.ts +++ b/src/funcs/apiKeysUpdate.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 05700884934b */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/betaResponsesSend.ts b/src/funcs/betaResponsesSend.ts index cddbbaef..3f63d38e 100644 --- a/src/funcs/betaResponsesSend.ts +++ b/src/funcs/betaResponsesSend.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c5c4ab0c3f76 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/call-model.ts b/src/funcs/call-model.ts new file mode 100644 index 00000000..a90ed0da --- /dev/null +++ b/src/funcs/call-model.ts @@ -0,0 +1,183 @@ +import type { OpenRouterCore } from "../core.js"; +import type { RequestOptions } from "../lib/sdks.js"; +import type { Tool, MaxToolRounds } from "../lib/tool-types.js"; +import type * as models from "../models/index.js"; + +import { ModelResult } from "../lib/model-result.js"; +import { convertToolsToAPIFormat } from "../lib/tool-executor.js"; + +/** + * Checks if a message looks like a Claude-style message + */ +function isClaudeStyleMessage(msg: any): msg is models.ClaudeMessageParam { + if (!msg || typeof msg !== 'object') return false; + + // Check if it has a role field that's user or assistant + const role = msg.role; + if (role !== 'user' && role !== 'assistant') return false; + + // Check if content is an array with Claude-style content blocks + if (Array.isArray(msg.content)) { + return msg.content.some((block: any) => + block && + typeof block === 'object' && + block.type && + // Claude content block types (not OpenRouter types) + (block.type === 'text' || block.type === 'image' || block.type === 'tool_use' || block.type === 'tool_result') + ); + } + + return false; +} + +/** + * Converts Claude-style content blocks to OpenRouter format + */ +function convertClaudeContentBlock( + block: models.ClaudeContentBlockParam +): models.ResponseInputText | models.ResponseInputImage | null { + if (!block || typeof block !== 'object' || !('type' in block)) { + return null; + } + + switch (block.type) { + case 'text': { + const textBlock = block as models.ClaudeTextBlockParam; + return { + type: 'input_text', + text: textBlock.text, + }; + } + case 'image': { + const imageBlock = block as models.ClaudeImageBlockParam; + if (imageBlock.source.type === 'url') { + return { + type: 'input_image', + detail: 'auto', + imageUrl: imageBlock.source.url, + }; + } else if (imageBlock.source.type === 'base64') { + const dataUri = `data:${imageBlock.source.media_type};base64,${imageBlock.source.data}`; + return { + type: 'input_image', + detail: 'auto', + imageUrl: dataUri, + }; + } + return null; + } + case 'tool_use': + case 'tool_result': + // tool_use and tool_result are not handled here as they map to different input types + return null; + default: + return null; + } +} + +/** + * Converts a Claude-style message to OpenRouter EasyInputMessage format + */ +function convertClaudeMessage(msg: models.ClaudeMessageParam): models.OpenResponsesEasyInputMessage { + const { role, content } = msg; + + if (typeof content === 'string') { + return { + role: role === 'user' ? 'user' : 'assistant', + content, + }; + } + + // Convert array of content blocks + const convertedBlocks: (models.ResponseInputText | models.ResponseInputImage)[] = []; + for (const block of content) { + const converted = convertClaudeContentBlock(block); + if (converted) { + convertedBlocks.push(converted); + } + } + + // If all blocks were text, concatenate them into a string + const allText = convertedBlocks.every(b => b.type === 'input_text'); + if (allText) { + const text = convertedBlocks + .map(b => (b as models.ResponseInputText).text) + .join(''); + return { + role: role === 'user' ? 'user' : 'assistant', + content: text, + }; + } + + // Otherwise, return as array + return { + role: role === 'user' ? 'user' : 'assistant', + content: convertedBlocks, + }; +} + +/** + * Get a response with multiple consumption patterns + * + * @remarks + * Creates a response using the OpenResponses API and returns + * a wrapper that allows consuming the response in multiple ways: + * + * - `await response.getText()` - Get just the text content (tools auto-executed) + * - `await response.getResponse()` - Get full response with usage data (inputTokens, cachedTokens, etc.) + * - `for await (const delta of response.getTextStream())` - Stream text deltas + * - `for await (const delta of response.getReasoningStream())` - Stream reasoning deltas + * - `for await (const event of response.getToolStream())` - Stream tool events (incl. preliminary results) + * - `for await (const toolCall of response.getToolCallsStream())` - Stream structured tool calls + * - `await response.getToolCalls()` - Get all tool calls from completed response + * - `for await (const msg of response.getNewMessagesStream())` - Stream incremental message updates + * - `for await (const event of response.getFullResponsesStream())` - Stream all events (incl. tool preliminary) + * + * All consumption patterns can be used concurrently on the same response. + * + * For message format conversion, use the helper functions: + * - `fromChatMessages()` / `toChatMessage()` for OpenAI chat format + * - `fromClaudeMessages()` / `toClaudeMessage()` for Anthropic Claude format + */ +export function callModel( + client: OpenRouterCore, + request: Omit & { + tools?: Tool[]; + maxToolRounds?: MaxToolRounds; + }, + options?: RequestOptions +): ModelResult { + const { tools, maxToolRounds, ...apiRequest } = request; + + // Auto-convert Claude-style messages if detected + let processedInput = apiRequest.input; + if (Array.isArray(apiRequest.input)) { + const hasClaudeMessages = apiRequest.input.some(isClaudeStyleMessage); + if (hasClaudeMessages) { + processedInput = apiRequest.input.map((msg: any) => { + if (isClaudeStyleMessage(msg)) { + return convertClaudeMessage(msg); + } + return msg; + }); + } + } + + // Convert tools to API format and extract enhanced tools if present + const apiTools = tools ? convertToolsToAPIFormat(tools) : undefined; + + // Build the request with converted tools and input + const finalRequest: models.OpenResponsesRequest = { + ...apiRequest, + ...(processedInput !== undefined && { input: processedInput }), + ...(apiTools !== undefined && { tools: apiTools }), + }; + + return new ModelResult({ + client, + request: finalRequest, + options: options ?? {}, + tools: tools ?? [], + ...(maxToolRounds !== undefined && { maxToolRounds }), + }); +} diff --git a/src/funcs/callModel.ts b/src/funcs/callModel.ts deleted file mode 100644 index b2d79ec5..00000000 --- a/src/funcs/callModel.ts +++ /dev/null @@ -1,278 +0,0 @@ -import type { OpenRouterCore } from '../core.js'; -import type { RequestOptions } from '../lib/sdks.js'; -import type { Tool, MaxToolRounds } from '../lib/tool-types.js'; -import type * as models from '../models/index.js'; - -import { ResponseWrapper } from '../lib/response-wrapper.js'; -import { convertToolsToAPIFormat } from '../lib/tool-executor.js'; - -/** - * Input type that accepts both chat-style messages and responses-style input - */ -export type CallModelInput = models.OpenResponsesInput | models.Message[]; - -/** - * Tool type that accepts chat-style, responses-style, or enhanced tools - */ -export type CallModelTools = - | Tool[] - | models.ToolDefinitionJson[] - | models.OpenResponsesRequest['tools']; - -/** - * Check if input is chat-style messages (Message[]) - */ -function isChatStyleMessages(input: CallModelInput): input is models.Message[] { - if (!Array.isArray(input)) { - return false; - } - if (input.length === 0) { - return false; - } - - const first = input[0] as Record; - // Chat-style messages have role but no 'type' field at top level - // Responses-style items have 'type' field (like 'message', 'function_call', etc.) - return first && 'role' in first && !('type' in first); -} - -/** - * Check if tools are chat-style (ToolDefinitionJson[]) - */ -function isChatStyleTools(tools: CallModelTools): tools is models.ToolDefinitionJson[] { - if (!Array.isArray(tools)) { - return false; - } - if (tools.length === 0) { - return false; - } - - const first = tools[0] as Record; - // Chat-style tools have nested 'function' property with 'name' inside - // Enhanced tools have 'function' with 'inputSchema' - // Responses-style tools have 'name' at top level - const fn = first?.['function'] as Record | undefined; - return ( - first && - 'function' in first && - fn !== undefined && - fn !== null && - 'name' in fn && - !('inputSchema' in fn) - ); -} - -/** - * Convert chat-style tools to responses-style - */ -function convertChatToResponsesTools( - tools: models.ToolDefinitionJson[], -): models.OpenResponsesRequest['tools'] { - return tools.map( - (tool): models.OpenResponsesRequestToolFunction => ({ - type: 'function', - name: tool.function.name, - description: tool.function.description ?? null, - strict: tool.function.strict ?? null, - parameters: tool.function.parameters ?? null, - }), - ); -} - -/** - * Convert chat-style messages to responses-style input - */ -function convertChatToResponsesInput(messages: models.Message[]): models.OpenResponsesInput { - return messages.map( - (msg): models.OpenResponsesEasyInputMessage | models.OpenResponsesFunctionCallOutput => { - // Extract extra fields like cache_control - const { role, content, ...extraFields } = msg as models.Message & Record; - - if (role === 'tool') { - const toolMsg = msg as models.ToolResponseMessage; - return { - type: 'function_call_output', - callId: toolMsg.toolCallId, - output: - typeof toolMsg.content === 'string' ? toolMsg.content : JSON.stringify(toolMsg.content), - ...extraFields, - } as models.OpenResponsesFunctionCallOutput; - } - - // Handle assistant messages with tool calls - if (role === 'assistant') { - const assistantMsg = msg as models.AssistantMessage; - // If it has tool calls, we need to convert them - // For now, just convert the content part - return { - role: 'assistant', - content: - typeof assistantMsg.content === 'string' - ? assistantMsg.content - : assistantMsg.content === null - ? '' - : JSON.stringify(assistantMsg.content), - ...extraFields, - } as models.OpenResponsesEasyInputMessage; - } - - // System, user, developer messages - const convertedContent = - typeof content === 'string' - ? content - : content === null || content === undefined - ? '' - : JSON.stringify(content); - - return { - role: role as 'user' | 'system' | 'developer', - content: convertedContent, - ...extraFields, - } as models.OpenResponsesEasyInputMessage; - }, - ) as models.OpenResponsesInput; -} - -/** - * Get a response with multiple consumption patterns - * - * @remarks - * Creates a response using the OpenResponses API in streaming mode and returns - * a wrapper that allows consuming the response in multiple ways: - * - * - `await response.getMessage()` - Get the completed message (tools auto-executed) - * - `await response.getText()` - Get just the text content (tools auto-executed) - * - `await response.getResponse()` - Get full response with usage data (inputTokens, cachedTokens, etc.) - * - `for await (const delta of response.getTextStream())` - Stream text deltas - * - `for await (const delta of response.getReasoningStream())` - Stream reasoning deltas - * - `for await (const event of response.getToolStream())` - Stream tool events (incl. preliminary results) - * - `for await (const toolCall of response.getToolCallsStream())` - Stream structured tool calls - * - `await response.getToolCalls()` - Get all tool calls from completed response - * - `for await (const msg of response.getNewMessagesStream())` - Stream incremental message updates - * - `for await (const event of response.getFullResponsesStream())` - Stream all events (incl. tool preliminary) - * - `for await (const event of response.getFullChatStream())` - Stream in chat format (incl. tool preliminary) - * - * All consumption patterns can be used concurrently on the same response. - * - * @example - * ```typescript - * import { z } from 'zod'; - * - * // Simple text extraction - * const response = openrouter.callModel({ - * model: "openai/gpt-4", - * input: "Hello!" - * }); - * const text = await response.getText(); - * console.log(text); - * - * // With tools (automatic execution) - * const response = openrouter.callModel({ - * model: "openai/gpt-4", - * input: "What's the weather in SF?", - * tools: [{ - * type: "function", - * function: { - * name: "get_weather", - * description: "Get current weather", - * inputSchema: z.object({ - * location: z.string() - * }), - * outputSchema: z.object({ - * temperature: z.number(), - * description: z.string() - * }), - * execute: async (params) => { - * return { temperature: 72, description: "Sunny" }; - * } - * } - * }], - * maxToolRounds: 5, // or function: (context: TurnContext) => boolean - * }); - * const message = await response.getMessage(); // Tools auto-executed! - * - * // Stream with preliminary results - * for await (const event of response.getFullChatStream()) { - * if (event.type === "content.delta") { - * process.stdout.write(event.delta); - * } else if (event.type === "tool.preliminary_result") { - * console.log("Tool progress:", event.result); - * } - * } - * ``` - */ -export function callModel( - client: OpenRouterCore, - request: Omit & { - input?: CallModelInput; - tools?: CallModelTools; - maxToolRounds?: MaxToolRounds; - }, - options?: RequestOptions, -): ResponseWrapper { - const { tools, maxToolRounds, input, ...restRequest } = request; - - // Convert chat-style messages to responses-style input if needed - const convertedInput = - input && isChatStyleMessages(input) ? convertChatToResponsesInput(input) : input; - - const apiRequest = { - ...restRequest, - input: convertedInput, - }; - - // Determine tool type and convert as needed - let isEnhancedTools = false; - let isChatTools = false; - - if (tools && Array.isArray(tools) && tools.length > 0) { - const firstTool = tools[0] as Record; - const fn = firstTool?.['function'] as Record | undefined; - isEnhancedTools = - 'function' in firstTool && fn !== undefined && fn !== null && 'inputSchema' in fn; - isChatTools = !isEnhancedTools && isChatStyleTools(tools); - } - - const enhancedTools = isEnhancedTools ? (tools as Tool[]) : undefined; - - // Convert tools to API format based on their type - let apiTools: models.OpenResponsesRequest['tools']; - if (enhancedTools) { - apiTools = convertToolsToAPIFormat(enhancedTools); - } else if (isChatTools) { - apiTools = convertChatToResponsesTools(tools as models.ToolDefinitionJson[]); - } else { - apiTools = tools as models.OpenResponsesRequest['tools']; - } - - // Build the request with converted tools - const finalRequest: models.OpenResponsesRequest = { - ...apiRequest, - ...(apiTools && { - tools: apiTools, - }), - } as models.OpenResponsesRequest; - - const wrapperOptions: { - client: OpenRouterCore; - request: models.OpenResponsesRequest; - options: RequestOptions; - tools?: Tool[]; - maxToolRounds?: MaxToolRounds; - } = { - client, - request: finalRequest, - options: options ?? {}, - }; - - // Only pass enhanced tools to wrapper (needed for auto-execution) - if (enhancedTools) { - wrapperOptions.tools = enhancedTools; - } - - if (maxToolRounds !== undefined) { - wrapperOptions.maxToolRounds = maxToolRounds; - } - - return new ResponseWrapper(wrapperOptions); -} diff --git a/src/funcs/chatSend.ts b/src/funcs/chatSend.ts index a0891e85..3054ce2a 100644 --- a/src/funcs/chatSend.ts +++ b/src/funcs/chatSend.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8c3aa3c963bf */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/completionsGenerate.ts b/src/funcs/completionsGenerate.ts index a34c5b8d..90f94a93 100644 --- a/src/funcs/completionsGenerate.ts +++ b/src/funcs/completionsGenerate.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 54a6e7c9b712 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/creditsCreateCoinbaseCharge.ts b/src/funcs/creditsCreateCoinbaseCharge.ts index c7b45be4..0acd1929 100644 --- a/src/funcs/creditsCreateCoinbaseCharge.ts +++ b/src/funcs/creditsCreateCoinbaseCharge.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e07ee6831da3 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/creditsGetCredits.ts b/src/funcs/creditsGetCredits.ts index b2dfad0f..63149dce 100644 --- a/src/funcs/creditsGetCredits.ts +++ b/src/funcs/creditsGetCredits.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 88fdc1315137 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/embeddingsGenerate.ts b/src/funcs/embeddingsGenerate.ts index 998f5969..80464839 100644 --- a/src/funcs/embeddingsGenerate.ts +++ b/src/funcs/embeddingsGenerate.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f6455fcfe2c8 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/embeddingsListModels.ts b/src/funcs/embeddingsListModels.ts index a07111e3..95d734bb 100644 --- a/src/funcs/embeddingsListModels.ts +++ b/src/funcs/embeddingsListModels.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: dbe9751f8369 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/endpointsList.ts b/src/funcs/endpointsList.ts index 5dae15ad..031c9fe2 100644 --- a/src/funcs/endpointsList.ts +++ b/src/funcs/endpointsList.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ea932ec09987 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/endpointsListZdrEndpoints.ts b/src/funcs/endpointsListZdrEndpoints.ts index 1eab561c..5aaad366 100644 --- a/src/funcs/endpointsListZdrEndpoints.ts +++ b/src/funcs/endpointsListZdrEndpoints.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4efb7ea3e48f */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/generationsGetGeneration.ts b/src/funcs/generationsGetGeneration.ts index 094dd166..b8418b55 100644 --- a/src/funcs/generationsGetGeneration.ts +++ b/src/funcs/generationsGetGeneration.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: dac2d205a08d */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/modelsCount.ts b/src/funcs/modelsCount.ts index cd17643c..1425d911 100644 --- a/src/funcs/modelsCount.ts +++ b/src/funcs/modelsCount.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 371adfc67b48 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/modelsList.ts b/src/funcs/modelsList.ts index 2b9d4049..18f86201 100644 --- a/src/funcs/modelsList.ts +++ b/src/funcs/modelsList.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: deff050b46c5 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/modelsListForUser.ts b/src/funcs/modelsListForUser.ts index 55de0c1c..e0877a54 100644 --- a/src/funcs/modelsListForUser.ts +++ b/src/funcs/modelsListForUser.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: db628dd3c179 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/oAuthCreateAuthCode.ts b/src/funcs/oAuthCreateAuthCode.ts index c27ef6d0..227561e9 100644 --- a/src/funcs/oAuthCreateAuthCode.ts +++ b/src/funcs/oAuthCreateAuthCode.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8a79f27722c0 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/oAuthExchangeAuthCodeForAPIKey.ts b/src/funcs/oAuthExchangeAuthCodeForAPIKey.ts index 76630a81..22eb8cd4 100644 --- a/src/funcs/oAuthExchangeAuthCodeForAPIKey.ts +++ b/src/funcs/oAuthExchangeAuthCodeForAPIKey.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3386ec12d934 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/parametersGetParameters.ts b/src/funcs/parametersGetParameters.ts index a5adc582..fe89f6f5 100644 --- a/src/funcs/parametersGetParameters.ts +++ b/src/funcs/parametersGetParameters.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 565ce9801e34 */ import { OpenRouterCore } from "../core.js"; diff --git a/src/funcs/providersList.ts b/src/funcs/providersList.ts index 98b6bc6b..790ffbf9 100644 --- a/src/funcs/providersList.ts +++ b/src/funcs/providersList.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8ad87e7210ae */ import { OpenRouterCore } from "../core.js"; diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index 7ed9e044..ebc4ecc4 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a2463fc6f69b */ import { SDKOptions } from "../lib/config.js"; diff --git a/src/hooks/index.ts b/src/hooks/index.ts index f60ec7ac..9345e1ad 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5f2dab62b520 */ export * from "./hooks.js"; diff --git a/src/hooks/types.ts b/src/hooks/types.ts index 9c36bf01..ccd5e5d8 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2a02d86ec24f */ import { SDKOptions } from "../lib/config.js"; diff --git a/src/index.ts b/src/index.ts index dbcba164..c9a3a755 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,3 +7,8 @@ export * as files from "./lib/files.js"; export { HTTPClient } from "./lib/http.js"; export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; export * from "./sdk/sdk.js"; + +// Message format compatibility helpers +export { fromClaudeMessages, toClaudeMessage } from "./lib/anthropic-compat.js"; +export { fromChatMessages, toChatMessage } from "./lib/chat-compat.js"; +export { extractUnsupportedContent, hasUnsupportedContent, getUnsupportedContentSummary } from "./lib/stream-transformers.js"; diff --git a/src/lib/anthropic-compat.test.ts b/src/lib/anthropic-compat.test.ts new file mode 100644 index 00000000..10ebfcb3 --- /dev/null +++ b/src/lib/anthropic-compat.test.ts @@ -0,0 +1,539 @@ +import { describe, expect, it } from "vitest"; +import { fromClaudeMessages, toClaudeMessage } from "./anthropic-compat.js"; +import type * as models from "../models/index.js"; + +/** + * Creates a properly typed mock OpenResponsesNonStreamingResponse for testing. + * This factory provides all required fields with sensible defaults. + */ +function createMockResponse( + overrides: Partial & { + output: models.OpenResponsesNonStreamingResponse["output"]; + } +): models.OpenResponsesNonStreamingResponse { + return { + id: "resp_test", + object: "response", + createdAt: Date.now(), + model: "openai/gpt-4", + status: "completed", + error: null, + incompleteDetails: null, + temperature: null, + topP: null, + metadata: null, + tools: [], + toolChoice: "auto", + parallelToolCalls: false, + ...overrides, + }; +} + +describe("fromClaudeMessages", () => { + describe("basic message conversion", () => { + it("converts user message with string content", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { role: "user", content: "Hello, how are you?" }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { role: "user", content: "Hello, how are you?" }, + ]); + }); + + it("converts assistant message with string content", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { role: "assistant", content: "I am doing well, thank you!" }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { role: "assistant", content: "I am doing well, thank you!" }, + ]); + }); + + it("converts multiple messages in conversation", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { role: "user", content: "Hi" }, + { role: "assistant", content: "Hello!" }, + { role: "user", content: "How are you?" }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { role: "user", content: "Hi" }, + { role: "assistant", content: "Hello!" }, + { role: "user", content: "How are you?" }, + ]); + }); + }); + + describe("text block content conversion", () => { + it("converts user message with text block array", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [{ type: "text", text: "Hello from text block" }], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { role: "user", content: "Hello from text block" }, + ]); + }); + + it("combines multiple text blocks into single content string", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "First part. " }, + { type: "text", text: "Second part." }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { role: "user", content: "First part. Second part." }, + ]); + }); + }); + + describe("tool_result block conversion", () => { + it("converts tool_result with string content to function_call_output", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { + type: "tool_result", + tool_use_id: "tool_123", + content: "Tool execution result", + }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { + type: "function_call_output", + callId: "tool_123", + output: "Tool execution result", + }, + ]); + }); + + it("converts tool_result with text block array to function_call_output", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { + type: "tool_result", + tool_use_id: "tool_456", + content: [ + { type: "text", text: "Result part 1. " }, + { type: "text", text: "Result part 2." }, + ], + }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([ + { + type: "function_call_output", + callId: "tool_456", + output: "Result part 1. Result part 2.", + }, + ]); + }); + + it("handles mixed text and tool_result blocks", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "Here is some context. " }, + { + type: "tool_result", + tool_use_id: "tool_789", + content: "Tool output", + }, + { type: "text", text: "And some more text." }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + // Should produce both the text message and the function_call_output + expect(result).toEqual([ + { + type: "function_call_output", + callId: "tool_789", + output: "Tool output", + }, + { role: "user", content: "Here is some context. And some more text." }, + ]); + }); + }); + + describe("tool_use blocks (should be skipped)", () => { + it("skips tool_use blocks as they are output from assistant", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "assistant", + content: [ + { type: "text", text: "Let me help you with that." }, + { + type: "tool_use", + id: "tool_abc", + name: "get_weather", + input: { location: "SF" }, + }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + // Only the text should be captured, tool_use is from previous response + expect(result).toEqual([ + { role: "assistant", content: "Let me help you with that." }, + ]); + }); + }); + + describe("image blocks (should be skipped)", () => { + it("skips image blocks", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { + role: "user", + content: [ + { type: "text", text: "Look at this image:" }, + { + type: "image", + source: { + type: "base64", + media_type: "image/png", + data: "base64data...", + }, + }, + ], + }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + // Only the text should be captured + expect(result).toEqual([ + { role: "user", content: "Look at this image:" }, + ]); + }); + }); + + describe("empty and edge cases", () => { + it("handles empty messages array", () => { + const result = fromClaudeMessages([]); + expect(result).toEqual([]); + }); + + it("handles message with empty string content", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { role: "user", content: "" }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + expect(result).toEqual([{ role: "user", content: "" }]); + }); + + it("handles message with empty content array", () => { + const claudeMessages: models.ClaudeMessageParam[] = [ + { role: "user", content: [] }, + ]; + + const result = fromClaudeMessages(claudeMessages); + + // Should produce empty array since no text and no tool_results + expect(result).toEqual([]); + }); + }); +}); + +describe("toClaudeMessage", () => { + describe("basic message conversion", () => { + it("converts response with text output to ClaudeMessage", () => { + const response = createMockResponse({ + id: "resp_123", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [ + { + type: "output_text", + text: "Hello! How can I help you?", + annotations: [], + }, + ], + }, + ], + usage: { + inputTokens: 10, + outputTokens: 20, + totalTokens: 30, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + + expect(result).toEqual({ + id: "resp_123", + type: "message", + role: "assistant", + model: "openai/gpt-4", + content: [ + { + type: "text", + text: "Hello! How can I help you?", + }, + ], + stop_reason: "end_turn", + stop_sequence: null, + usage: { + input_tokens: 10, + output_tokens: 20, + cache_creation_input_tokens: 0, + cache_read_input_tokens: 0, + }, + }); + }); + }); + + describe("function call conversion", () => { + it("converts function_call output to tool_use block", () => { + const response = createMockResponse({ + id: "resp_456", + output: [ + { + type: "function_call", + callId: "call_abc", + name: "get_weather", + arguments: '{"location":"San Francisco"}', + id: "fc_1", + status: "completed", + }, + ], + usage: { + inputTokens: 15, + outputTokens: 25, + totalTokens: 40, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + + expect(result.content).toEqual([ + { + type: "tool_use", + id: "call_abc", + name: "get_weather", + input: { location: "San Francisco" }, + }, + ]); + expect(result.stop_reason).toBe("tool_use"); + }); + }); + + describe("reasoning conversion", () => { + it("converts reasoning output to thinking block", () => { + const response = createMockResponse({ + id: "resp_789", + model: "openai/o1", + output: [ + { + type: "reasoning", + id: "reason_1", + summary: [ + { + type: "summary_text", + text: "I need to think about this carefully...", + }, + ], + }, + { + id: "msg_2", + type: "message", + role: "assistant", + status: "completed", + content: [ + { + type: "output_text", + text: "Here is my answer.", + annotations: [], + }, + ], + }, + ], + usage: { + inputTokens: 20, + outputTokens: 100, + totalTokens: 120, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + + expect(result.content).toEqual([ + { + type: "thinking", + thinking: "I need to think about this carefully...", + signature: "", + }, + { + type: "text", + text: "Here is my answer.", + }, + ]); + }); + }); + + describe("stop reason mapping", () => { + it("maps completed status to end_turn", () => { + const response = createMockResponse({ + id: "resp_1", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [{ type: "output_text", text: "Done", annotations: [] }], + }, + ], + usage: { + inputTokens: 5, + outputTokens: 5, + totalTokens: 10, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + expect(result.stop_reason).toBe("end_turn"); + }); + + it("maps incomplete with max_output_tokens to max_tokens", () => { + const response = createMockResponse({ + id: "resp_2", + status: "incomplete", + incompleteDetails: { reason: "max_output_tokens" }, + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "incomplete", + content: [ + { type: "output_text", text: "Partial...", annotations: [] }, + ], + }, + ], + usage: { + inputTokens: 5, + outputTokens: 100, + totalTokens: 105, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + expect(result.stop_reason).toBe("max_tokens"); + }); + + it("maps response with function calls to tool_use", () => { + const response = createMockResponse({ + id: "resp_3", + output: [ + { + type: "function_call", + callId: "call_1", + name: "test_tool", + arguments: "{}", + id: "fc_1", + status: "completed", + }, + ], + usage: { + inputTokens: 5, + outputTokens: 10, + totalTokens: 15, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + expect(result.stop_reason).toBe("tool_use"); + }); + }); + + describe("usage mapping", () => { + it("maps usage with cached tokens", () => { + const response = createMockResponse({ + id: "resp_1", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [{ type: "output_text", text: "OK", annotations: [] }], + }, + ], + usage: { + inputTokens: 100, + outputTokens: 50, + totalTokens: 150, + inputTokensDetails: { + cachedTokens: 80, + }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toClaudeMessage(response); + + expect(result.usage).toEqual({ + input_tokens: 100, + output_tokens: 50, + cache_creation_input_tokens: 80, + cache_read_input_tokens: 0, + }); + }); + }); +}); diff --git a/src/lib/anthropic-compat.ts b/src/lib/anthropic-compat.ts new file mode 100644 index 00000000..52294828 --- /dev/null +++ b/src/lib/anthropic-compat.ts @@ -0,0 +1,252 @@ +import type * as models from "../models/index.js"; +import { + OpenResponsesEasyInputMessageRoleUser, + OpenResponsesEasyInputMessageRoleAssistant, +} from "../models/openresponseseasyinputmessage.js"; +import { + OpenResponsesInputMessageItemRoleUser, + OpenResponsesInputMessageItemRoleSystem, +} from "../models/openresponsesinputmessageitem.js"; +import { OpenResponsesFunctionCallOutputType } from "../models/openresponsesfunctioncalloutput.js"; +import { convertToClaudeMessage } from "./stream-transformers.js"; + +/** + * Maps Claude role strings to OpenResponses role types + */ +function mapClaudeRole( + role: "user" | "assistant" +): models.OpenResponsesEasyInputMessageRoleUnion { + if (role === "user") { + return OpenResponsesEasyInputMessageRoleUser.User; + } + return OpenResponsesEasyInputMessageRoleAssistant.Assistant; +} + +/** + * Creates a properly typed OpenResponsesEasyInputMessage + */ +function createEasyInputMessage( + role: "user" | "assistant", + content: string +): models.OpenResponsesEasyInputMessage { + return { + role: mapClaudeRole(role), + content, + }; +} + +/** + * Creates a properly typed OpenResponsesFunctionCallOutput + */ +function createFunctionCallOutput( + callId: string, + output: string +): models.OpenResponsesFunctionCallOutput { + return { + type: OpenResponsesFunctionCallOutputType.FunctionCallOutput, + callId, + output, + }; +} + +/** + * Convert Anthropic Claude-style messages to OpenResponses input format. + * + * This function transforms ClaudeMessageParam[] (Anthropic SDK format) to + * OpenResponsesInput format that can be passed directly to callModel(). + * + * @example + * ```typescript + * import { fromClaudeMessages } from '@openrouter/sdk'; + * + * const claudeMessages = [ + * { role: "user", content: "Hello!" }, + * { role: "assistant", content: "Hi there!" }, + * ]; + * + * const response = openrouter.callModel({ + * model: "anthropic/claude-3-sonnet", + * input: fromClaudeMessages(claudeMessages), + * }); + * ``` + */ +export function fromClaudeMessages( + messages: models.ClaudeMessageParam[] +): models.OpenResponsesInput { + const result: ( + | models.OpenResponsesEasyInputMessage + | models.OpenResponsesInputMessageItem + | models.OpenResponsesFunctionCallOutput + | models.OpenResponsesFunctionToolCall + | models.ResponsesImageGenerationCall + )[] = []; + + for (const msg of messages) { + const { role, content } = msg; + + if (typeof content === "string") { + result.push(createEasyInputMessage(role, content)); + continue; + } + + const contentItems: ( + | models.ResponseInputText + | models.ResponseInputImage + | models.ResponseInputFile + | models.ResponseInputAudio + )[] = []; + let hasStructuredContent = false; + + for (const block of content) { + switch (block.type) { + case 'text': { + const textBlock = block as models.ClaudeTextBlockParam; + contentItems.push({ + type: 'input_text', + text: textBlock.text, + }); + // Note: cache_control is lost in conversion (OpenRouter doesn't support it) + break; + } + + case 'image': { + const imageBlock = block as models.ClaudeImageBlockParam; + hasStructuredContent = true; + + // Convert Claude image source to OpenRouter format + if (imageBlock.source.type === 'url') { + contentItems.push({ + type: 'input_image', + detail: 'auto', + imageUrl: imageBlock.source.url, + }); + } else if (imageBlock.source.type === 'base64') { + // Base64 images: OpenRouter expects a URL, so we use data URI + const dataUri = `data:${imageBlock.source.media_type};base64,${imageBlock.source.data}`; + contentItems.push({ + type: 'input_image', + detail: 'auto', + imageUrl: dataUri, + }); + } + break; + } + + case 'tool_use': { + const toolUseBlock = block as models.ClaudeToolUseBlockParam; + + // Map to OpenResponsesFunctionToolCall + result.push({ + type: 'function_call', + callId: toolUseBlock.id, + name: toolUseBlock.name, + arguments: JSON.stringify(toolUseBlock.input), + id: toolUseBlock.id, + status: 'completed', // Tool use in conversation history is already completed + }); + break; + } + + case 'tool_result': { + const toolResultBlock = block as models.ClaudeToolResultBlockParam; + + let toolOutput = ''; + if (typeof toolResultBlock.content === 'string') { + toolOutput = toolResultBlock.content; + } else { + // Extract text and handle images separately + const textParts: string[] = []; + const imageParts: models.ClaudeImageBlockParam[] = []; + + for (const part of toolResultBlock.content) { + if (part.type === 'text') { + textParts.push(part.text); + } else if (part.type === 'image') { + imageParts.push(part); + } + } + + toolOutput = textParts.join(''); + + // Map images to image_generation_call items + for (const imagePart of imageParts) { + const imageUrl = imagePart.source.type === 'url' + ? imagePart.source.url + : `data:${imagePart.source.media_type};base64,${imagePart.source.data}`; + + result.push({ + type: 'image_generation_call', + id: `${toolResultBlock.tool_use_id}-image-${imageParts.indexOf(imagePart)}`, + result: imageUrl, + status: 'completed', + }); + } + } + + // Add the function call output for the text portion + if (toolOutput || typeof toolResultBlock.content === 'string') { + result.push(createFunctionCallOutput(toolResultBlock.tool_use_id, toolOutput)); + } + break; + } + + default: { + const _exhaustiveCheck: never = block; + throw new Error(`Unhandled content block type: ${(_exhaustiveCheck as { type: string }).type}`); + } + } + } + + // Use structured format if we have images, otherwise use simple format + if (contentItems.length > 0) { + if (hasStructuredContent) { + // Use OpenResponsesInputMessageItem for messages with images + const messageRole = role === 'user' + ? OpenResponsesInputMessageItemRoleUser.User + : role === 'assistant' + ? OpenResponsesInputMessageItemRoleSystem.System // Assistant messages treated as system in this context + : OpenResponsesInputMessageItemRoleSystem.System; + + result.push({ + type: 'message', + role: messageRole, + content: contentItems, + }); + } else { + // Use simple format for text-only messages + const textContent = contentItems + .filter((item): item is models.ResponseInputText => item.type === 'input_text') + .map(item => item.text) + .join(''); + + if (textContent) { + result.push(createEasyInputMessage(role, textContent)); + } + } + } + } + + return result; +} + +/** + * Convert an OpenResponses response to Anthropic Claude message format. + * + * This function transforms OpenResponsesNonStreamingResponse to ClaudeMessage + * (Anthropic SDK format) for compatibility with code expecting Claude responses. + * + * @example + * ```typescript + * import { toClaudeMessage } from '@openrouter/sdk'; + * + * const response = await openrouter.callModel({ + * model: "anthropic/claude-3-sonnet", + * input: "Hello!", + * }); + * + * const openResponsesResult = await response.getResponse(); + * const claudeMessage = toClaudeMessage(openResponsesResult); + * // claudeMessage is now compatible with Anthropic SDK types + * ``` + */ +export const toClaudeMessage = convertToClaudeMessage; diff --git a/src/lib/base64.ts b/src/lib/base64.ts index 962ea486..a187e587 100644 --- a/src/lib/base64.ts +++ b/src/lib/base64.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 598522066688 */ import * as z from "zod/v4"; diff --git a/src/lib/chat-compat.test.ts b/src/lib/chat-compat.test.ts new file mode 100644 index 00000000..7fe73e10 --- /dev/null +++ b/src/lib/chat-compat.test.ts @@ -0,0 +1,335 @@ +import { describe, expect, it } from "vitest"; +import { fromChatMessages, toChatMessage } from "./chat-compat.js"; +import type * as models from "../models/index.js"; + +/** + * Creates a properly typed mock OpenResponsesNonStreamingResponse for testing. + * This factory provides all required fields with sensible defaults. + */ +function createMockResponse( + overrides: Partial & { + output: models.OpenResponsesNonStreamingResponse["output"]; + } +): models.OpenResponsesNonStreamingResponse { + return { + id: "resp_test", + object: "response", + createdAt: Date.now(), + model: "openai/gpt-4", + status: "completed", + error: null, + incompleteDetails: null, + temperature: null, + topP: null, + metadata: null, + tools: [], + toolChoice: "auto", + parallelToolCalls: false, + ...overrides, + }; +} + +describe("fromChatMessages", () => { + describe("basic message conversion", () => { + it("converts user message with string content", () => { + const messages: models.Message[] = [ + { role: "user", content: "Hello, how are you?" }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { role: "user", content: "Hello, how are you?" }, + ]); + }); + + it("converts assistant message with string content", () => { + const messages: models.Message[] = [ + { role: "assistant", content: "I am doing well, thank you!" }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { role: "assistant", content: "I am doing well, thank you!" }, + ]); + }); + + it("converts system message with string content", () => { + const messages: models.Message[] = [ + { role: "system", content: "You are a helpful assistant." }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { role: "system", content: "You are a helpful assistant." }, + ]); + }); + + it("converts developer message with string content", () => { + const messages: models.Message[] = [ + { role: "developer", content: "Developer instructions here." }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { role: "developer", content: "Developer instructions here." }, + ]); + }); + + it("converts multiple messages in conversation", () => { + const messages: models.Message[] = [ + { role: "system", content: "You are helpful." }, + { role: "user", content: "Hi" }, + { role: "assistant", content: "Hello!" }, + { role: "user", content: "How are you?" }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { role: "system", content: "You are helpful." }, + { role: "user", content: "Hi" }, + { role: "assistant", content: "Hello!" }, + { role: "user", content: "How are you?" }, + ]); + }); + }); + + describe("tool response message conversion", () => { + it("converts tool message to function_call_output", () => { + const messages: models.Message[] = [ + { + role: "tool", + content: "The weather is sunny and 72F", + toolCallId: "call_abc123", + }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { + type: "function_call_output", + callId: "call_abc123", + output: "The weather is sunny and 72F", + }, + ]); + }); + + it("converts tool message with object content by stringifying", () => { + const messages: models.Message[] = [ + { + role: "tool", + content: [{ type: "text", text: "Structured response" }], + toolCallId: "call_def456", + }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { + type: "function_call_output", + callId: "call_def456", + output: JSON.stringify([{ type: "text", text: "Structured response" }]), + }, + ]); + }); + }); + + describe("content array handling", () => { + it("stringifies array content for user messages", () => { + const messages: models.Message[] = [ + { + role: "user", + content: [{ type: "text", text: "Hello from array" }], + }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { + role: "user", + content: JSON.stringify([{ type: "text", text: "Hello from array" }]), + }, + ]); + }); + + it("stringifies array content for assistant messages", () => { + const messages: models.Message[] = [ + { + role: "assistant", + content: [{ type: "text", text: "Response in array" }], + }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([ + { + role: "assistant", + content: JSON.stringify([{ type: "text", text: "Response in array" }]), + }, + ]); + }); + }); + + describe("null and empty content handling", () => { + it("handles null content in assistant message", () => { + const messages: models.Message[] = [ + { role: "assistant", content: null }, + ]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([{ role: "assistant", content: "" }]); + }); + + it("handles empty string content", () => { + const messages: models.Message[] = [{ role: "user", content: "" }]; + + const result = fromChatMessages(messages); + + expect(result).toEqual([{ role: "user", content: "" }]); + }); + + it("handles empty messages array", () => { + const result = fromChatMessages([]); + expect(result).toEqual([]); + }); + }); + +}); + +describe("toChatMessage", () => { + describe("basic message conversion", () => { + it("converts response with text output to AssistantMessage", () => { + const response = createMockResponse({ + id: "resp_123", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [ + { + type: "output_text", + text: "Hello! How can I help you?", + annotations: [], + }, + ], + }, + ], + usage: { + inputTokens: 10, + outputTokens: 20, + totalTokens: 30, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toChatMessage(response); + + expect(result).toEqual({ + role: "assistant", + content: "Hello! How can I help you?", + }); + }); + + it("combines multiple text parts into single content string", () => { + const response = createMockResponse({ + id: "resp_456", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [ + { type: "output_text", text: "Part 1. ", annotations: [] }, + { type: "output_text", text: "Part 2.", annotations: [] }, + ], + }, + ], + usage: { + inputTokens: 5, + outputTokens: 10, + totalTokens: 15, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toChatMessage(response); + + expect(result).toEqual({ + role: "assistant", + content: "Part 1. Part 2.", + }); + }); + + it("returns null content when message has no text", () => { + const response = createMockResponse({ + id: "resp_789", + output: [ + { + id: "msg_1", + type: "message", + role: "assistant", + status: "completed", + content: [], + }, + ], + usage: { + inputTokens: 5, + outputTokens: 0, + totalTokens: 5, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + const result = toChatMessage(response); + + expect(result).toEqual({ + role: "assistant", + content: null, + }); + }); + }); + + describe("error handling", () => { + it("throws error when no message found in output", () => { + const response = createMockResponse({ + id: "resp_err", + output: [ + { + type: "function_call", + callId: "call_1", + name: "test_tool", + arguments: "{}", + id: "fc_1", + status: "completed", + }, + ], + usage: { + inputTokens: 5, + outputTokens: 10, + totalTokens: 15, + inputTokensDetails: { cachedTokens: 0 }, + outputTokensDetails: { reasoningTokens: 0 }, + }, + }); + + expect(() => toChatMessage(response)).toThrow( + "No message found in response output" + ); + }); + }); +}); diff --git a/src/lib/chat-compat.ts b/src/lib/chat-compat.ts new file mode 100644 index 00000000..745df5f4 --- /dev/null +++ b/src/lib/chat-compat.ts @@ -0,0 +1,135 @@ +import type * as models from "../models/index.js"; +import { + OpenResponsesEasyInputMessageRoleUser, + OpenResponsesEasyInputMessageRoleSystem, + OpenResponsesEasyInputMessageRoleAssistant, + OpenResponsesEasyInputMessageRoleDeveloper, +} from "../models/openresponseseasyinputmessage.js"; +import { OpenResponsesFunctionCallOutputType } from "../models/openresponsesfunctioncalloutput.js"; +import { extractMessageFromResponse } from "./stream-transformers.js"; + +/** + * Type guard for ToolResponseMessage + */ +function isToolResponseMessage( + msg: models.Message +): msg is models.ToolResponseMessage { + return msg.role === "tool"; +} + +/** + * Type guard for AssistantMessage + */ +function isAssistantMessage( + msg: models.Message +): msg is models.AssistantMessage { + return msg.role === "assistant"; +} + +/** + * Maps chat role strings to OpenResponses role types + */ +function mapChatRole( + role: "user" | "system" | "assistant" | "developer" +): models.OpenResponsesEasyInputMessageRoleUnion { + switch (role) { + case "user": + return OpenResponsesEasyInputMessageRoleUser.User; + case "system": + return OpenResponsesEasyInputMessageRoleSystem.System; + case "assistant": + return OpenResponsesEasyInputMessageRoleAssistant.Assistant; + case "developer": + return OpenResponsesEasyInputMessageRoleDeveloper.Developer; + } +} + +/** + * Convert message content to a string representation. + * Handles string, null, undefined, and object content types. + */ +function contentToString(content: unknown): string { + if (typeof content === "string") { + return content; + } + if (content === null || content === undefined) { + return ""; + } + return JSON.stringify(content); +} + +/** + * Convert OpenAI chat-style messages to OpenResponses input format. + * + * This function transforms Message[] (OpenAI chat format) to OpenResponsesInput + * format that can be passed directly to callModel(). + * + * @example + * ```typescript + * import { fromChatMessages } from '@openrouter/sdk'; + * + * const chatMessages = [ + * { role: "system", content: "You are a helpful assistant." }, + * { role: "user", content: "Hello!" }, + * ]; + * + * const response = openrouter.callModel({ + * model: "openai/gpt-4", + * input: fromChatMessages(chatMessages), + * }); + * ``` + */ +export function fromChatMessages( + messages: models.Message[] +): models.OpenResponsesInput { + return messages.map( + ( + msg + ): + | models.OpenResponsesEasyInputMessage + | models.OpenResponsesFunctionCallOutput => { + if (isToolResponseMessage(msg)) { + return { + type: OpenResponsesFunctionCallOutputType.FunctionCallOutput, + callId: msg.toolCallId, + output: contentToString(msg.content), + }; + } + + if (isAssistantMessage(msg)) { + return { + role: mapChatRole("assistant"), + content: contentToString(msg.content), + }; + } + + // System, user, developer messages + return { + role: mapChatRole(msg.role), + content: contentToString(msg.content), + }; + } + ); +} + +/** + * Convert an OpenResponses response to OpenAI chat message format. + * + * This function transforms OpenResponsesNonStreamingResponse to AssistantMessage + * (OpenAI chat format) for compatibility with code expecting chat responses. + * + * @example + * ```typescript + * import { toChatMessage } from '@openrouter/sdk'; + * + * const response = await openrouter.callModel({ + * model: "openai/gpt-4", + * input: "Hello!", + * }); + * + * const openResponsesResult = await response.getResponse(); + * const chatMessage = toChatMessage(openResponsesResult); + * // chatMessage is now { role: "assistant", content: "..." } + * ``` + */ +export const toChatMessage = extractMessageFromResponse; diff --git a/src/lib/config.ts b/src/lib/config.ts index 8ec4c228..19e037b6 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 320761608fb3 */ import { HTTPClient } from "./http.js"; @@ -69,7 +70,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.3.2", + sdkVersion: "0.3.7", genVersion: "2.788.4", - userAgent: "speakeasy-sdk/typescript 0.3.2 2.788.4 1.0.0 @openrouter/sdk", + userAgent: "speakeasy-sdk/typescript 0.3.7 2.788.4 1.0.0 @openrouter/sdk", } as const; diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts index e81091f5..f4c75aca 100644 --- a/src/lib/dlv.ts +++ b/src/lib/dlv.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b1988214835a */ /* diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 31cd3733..eaa7618d 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3bd8ead98afd */ import { bytesToBase64 } from "./base64.js"; diff --git a/src/lib/env.ts b/src/lib/env.ts index 3d87d568..88ff8a65 100644 --- a/src/lib/env.ts +++ b/src/lib/env.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c52972a3b198 */ import * as z from "zod/v4"; diff --git a/src/lib/event-streams.ts b/src/lib/event-streams.ts index 04e4568b..d649d979 100644 --- a/src/lib/event-streams.ts +++ b/src/lib/event-streams.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3f731f808a79 */ export type SseMessage = { diff --git a/src/lib/files.ts b/src/lib/files.ts index 0344cd04..457f4ced 100644 --- a/src/lib/files.ts +++ b/src/lib/files.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e5efa54fcb95 */ /** diff --git a/src/lib/http.ts b/src/lib/http.ts index 13cf1fd7..326ee1a0 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 63a80782d37e */ export type Fetcher = ( diff --git a/src/lib/is-plain-object.ts b/src/lib/is-plain-object.ts index 61070d3d..096b49bf 100644 --- a/src/lib/is-plain-object.ts +++ b/src/lib/is-plain-object.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b9862591096a */ /* diff --git a/src/lib/logger.ts b/src/lib/logger.ts index d181f293..323f1895 100644 --- a/src/lib/logger.ts +++ b/src/lib/logger.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7ee7741a02bf */ export interface Logger { diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts index e8b016f5..8acbcebd 100644 --- a/src/lib/matchers.ts +++ b/src/lib/matchers.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d54b2253b719 */ import { OpenRouterDefaultError } from "../models/errors/openrouterdefaulterror.js"; diff --git a/src/lib/response-wrapper.ts b/src/lib/model-result.ts similarity index 70% rename from src/lib/response-wrapper.ts rename to src/lib/model-result.ts index 92245282..8d19f5a1 100644 --- a/src/lib/response-wrapper.ts +++ b/src/lib/model-result.ts @@ -1,7 +1,7 @@ -import type { OpenRouterCore } from '../core.js'; -import type * as models from '../models/index.js'; -import type { EventStream } from './event-streams.js'; -import type { RequestOptions } from './sdks.js'; +import type { OpenRouterCore } from "../core.js"; +import type * as models from "../models/index.js"; +import type { EventStream } from "./event-streams.js"; +import type { RequestOptions } from "./sdks.js"; import type { ChatStreamEvent, EnhancedResponseStreamEvent, @@ -10,23 +10,70 @@ import type { ParsedToolCall, ToolStreamEvent, TurnContext, -} from './tool-types.js'; +} from "./tool-types.js"; -import { betaResponsesSend } from '../funcs/betaResponsesSend.js'; -import { ReusableReadableStream } from './reusable-stream.js'; +import { betaResponsesSend } from "../funcs/betaResponsesSend.js"; +import { ReusableReadableStream } from "./reusable-stream.js"; import { - buildMessageStream, + buildResponsesMessageStream, buildToolCallStream, consumeStreamForCompletion, - extractMessageFromResponse, extractReasoningDeltas, + extractResponsesMessageFromResponse, extractTextDeltas, extractTextFromResponse, extractToolCallsFromResponse, extractToolDeltas, -} from './stream-transformers.js'; -import { executeTool } from './tool-executor.js'; -import { hasExecuteFunction } from './tool-types.js'; +} from "./stream-transformers.js"; +import { executeTool } from "./tool-executor.js"; +import { hasExecuteFunction } from "./tool-types.js"; + +/** + * Type guard for stream event with toReadableStream method + */ +function isEventStream( + value: unknown +): value is EventStream { + return ( + value !== null && + typeof value === "object" && + "toReadableStream" in value && + typeof (value as { toReadableStream: unknown }).toReadableStream === + "function" + ); +} + +/** + * Type guard for response.output_text.delta events + */ +function isOutputTextDeltaEvent( + event: models.OpenResponsesStreamEvent +): event is models.OpenResponsesStreamEventResponseOutputTextDelta { + return "type" in event && event.type === "response.output_text.delta"; +} + +/** + * Type guard for response.completed events + */ +function isResponseCompletedEvent( + event: models.OpenResponsesStreamEvent +): event is models.OpenResponsesStreamEventResponseCompleted { + return "type" in event && event.type === "response.completed"; +} + +/** + * Type guard for output items with a type property + */ +function hasTypeProperty( + item: unknown +): item is { type: string } { + return ( + typeof item === "object" && + item !== null && + "type" in item && + typeof (item as { type: unknown }).type === "string" + ); +} export interface GetResponseOptions { request: models.OpenResponsesRequest; @@ -40,19 +87,25 @@ export interface GetResponseOptions { * A wrapper around a streaming response that provides multiple consumption patterns. * * Allows consuming the response in multiple ways: - * - `await response.getMessage()` - Get the completed message - * - `await response.getText()` - Get just the text - * - `for await (const delta of response.getTextStream())` - Stream text deltas - * - `for await (const msg of response.getNewMessagesStream())` - Stream incremental message updates - * - `for await (const event of response.getFullResponsesStream())` - Stream all response events + * - `await result.getText()` - Get just the text + * - `await result.getResponse()` - Get the full response object + * - `for await (const delta of result.getTextStream())` - Stream text deltas + * - `for await (const msg of result.getNewMessagesStream())` - Stream incremental message updates + * - `for await (const event of result.getFullResponsesStream())` - Stream all response events + * + * For message format conversion, use the helper functions: + * - `toChatMessage(response)` for OpenAI chat format + * - `toClaudeMessage(response)` for Anthropic Claude format * * All consumption patterns can be used concurrently thanks to the underlying * ReusableReadableStream implementation. */ -export class ResponseWrapper { - private reusableStream: ReusableReadableStream | null = null; - private streamPromise: Promise> | null = null; - private messagePromise: Promise | null = null; +export class ModelResult { + private reusableStream: ReusableReadableStream | null = + null; + private streamPromise: Promise< + EventStream + > | null = null; private textPromise: Promise | null = null; private options: GetResponseOptions; private initPromise: Promise | null = null; @@ -72,7 +125,9 @@ export class ResponseWrapper { /** * Type guard to check if a value is a non-streaming response */ - private isNonStreamingResponse(value: unknown): value is models.OpenResponsesNonStreamingResponse { + private isNonStreamingResponse( + value: unknown + ): value is models.OpenResponsesNonStreamingResponse { return ( value !== null && typeof value === "object" && @@ -103,7 +158,7 @@ export class ResponseWrapper { this.streamPromise = betaResponsesSend( this.options.client, request, - this.options.options, + this.options.options ).then((result) => { if (!result.ok) { throw result.error; @@ -132,17 +187,21 @@ export class ResponseWrapper { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } // Get the initial response - const initialResponse = await consumeStreamForCompletion(this.reusableStream); + const initialResponse = await consumeStreamForCompletion( + this.reusableStream + ); // Check if we have tools and if auto-execution is enabled const shouldAutoExecute = this.options.tools && this.options.tools.length > 0 && - initialResponse.output.some((item) => 'type' in item && item.type === 'function_call'); + initialResponse.output.some( + (item) => hasTypeProperty(item) && item.type === "function_call" + ); if (!shouldAutoExecute) { // No tools to execute, use initial response @@ -155,7 +214,9 @@ export class ResponseWrapper { // Check if any have execute functions const executableTools = toolCalls.filter((toolCall) => { - const tool = this.options.tools?.find((t) => t.function.name === toolCall.name); + const tool = this.options.tools?.find( + (t) => t.function.name === toolCall.name + ); return tool && hasExecuteFunction(tool); }); @@ -170,7 +231,8 @@ export class ResponseWrapper { let currentResponse = initialResponse; let currentRound = 0; - let currentInput: models.OpenResponsesInput = this.options.request.input || []; + let currentInput: models.OpenResponsesInput = + this.options.request.input || []; while (true) { const currentToolCalls = extractToolCallsFromResponse(currentResponse); @@ -180,7 +242,9 @@ export class ResponseWrapper { } const hasExecutable = currentToolCalls.some((toolCall) => { - const tool = this.options.tools?.find((t) => t.function.name === toolCall.name); + const tool = this.options.tools?.find( + (t) => t.function.name === toolCall.name + ); return tool && hasExecuteFunction(tool); }); @@ -189,11 +253,11 @@ export class ResponseWrapper { } // Check if we should continue based on maxToolRounds - if (typeof maxToolRounds === 'number') { + if (typeof maxToolRounds === "number") { if (currentRound >= maxToolRounds) { break; } - } else if (typeof maxToolRounds === 'function') { + } else if (typeof maxToolRounds === "function") { // Function signature: (context: TurnContext) => boolean const turnContext: TurnContext = { numberOfTurns: currentRound + 1, @@ -234,7 +298,9 @@ export class ResponseWrapper { const toolResults: Array = []; for (const toolCall of currentToolCalls) { - const tool = this.options.tools?.find((t) => t.function.name === toolCall.name); + const tool = this.options.tools?.find( + (t) => t.function.name === toolCall.name + ); if (!tool || !hasExecuteFunction(tool)) { continue; @@ -243,12 +309,15 @@ export class ResponseWrapper { const result = await executeTool(tool, toolCall, turnContext); // Store preliminary results - if (result.preliminaryResults && result.preliminaryResults.length > 0) { + if ( + result.preliminaryResults && + result.preliminaryResults.length > 0 + ) { this.preliminaryResults.set(toolCall.id, result.preliminaryResults); } toolResults.push({ - type: 'function_call_output' as const, + type: "function_call_output" as const, id: `output_${toolCall.id}`, callId: toolCall.id, output: result.error @@ -264,9 +333,7 @@ export class ResponseWrapper { const newInput: models.OpenResponsesInput = [ ...(Array.isArray(currentResponse.output) ? currentResponse.output - : [ - currentResponse.output, - ]), + : [currentResponse.output]), ...toolResults, ]; @@ -283,7 +350,7 @@ export class ResponseWrapper { const newResult = await betaResponsesSend( this.options.client, newRequest, - this.options.options, + this.options.options ); if (!newResult.ok) { @@ -292,11 +359,9 @@ export class ResponseWrapper { // Handle the result - it might be a stream or a response const value = newResult.value; - if (value && typeof value === 'object' && 'toReadableStream' in value) { + if (isEventStream(value)) { // It's a stream, consume it - const stream = new ReusableReadableStream( - value as EventStream, - ); + const stream = new ReusableReadableStream(value); currentResponse = await consumeStreamForCompletion(stream); } else if (this.isNonStreamingResponse(value)) { currentResponse = value; @@ -313,7 +378,10 @@ export class ResponseWrapper { } // Ensure the response is in a completed state (has output content) - if (!Array.isArray(currentResponse.output) || currentResponse.output.length === 0) { + if ( + !Array.isArray(currentResponse.output) || + currentResponse.output.length === 0 + ) { throw new Error("Invalid final response: empty or invalid output"); } @@ -323,19 +391,6 @@ export class ResponseWrapper { return this.toolExecutionPromise; } - /** - * Internal helper to get the message after tool execution - */ - private async getMessageInternal(): Promise { - await this.executeToolsIfNeeded(); - - if (!this.finalResponse) { - throw new Error("Response not available"); - } - - return extractMessageFromResponse(this.finalResponse); - } - /** * Internal helper to get the text after tool execution */ @@ -349,20 +404,6 @@ export class ResponseWrapper { return extractTextFromResponse(this.finalResponse); } - /** - * Get the completed message from the response. - * This will consume the stream until completion, execute any tools, and extract the first message. - * Returns an AssistantMessage in chat format. - */ - getMessage(): Promise { - if (this.messagePromise) { - return this.messagePromise; - } - - this.messagePromise = this.getMessageInternal(); - return this.messagePromise; - } - /** * Get just the text content from the response. * This will consume the stream until completion, execute any tools, and extract the text. @@ -385,7 +426,7 @@ export class ResponseWrapper { await this.executeToolsIfNeeded(); if (!this.finalResponse) { - throw new Error('Response not available'); + throw new Error("Response not available"); } return this.finalResponse; @@ -397,10 +438,10 @@ export class ResponseWrapper { * Includes preliminary tool result events after tool execution. */ getFullResponsesStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } const consumer = this.reusableStream.createConsumer(); @@ -417,7 +458,7 @@ export class ResponseWrapper { for (const [toolCallId, results] of this.preliminaryResults) { for (const result of results) { yield { - type: 'tool.preliminary_result' as const, + type: "tool.preliminary_result" as const, toolCallId, result, timestamp: Date.now(), @@ -432,10 +473,10 @@ export class ResponseWrapper { * This filters the full event stream to only yield text content. */ getTextStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } yield* extractTextDeltas(this.reusableStream); @@ -443,31 +484,33 @@ export class ResponseWrapper { } /** - * Stream incremental message updates as content is added. + * Stream incremental message updates as content is added in responses format. * Each iteration yields an updated version of the message with new content. - * Also yields ToolResponseMessages after tool execution completes. - * Returns AssistantMessage or ToolResponseMessage in chat format. + * Also yields OpenResponsesFunctionCallOutput after tool execution completes. + * Returns ResponsesOutputMessage or OpenResponsesFunctionCallOutput compatible with OpenAI Responses API format. */ getNewMessagesStream(): AsyncIterableIterator< - models.AssistantMessage | models.ToolResponseMessage + models.ResponsesOutputMessage | models.OpenResponsesFunctionCallOutput > { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } - // First yield assistant messages from the stream - yield* buildMessageStream(this.reusableStream); + // First yield messages from the stream in responses format + yield* buildResponsesMessageStream(this.reusableStream); // Execute tools if needed await this.executeToolsIfNeeded(); - // Yield tool response messages for each executed tool + // Yield function call output for each executed tool for (const round of this.allToolExecutionRounds) { for (const toolCall of round.toolCalls) { // Find the tool to check if it was executed - const tool = this.options.tools?.find((t) => t.function.name === toolCall.name); + const tool = this.options.tools?.find( + (t) => t.function.name === toolCall.name + ); if (!tool || !hasExecuteFunction(tool)) { continue; } @@ -479,23 +522,24 @@ export class ResponseWrapper { ? prelimResults[prelimResults.length - 1] // Last result is the final output : undefined; - // Yield tool response message + // Yield function call output in responses format yield { - role: 'tool' as const, - content: result !== undefined ? JSON.stringify(result) : '', - toolCallId: toolCall.id, - } as models.ToolResponseMessage; + type: "function_call_output" as const, + id: `output_${toolCall.id}`, + callId: toolCall.id, + output: result !== undefined ? JSON.stringify(result) : "", + } as models.OpenResponsesFunctionCallOutput; } } - // If tools were executed, yield the final assistant message (if there is one) + // If tools were executed, yield the final message (if there is one) if (this.finalResponse && this.allToolExecutionRounds.length > 0) { // Check if the final response contains a message const hasMessage = this.finalResponse.output.some( - (item) => 'type' in item && item.type === 'message', + (item) => hasTypeProperty(item) && item.type === "message" ); if (hasMessage) { - yield extractMessageFromResponse(this.finalResponse); + yield extractResponsesMessageFromResponse(this.finalResponse); } } }.call(this); @@ -506,10 +550,10 @@ export class ResponseWrapper { * This filters the full event stream to only yield reasoning content. */ getReasoningStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } yield* extractReasoningDeltas(this.reusableStream); @@ -523,16 +567,16 @@ export class ResponseWrapper { * - Preliminary results as { type: "preliminary_result", toolCallId, result } */ getToolStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } // Yield tool deltas as structured events for await (const delta of extractToolDeltas(this.reusableStream)) { yield { - type: 'delta' as const, + type: "delta" as const, content: delta, }; } @@ -544,7 +588,7 @@ export class ResponseWrapper { for (const [toolCallId, results] of this.preliminaryResults) { for (const result of results) { yield { - type: 'preliminary_result' as const, + type: "preliminary_result" as const, toolCallId, result, }; @@ -564,32 +608,29 @@ export class ResponseWrapper { * this may not be a perfect mapping. */ getFullChatStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } const consumer = this.reusableStream.createConsumer(); for await (const event of consumer) { - if (!('type' in event)) { + if (!("type" in event)) { continue; } - // Transform responses events to chat-like format - // This is a simplified transformation - you may need to adjust based on your needs - if (event.type === 'response.output_text.delta') { - const deltaEvent = event as models.OpenResponsesStreamEventResponseOutputTextDelta; + // Transform responses events to chat-like format using type guards + if (isOutputTextDeltaEvent(event)) { yield { - type: 'content.delta' as const, - delta: deltaEvent.delta, + type: "content.delta" as const, + delta: event.delta, }; - } else if (event.type === 'response.completed') { - const completedEvent = event as models.OpenResponsesStreamEventResponseCompleted; + } else if (isResponseCompletedEvent(event)) { yield { - type: 'message.complete' as const, - response: completedEvent.response, + type: "message.complete" as const, + response: event.response, }; } else { // Pass through other events @@ -607,7 +648,7 @@ export class ResponseWrapper { for (const [toolCallId, results] of this.preliminaryResults) { for (const result of results) { yield { - type: 'tool.preliminary_result' as const, + type: "tool.preliminary_result" as const, toolCallId, result, }; @@ -625,10 +666,12 @@ export class ResponseWrapper { async getToolCalls(): Promise { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } - const completedResponse = await consumeStreamForCompletion(this.reusableStream); + const completedResponse = await consumeStreamForCompletion( + this.reusableStream + ); return extractToolCallsFromResponse(completedResponse); } @@ -637,10 +680,10 @@ export class ResponseWrapper { * Each iteration yields a complete tool call with parsed arguments. */ getToolCallsStream(): AsyncIterableIterator { - return async function* (this: ResponseWrapper) { + return async function* (this: ModelResult) { await this.initStream(); if (!this.reusableStream) { - throw new Error('Stream not initialized'); + throw new Error("Stream not initialized"); } yield* buildToolCallStream(this.reusableStream); diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts index d21f1dc4..bdff1670 100644 --- a/src/lib/primitives.ts +++ b/src/lib/primitives.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 74859f750b28 */ class InvariantError extends Error { diff --git a/src/lib/retries.ts b/src/lib/retries.ts index e3ce9aba..0059a5eb 100644 --- a/src/lib/retries.ts +++ b/src/lib/retries.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b24a69d15639 */ import { isConnectionError, isTimeoutError } from "./http.js"; diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index e06a37fe..35b0fb3e 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: deb4b531fae1 */ import * as z from "zod/v4"; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index 08b7e41b..89074c11 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8a6d91f1218d */ import { SDKHooks } from "../hooks/hooks.js"; diff --git a/src/lib/security.ts b/src/lib/security.ts index 42613e5c..93be85a2 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0502afa7922e */ import * as models from "../models/index.js"; diff --git a/src/lib/stream-transformers.ts b/src/lib/stream-transformers.ts index 46dbfe84..5a2338b2 100644 --- a/src/lib/stream-transformers.ts +++ b/src/lib/stream-transformers.ts @@ -56,6 +56,77 @@ export async function* extractToolDeltas( } } +/** + * Build incremental message updates from responses stream events + * Returns ResponsesOutputMessage (assistant/responses format) + */ +export async function* buildResponsesMessageStream( + stream: ReusableReadableStream, +): AsyncIterableIterator { + const consumer = stream.createConsumer(); + + // Track the accumulated text and message info + let currentText = ''; + let currentId = ''; + let hasStarted = false; + + for await (const event of consumer) { + if (!('type' in event)) { + continue; + } + + switch (event.type) { + case 'response.output_item.added': { + const itemEvent = event as models.OpenResponsesStreamEventResponseOutputItemAdded; + if (itemEvent.item && 'type' in itemEvent.item && itemEvent.item.type === 'message') { + hasStarted = true; + currentText = ''; + const msgItem = itemEvent.item as models.ResponsesOutputMessage; + currentId = msgItem.id; + } + break; + } + + case 'response.output_text.delta': { + const deltaEvent = event as models.OpenResponsesStreamEventResponseOutputTextDelta; + if (hasStarted && deltaEvent.delta) { + currentText += deltaEvent.delta; + + // Yield updated message in ResponsesOutputMessage format + yield { + id: currentId, + type: 'message' as const, + role: 'assistant' as const, + status: 'in_progress' as const, + content: [ + { + type: 'output_text' as const, + text: currentText, + annotations: [], + }, + ], + }; + } + break; + } + + case 'response.output_item.done': { + const itemDoneEvent = event as models.OpenResponsesStreamEventResponseOutputItemDone; + if ( + itemDoneEvent.item && + 'type' in itemDoneEvent.item && + itemDoneEvent.item.type === 'message' + ) { + // Yield final complete message in ResponsesOutputMessage format + const outputMessage = itemDoneEvent.item as models.ResponsesOutputMessage; + yield outputMessage; + } + break; + } + } + } +} + /** * Build incremental message updates from responses stream events * Returns AssistantMessage (chat format) instead of ResponsesOutputMessage @@ -170,7 +241,7 @@ function convertToAssistantMessage( } /** - * Extract the first message from a completed response + * Extract the first message from a completed response (chat format) */ export function extractMessageFromResponse( response: models.OpenResponsesNonStreamingResponse, @@ -186,6 +257,23 @@ export function extractMessageFromResponse( return convertToAssistantMessage(messageItem); } +/** + * Extract the first message from a completed response (responses format) + */ +export function extractResponsesMessageFromResponse( + response: models.OpenResponsesNonStreamingResponse, +): models.ResponsesOutputMessage { + const messageItem = response.output.find( + (item): item is models.ResponsesOutputMessage => 'type' in item && item.type === 'message', + ); + + if (!messageItem) { + throw new Error('No message found in response output'); + } + + return messageItem; +} + /** * Extract text from a response, either from outputText or by concatenating message content */ @@ -360,3 +448,301 @@ export async function* buildToolCallStream( export function responseHasToolCalls(response: models.OpenResponsesNonStreamingResponse): boolean { return response.output.some((item) => 'type' in item && item.type === 'function_call'); } + +/** + * Convert OpenRouter annotations to Claude citations + */ +function mapAnnotationsToCitations( + annotations?: Array +): models.ClaudeTextCitation[] | undefined { + if (!annotations || annotations.length === 0) { + return undefined; + } + + const citations: models.ClaudeTextCitation[] = []; + + for (const annotation of annotations) { + if (!('type' in annotation)) { + continue; + } + + switch (annotation.type) { + case 'file_citation': { + const fileCite = annotation as models.FileCitation; + citations.push({ + type: 'char_location', + cited_text: '', + document_index: fileCite.index, + document_title: fileCite.filename, + file_id: fileCite.fileId, + start_char_index: 0, + end_char_index: 0, + }); + break; + } + + case 'url_citation': { + const urlCite = annotation as models.URLCitation; + citations.push({ + type: 'web_search_result_location', + cited_text: '', + title: urlCite.title, + url: urlCite.url, + encrypted_index: '', + }); + break; + } + + case 'file_path': { + const pathCite = annotation as models.FilePath; + citations.push({ + type: 'char_location', + cited_text: '', + document_index: pathCite.index, + document_title: '', + file_id: pathCite.fileId, + start_char_index: 0, + end_char_index: 0, + }); + break; + } + + default: { + const _exhaustiveCheck: never = annotation; + throw new Error(`Unhandled annotation type: ${(_exhaustiveCheck as { type: string }).type}`); + } + } + } + + return citations.length > 0 ? citations : undefined; +} + +/** + * Map OpenResponses status to Claude stop reason + */ +function mapStopReason( + response: models.OpenResponsesNonStreamingResponse, +): models.ClaudeStopReason | null { + // Check if any tool calls exist in the response + const hasToolCalls = response.output.some( + (item) => 'type' in item && item.type === 'function_call', + ); + + if (hasToolCalls) { + return 'tool_use'; + } + + // Check the response status + if (response.status === 'completed') { + return 'end_turn'; + } + + if (response.status === 'incomplete') { + // Check incomplete reason if available + const incompleteReason = response.incompleteDetails?.reason; + if (incompleteReason === 'max_output_tokens') { + return 'max_tokens'; + } + return 'end_turn'; + } + + return 'end_turn'; +} + +/** + * Convert OpenResponsesNonStreamingResponse to ClaudeMessage format + * Compatible with the Anthropic SDK BetaMessage type + */ +export function convertToClaudeMessage( + response: models.OpenResponsesNonStreamingResponse, +): models.ClaudeMessage { + const content: models.ClaudeContentBlock[] = []; + const unsupportedContent: models.UnsupportedContent[] = []; + + for (const item of response.output) { + if (!('type' in item)) { + continue; + } + + switch (item.type) { + case 'message': { + const msgItem = item as models.ResponsesOutputMessage; + for (const part of msgItem.content) { + if (!('type' in part)) { + continue; + } + + if (part.type === 'output_text') { + const textPart = part as models.ResponseOutputText; + const citations = mapAnnotationsToCitations(textPart.annotations); + + content.push({ + type: 'text', + text: textPart.text, + ...(citations && { citations }), + }); + } else if (part.type === 'refusal') { + const refusalPart = part as models.OpenAIResponsesRefusalContent; + unsupportedContent.push({ + original_type: 'refusal', + data: { refusal: refusalPart.refusal }, + reason: 'Claude does not have a native refusal content type', + }); + } + } + break; + } + + case 'function_call': { + const fnCall = item as models.ResponsesOutputItemFunctionCall; + let parsedInput: Record = {}; + + try { + parsedInput = JSON.parse(fnCall.arguments); + } catch { + parsedInput = {}; + } + + content.push({ + type: 'tool_use', + id: fnCall.callId, + name: fnCall.name, + input: parsedInput, + }); + break; + } + + case 'reasoning': { + const reasoningItem = item as models.ResponsesOutputItemReasoning; + + if (reasoningItem.summary && reasoningItem.summary.length > 0) { + for (const summaryItem of reasoningItem.summary) { + if (summaryItem.type === 'summary_text' && summaryItem.text) { + content.push({ + type: 'thinking', + thinking: summaryItem.text, + signature: '', + }); + } + } + } + + if (reasoningItem.encryptedContent) { + unsupportedContent.push({ + original_type: 'reasoning_encrypted', + data: { + id: reasoningItem.id, + encrypted_content: reasoningItem.encryptedContent, + }, + reason: 'Encrypted reasoning content preserved for round-trip', + }); + } + break; + } + + case 'web_search_call': { + const webSearchItem = item as models.ResponsesWebSearchCallOutput; + content.push({ + type: 'server_tool_use', + id: webSearchItem.id, + name: 'web_search', + input: { status: webSearchItem.status }, + }); + break; + } + + case 'file_search_call': { + const fileSearchItem = item as models.ResponsesOutputItemFileSearchCall; + content.push({ + type: 'tool_use', + id: fileSearchItem.id, + name: 'file_search', + input: { + queries: fileSearchItem.queries, + status: fileSearchItem.status, + }, + }); + break; + } + + case 'image_generation_call': { + const imageGenItem = item as models.ResponsesImageGenerationCall; + unsupportedContent.push({ + original_type: 'image_generation_call', + data: { + id: imageGenItem.id, + result: imageGenItem.result, + status: imageGenItem.status, + }, + reason: 'Claude does not support image outputs in assistant messages', + }); + break; + } + + default: { + const _exhaustiveCheck: never = item; + throw new Error(`Unhandled output item type: ${(_exhaustiveCheck as { type: string }).type}`); + } + } + } + + return { + id: response.id, + type: 'message', + role: 'assistant', + model: response.model ?? 'unknown', + content, + stop_reason: mapStopReason(response), + stop_sequence: null, + usage: { + input_tokens: response.usage?.inputTokens ?? 0, + output_tokens: response.usage?.outputTokens ?? 0, + cache_creation_input_tokens: response.usage?.inputTokensDetails?.cachedTokens ?? 0, + cache_read_input_tokens: 0, + }, + ...(unsupportedContent.length > 0 && { unsupported_content: unsupportedContent }), + }; +} + +/** + * Extract unsupported content by original type + */ +export function extractUnsupportedContent( + message: models.ClaudeMessage, + originalType: string +): models.UnsupportedContent[] { + if (!message.unsupported_content) { + return []; + } + + return message.unsupported_content.filter( + item => item.original_type === originalType + ); +} + +/** + * Check if message has any unsupported content + */ +export function hasUnsupportedContent( + message: models.ClaudeMessage +): boolean { + return !!(message.unsupported_content && message.unsupported_content.length > 0); +} + +/** + * Get summary of unsupported content types + */ +export function getUnsupportedContentSummary( + message: models.ClaudeMessage +): Record { + if (!message.unsupported_content) { + return {}; + } + + const summary: Record = {}; + for (const item of message.unsupported_content) { + summary[item.original_type] = (summary[item.original_type] || 0) + 1; + } + + return summary; +} diff --git a/src/lib/tool-types.ts b/src/lib/tool-types.ts index 5797c7a1..a384b7e4 100644 --- a/src/lib/tool-types.ts +++ b/src/lib/tool-types.ts @@ -1,7 +1,7 @@ import type { ZodObject, ZodRawShape, ZodType, z } from 'zod/v4'; import type * as models from '../models/index.js'; import type { OpenResponsesStreamEvent } from '../models/index.js'; -import type { ResponseWrapper } from './response-wrapper.js'; +import type { ModelResult } from './model-result.js'; /** * Tool type enum for enhanced tools @@ -180,8 +180,8 @@ export type MaxToolRounds = number | ((context: TurnContext) => boolean); // Ret * Result of executeTools operation */ export interface ExecuteToolsResult { - finalResponse: ResponseWrapper; - allResponses: ResponseWrapper[]; + finalResponse: ModelResult; + allResponses: ModelResult[]; toolResults: Map< string, { diff --git a/src/lib/url.ts b/src/lib/url.ts index f3a8de6c..99835829 100644 --- a/src/lib/url.ts +++ b/src/lib/url.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b0057e24ed76 */ const hasOwn = Object.prototype.hasOwnProperty; diff --git a/src/models/activityitem.ts b/src/models/activityitem.ts index 435bfdf1..c13ce725 100644 --- a/src/models/activityitem.ts +++ b/src/models/activityitem.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ee2d86453873 */ import * as z from "zod/v4"; diff --git a/src/models/assistantmessage.ts b/src/models/assistantmessage.ts index 568292c4..6bebeafe 100644 --- a/src/models/assistantmessage.ts +++ b/src/models/assistantmessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2147a953e992 */ import * as z from "zod/v4"; diff --git a/src/models/badgatewayresponseerrordata.ts b/src/models/badgatewayresponseerrordata.ts index 48fbde97..d636dbfd 100644 --- a/src/models/badgatewayresponseerrordata.ts +++ b/src/models/badgatewayresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: de317517c298 */ import * as z from "zod/v4"; diff --git a/src/models/badrequestresponseerrordata.ts b/src/models/badrequestresponseerrordata.ts index c18d52bc..f2adbe93 100644 --- a/src/models/badrequestresponseerrordata.ts +++ b/src/models/badrequestresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 42d173ee6203 */ import * as z from "zod/v4"; diff --git a/src/models/chatcompletionfinishreason.ts b/src/models/chatcompletionfinishreason.ts index 57f8af17..83a32911 100644 --- a/src/models/chatcompletionfinishreason.ts +++ b/src/models/chatcompletionfinishreason.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6b06a4d1562d */ import * as z from "zod/v4"; diff --git a/src/models/chaterror.ts b/src/models/chaterror.ts index 62185e7a..9f509fc9 100644 --- a/src/models/chaterror.ts +++ b/src/models/chaterror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b107ec938dc1 */ import * as z from "zod/v4"; diff --git a/src/models/chatgenerationparams.ts b/src/models/chatgenerationparams.ts index b9660761..6f601cc6 100644 --- a/src/models/chatgenerationparams.ts +++ b/src/models/chatgenerationparams.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f98a2a558f3f */ import * as z from "zod/v4"; diff --git a/src/models/chatgenerationtokenusage.ts b/src/models/chatgenerationtokenusage.ts index e3658f5e..07e1115a 100644 --- a/src/models/chatgenerationtokenusage.ts +++ b/src/models/chatgenerationtokenusage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1d57b0d238b8 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitem.ts b/src/models/chatmessagecontentitem.ts index 6a361798..f1548c67 100644 --- a/src/models/chatmessagecontentitem.ts +++ b/src/models/chatmessagecontentitem.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: bb7f6b29b93f */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitemaudio.ts b/src/models/chatmessagecontentitemaudio.ts index 288f044d..afcdc4c1 100644 --- a/src/models/chatmessagecontentitemaudio.ts +++ b/src/models/chatmessagecontentitemaudio.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 49b1cafcb338 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitemcachecontrol.ts b/src/models/chatmessagecontentitemcachecontrol.ts index 17e69859..c368f953 100644 --- a/src/models/chatmessagecontentitemcachecontrol.ts +++ b/src/models/chatmessagecontentitemcachecontrol.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b5c18e04e19c */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitemimage.ts b/src/models/chatmessagecontentitemimage.ts index 5e43bf42..2d47383c 100644 --- a/src/models/chatmessagecontentitemimage.ts +++ b/src/models/chatmessagecontentitemimage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3989cdc41817 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitemtext.ts b/src/models/chatmessagecontentitemtext.ts index c5218834..aa527d53 100644 --- a/src/models/chatmessagecontentitemtext.ts +++ b/src/models/chatmessagecontentitemtext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 27089860fd98 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagecontentitemvideo.ts b/src/models/chatmessagecontentitemvideo.ts index d4d3f3f3..9847a917 100644 --- a/src/models/chatmessagecontentitemvideo.ts +++ b/src/models/chatmessagecontentitemvideo.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5a81301cb4a7 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagetokenlogprob.ts b/src/models/chatmessagetokenlogprob.ts index c9364bfd..327bfbd1 100644 --- a/src/models/chatmessagetokenlogprob.ts +++ b/src/models/chatmessagetokenlogprob.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: eed686a58eb1 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagetokenlogprobs.ts b/src/models/chatmessagetokenlogprobs.ts index cd2e58bf..d898f22a 100644 --- a/src/models/chatmessagetokenlogprobs.ts +++ b/src/models/chatmessagetokenlogprobs.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2dbd9fc61ed8 */ import * as z from "zod/v4"; diff --git a/src/models/chatmessagetoolcall.ts b/src/models/chatmessagetoolcall.ts index 3e9a3fe0..c6678412 100644 --- a/src/models/chatmessagetoolcall.ts +++ b/src/models/chatmessagetoolcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b294b44052da */ import * as z from "zod/v4"; diff --git a/src/models/chatresponse.ts b/src/models/chatresponse.ts index 81003fe9..e1e9ede1 100644 --- a/src/models/chatresponse.ts +++ b/src/models/chatresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 76c3703fa3d5 */ import * as z from "zod/v4"; diff --git a/src/models/chatresponsechoice.ts b/src/models/chatresponsechoice.ts index 047d5f3f..cfbb8a52 100644 --- a/src/models/chatresponsechoice.ts +++ b/src/models/chatresponsechoice.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7db13c3cc866 */ import * as z from "zod/v4"; diff --git a/src/models/chatstreamingchoice.ts b/src/models/chatstreamingchoice.ts index c1a817ce..43fa1d4c 100644 --- a/src/models/chatstreamingchoice.ts +++ b/src/models/chatstreamingchoice.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 15346f0b1bc4 */ import * as z from "zod/v4"; diff --git a/src/models/chatstreamingmessagechunk.ts b/src/models/chatstreamingmessagechunk.ts index a1813c97..9e132964 100644 --- a/src/models/chatstreamingmessagechunk.ts +++ b/src/models/chatstreamingmessagechunk.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 339ee7e4b920 */ import * as z from "zod/v4"; diff --git a/src/models/chatstreamingmessagetoolcall.ts b/src/models/chatstreamingmessagetoolcall.ts index 45835d9e..fc2c3662 100644 --- a/src/models/chatstreamingmessagetoolcall.ts +++ b/src/models/chatstreamingmessagetoolcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 74ba154581ba */ import * as z from "zod/v4"; diff --git a/src/models/chatstreamingresponsechunk.ts b/src/models/chatstreamingresponsechunk.ts index def0e6c9..b3e9a660 100644 --- a/src/models/chatstreamingresponsechunk.ts +++ b/src/models/chatstreamingresponsechunk.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 00bf2ea52439 */ import * as z from "zod/v4"; diff --git a/src/models/chatstreamoptions.ts b/src/models/chatstreamoptions.ts index 6a987f76..aee57eed 100644 --- a/src/models/chatstreamoptions.ts +++ b/src/models/chatstreamoptions.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 83ba1c3db4bb */ import * as z from "zod/v4"; diff --git a/src/models/claude-message.ts b/src/models/claude-message.ts new file mode 100644 index 00000000..d714c97e --- /dev/null +++ b/src/models/claude-message.ts @@ -0,0 +1,269 @@ +/* + * Types copied from @anthropic-ai/sdk for ClaudeMessage format. + * These types represent the Anthropic Claude API message response structure. + */ + +/** + * Reason why the model stopped generating. + */ +export type ClaudeStopReason = + | "end_turn" + | "max_tokens" + | "stop_sequence" + | "tool_use" + | "pause_turn" + | "refusal"; + +/** + * Character-level citation location within a document. + */ +export type ClaudeCitationCharLocation = { + type: "char_location"; + cited_text: string; + document_index: number; + document_title: string; + file_id: string; + start_char_index: number; + end_char_index: number; +}; + +/** + * Page-level citation location within a document. + */ +export type ClaudeCitationPageLocation = { + type: "page_location"; + cited_text: string; + document_index: number; + document_title: string; + file_id: string; + start_page_number: number; + end_page_number: number; +}; + +/** + * Content block citation location within a document. + */ +export type ClaudeCitationContentBlockLocation = { + type: "content_block_location"; + cited_text: string; + document_index: number; + document_title: string; + file_id: string; + start_block_index: number; + end_block_index: number; +}; + +/** + * Web search result citation location. + */ +export type ClaudeCitationWebSearchResultLocation = { + type: "web_search_result_location"; + cited_text: string; + title: string; + url: string; + encrypted_index: string; +}; + +/** + * Search result citation location. + */ +export type ClaudeCitationSearchResultLocation = { + type: "search_result_location"; + cited_text: string; + title: string; + source: string; + start_block_index: number; + end_block_index: number; + search_result_index: number; +}; + +/** + * Union of all text citation types. + */ +export type ClaudeTextCitation = + | ClaudeCitationCharLocation + | ClaudeCitationPageLocation + | ClaudeCitationContentBlockLocation + | ClaudeCitationWebSearchResultLocation + | ClaudeCitationSearchResultLocation; + +/** + * Text content block. + */ +export type ClaudeTextBlock = { + type: "text"; + text: string; + citations?: ClaudeTextCitation[]; +}; + +/** + * Extended thinking content block. + */ +export type ClaudeThinkingBlock = { + type: "thinking"; + thinking: string; + signature: string; +}; + +/** + * Redacted thinking content block. + */ +export type ClaudeRedactedThinkingBlock = { + type: "redacted_thinking"; + data: string; +}; + +/** + * Tool use content block. + */ +export type ClaudeToolUseBlock = { + type: "tool_use"; + id: string; + name: string; + input: Record; +}; + +/** + * Server-side tool use content block (e.g., web_search). + */ +export type ClaudeServerToolUseBlock = { + type: "server_tool_use"; + id: string; + name: "web_search"; + input: Record; +}; + +/** + * Union of all content block types. + */ +export type ClaudeContentBlock = + | ClaudeTextBlock + | ClaudeThinkingBlock + | ClaudeRedactedThinkingBlock + | ClaudeToolUseBlock + | ClaudeServerToolUseBlock; + +/** + * Token usage information. + */ +export type ClaudeUsage = { + input_tokens: number; + output_tokens: number; + cache_creation_input_tokens?: number; + cache_read_input_tokens?: number; +}; + +/** + * Claude Message response format compatible with the Anthropic SDK. + * This represents a complete assistant response from the Claude API. + */ +export type ClaudeMessage = { + id: string; + type: "message"; + role: "assistant"; + model: string; + content: ClaudeContentBlock[]; + stop_reason: ClaudeStopReason | null; + stop_sequence?: string | null; + usage: ClaudeUsage; + /** Unmappable content preserved for lossless round-trips */ + unsupported_content?: UnsupportedContent[]; +}; + +// --- INPUT TYPES (MessageParam) --- +// These types represent the Anthropic Claude API message input structure. + +/** + * Cache control for prompt caching. + */ +export type ClaudeCacheControl = { + type: "ephemeral"; +}; + +/** + * Text content block parameter for input. + */ +export type ClaudeTextBlockParam = { + type: "text"; + text: string; + cache_control?: ClaudeCacheControl | null; +}; + +/** + * Base64-encoded image source. + */ +export type ClaudeBase64ImageSource = { + type: "base64"; + media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"; + data: string; +}; + +/** + * URL-based image source. + */ +export type ClaudeURLImageSource = { + type: "url"; + url: string; +}; + +/** + * Image content block parameter for input. + */ +export type ClaudeImageBlockParam = { + type: "image"; + source: ClaudeBase64ImageSource | ClaudeURLImageSource; + cache_control?: ClaudeCacheControl | null; +}; + +/** + * Tool use content block parameter for input (when passing assistant's tool use back). + */ +export type ClaudeToolUseBlockParam = { + type: "tool_use"; + id: string; + name: string; + input: Record; + cache_control?: ClaudeCacheControl | null; +}; + +/** + * Tool result content block parameter for input. + */ +export type ClaudeToolResultBlockParam = { + type: "tool_result"; + tool_use_id: string; + content: string | Array; + is_error?: boolean; + cache_control?: ClaudeCacheControl | null; +}; + +/** + * Union of all input content block types. + */ +export type ClaudeContentBlockParam = + | ClaudeTextBlockParam + | ClaudeImageBlockParam + | ClaudeToolUseBlockParam + | ClaudeToolResultBlockParam; + +/** + * Claude MessageParam input format compatible with the Anthropic SDK. + * This represents a message in a conversation for the Claude API. + */ +export type ClaudeMessageParam = { + role: "user" | "assistant"; + content: string | Array; +}; + +/** + * Container for content that cannot be mapped to Claude's native format. + * Preserves information for round-trip conversions. + */ +export type UnsupportedContent = { + /** Original type from source format (e.g., "image_generation_call", "refusal") */ + original_type: string; + /** Complete original data structure */ + data: Record; + /** Optional explanation of why this couldn't be mapped */ + reason?: string; +}; diff --git a/src/models/completionchoice.ts b/src/models/completionchoice.ts index 326299b1..db6b2a5d 100644 --- a/src/models/completionchoice.ts +++ b/src/models/completionchoice.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 86092a0ff4c4 */ import * as z from "zod/v4"; diff --git a/src/models/completioncreateparams.ts b/src/models/completioncreateparams.ts index cd68cfa2..0c5a338c 100644 --- a/src/models/completioncreateparams.ts +++ b/src/models/completioncreateparams.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 44cc0c9c4c06 */ import * as z from "zod/v4"; diff --git a/src/models/completionlogprobs.ts b/src/models/completionlogprobs.ts index 929d5286..17fb1848 100644 --- a/src/models/completionlogprobs.ts +++ b/src/models/completionlogprobs.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b6552175348e */ import * as z from "zod/v4"; diff --git a/src/models/completionresponse.ts b/src/models/completionresponse.ts index 9dc714bf..242ad6bd 100644 --- a/src/models/completionresponse.ts +++ b/src/models/completionresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 316ab9f7e558 */ import * as z from "zod/v4"; diff --git a/src/models/completionusage.ts b/src/models/completionusage.ts index c5cf5a17..d278ff1d 100644 --- a/src/models/completionusage.ts +++ b/src/models/completionusage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4a222248409d */ import * as z from "zod/v4"; diff --git a/src/models/createchargerequest.ts b/src/models/createchargerequest.ts index 7d5ad288..bd6860c3 100644 --- a/src/models/createchargerequest.ts +++ b/src/models/createchargerequest.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c342dc72d1f4 */ import * as z from "zod/v4"; diff --git a/src/models/datacollection.ts b/src/models/datacollection.ts index d2dfe960..e075ba95 100644 --- a/src/models/datacollection.ts +++ b/src/models/datacollection.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fa417e9ad79a */ import * as z from "zod/v4"; diff --git a/src/models/defaultparameters.ts b/src/models/defaultparameters.ts index a9161e79..25444216 100644 --- a/src/models/defaultparameters.ts +++ b/src/models/defaultparameters.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8da6fac53cb5 */ import * as z from "zod/v4"; diff --git a/src/models/edgenetworktimeoutresponseerrordata.ts b/src/models/edgenetworktimeoutresponseerrordata.ts index 4f119ada..913dc5af 100644 --- a/src/models/edgenetworktimeoutresponseerrordata.ts +++ b/src/models/edgenetworktimeoutresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d86e84250105 */ import * as z from "zod/v4"; diff --git a/src/models/endpointstatus.ts b/src/models/endpointstatus.ts index 0a64d91d..afd9fedd 100644 --- a/src/models/endpointstatus.ts +++ b/src/models/endpointstatus.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 83efda25dcf0 */ import * as z from "zod/v4"; diff --git a/src/models/errors/badgatewayresponseerror.ts b/src/models/errors/badgatewayresponseerror.ts index e7882291..b958b87c 100644 --- a/src/models/errors/badgatewayresponseerror.ts +++ b/src/models/errors/badgatewayresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6264bb9f01d6 */ import * as z from "zod/v4"; diff --git a/src/models/errors/badrequestresponseerror.ts b/src/models/errors/badrequestresponseerror.ts index 78ee4b48..7d2b7ba7 100644 --- a/src/models/errors/badrequestresponseerror.ts +++ b/src/models/errors/badrequestresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: beddfd22a313 */ import * as z from "zod/v4"; diff --git a/src/models/errors/chaterror.ts b/src/models/errors/chaterror.ts index 6b59af29..33cb7e5a 100644 --- a/src/models/errors/chaterror.ts +++ b/src/models/errors/chaterror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a3b18e48f494 */ import * as z from "zod/v4"; diff --git a/src/models/errors/edgenetworktimeoutresponseerror.ts b/src/models/errors/edgenetworktimeoutresponseerror.ts index 6e76cb1b..6bd7dedf 100644 --- a/src/models/errors/edgenetworktimeoutresponseerror.ts +++ b/src/models/errors/edgenetworktimeoutresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: da53f308c771 */ import * as z from "zod/v4"; diff --git a/src/models/errors/forbiddenresponseerror.ts b/src/models/errors/forbiddenresponseerror.ts index efc9de83..1d464f8b 100644 --- a/src/models/errors/forbiddenresponseerror.ts +++ b/src/models/errors/forbiddenresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d08a9d9ee588 */ import * as z from "zod/v4"; diff --git a/src/models/errors/httpclienterrors.ts b/src/models/errors/httpclienterrors.ts index b34f6121..53bb3cfa 100644 --- a/src/models/errors/httpclienterrors.ts +++ b/src/models/errors/httpclienterrors.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6948de76af99 */ /** diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index e0890b3d..c5ddaff0 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c4e22507cb83 */ export * from "./badgatewayresponseerror.js"; diff --git a/src/models/errors/internalserverresponseerror.ts b/src/models/errors/internalserverresponseerror.ts index bde8483e..c55187c8 100644 --- a/src/models/errors/internalserverresponseerror.ts +++ b/src/models/errors/internalserverresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 02b76cec85f0 */ import * as z from "zod/v4"; diff --git a/src/models/errors/notfoundresponseerror.ts b/src/models/errors/notfoundresponseerror.ts index e3e8f126..012d7fc7 100644 --- a/src/models/errors/notfoundresponseerror.ts +++ b/src/models/errors/notfoundresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1914d6d7fbaf */ import * as z from "zod/v4"; diff --git a/src/models/errors/openrouterdefaulterror.ts b/src/models/errors/openrouterdefaulterror.ts index a60c29d3..ed1b4f73 100644 --- a/src/models/errors/openrouterdefaulterror.ts +++ b/src/models/errors/openrouterdefaulterror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8a3f2faf1848 */ import { OpenRouterError } from "./openroutererror.js"; diff --git a/src/models/errors/openroutererror.ts b/src/models/errors/openroutererror.ts index 0ef8d3bd..2c0023c4 100644 --- a/src/models/errors/openroutererror.ts +++ b/src/models/errors/openroutererror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b030240a8442 */ /** The base class for all HTTP error responses */ diff --git a/src/models/errors/payloadtoolargeresponseerror.ts b/src/models/errors/payloadtoolargeresponseerror.ts index ff30548b..ad0ab4bd 100644 --- a/src/models/errors/payloadtoolargeresponseerror.ts +++ b/src/models/errors/payloadtoolargeresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f1e472cb7b51 */ import * as z from "zod/v4"; diff --git a/src/models/errors/paymentrequiredresponseerror.ts b/src/models/errors/paymentrequiredresponseerror.ts index 7943bcd5..70f8350e 100644 --- a/src/models/errors/paymentrequiredresponseerror.ts +++ b/src/models/errors/paymentrequiredresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f70439757fb9 */ import * as z from "zod/v4"; diff --git a/src/models/errors/provideroverloadedresponseerror.ts b/src/models/errors/provideroverloadedresponseerror.ts index 977f9f3e..6af814f9 100644 --- a/src/models/errors/provideroverloadedresponseerror.ts +++ b/src/models/errors/provideroverloadedresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ba8edf813fa0 */ import * as z from "zod/v4"; diff --git a/src/models/errors/requesttimeoutresponseerror.ts b/src/models/errors/requesttimeoutresponseerror.ts index 0a4dbca1..b30969db 100644 --- a/src/models/errors/requesttimeoutresponseerror.ts +++ b/src/models/errors/requesttimeoutresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3a4a755c8536 */ import * as z from "zod/v4"; diff --git a/src/models/errors/responsevalidationerror.ts b/src/models/errors/responsevalidationerror.ts index dbc35f5f..be62cb8a 100644 --- a/src/models/errors/responsevalidationerror.ts +++ b/src/models/errors/responsevalidationerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 88ff98a41be9 */ import * as z from "zod/v4/core"; diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts index db00022e..35e71438 100644 --- a/src/models/errors/sdkvalidationerror.ts +++ b/src/models/errors/sdkvalidationerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fb6b2b49c445 */ import * as z from "zod/v4/core"; diff --git a/src/models/errors/serviceunavailableresponseerror.ts b/src/models/errors/serviceunavailableresponseerror.ts index 2398a2d4..1b11022a 100644 --- a/src/models/errors/serviceunavailableresponseerror.ts +++ b/src/models/errors/serviceunavailableresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1259f9d051c8 */ import * as z from "zod/v4"; diff --git a/src/models/errors/toomanyrequestsresponseerror.ts b/src/models/errors/toomanyrequestsresponseerror.ts index 72f952e6..c67e4d84 100644 --- a/src/models/errors/toomanyrequestsresponseerror.ts +++ b/src/models/errors/toomanyrequestsresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ab15bfa145f3 */ import * as z from "zod/v4"; diff --git a/src/models/errors/unauthorizedresponseerror.ts b/src/models/errors/unauthorizedresponseerror.ts index 714c269f..d6258e10 100644 --- a/src/models/errors/unauthorizedresponseerror.ts +++ b/src/models/errors/unauthorizedresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 79ab0861cf08 */ import * as z from "zod/v4"; diff --git a/src/models/errors/unprocessableentityresponseerror.ts b/src/models/errors/unprocessableentityresponseerror.ts index 2c35cd2c..4ece53ed 100644 --- a/src/models/errors/unprocessableentityresponseerror.ts +++ b/src/models/errors/unprocessableentityresponseerror.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d81e01bbb5e3 */ import * as z from "zod/v4"; diff --git a/src/models/filecitation.ts b/src/models/filecitation.ts index 00b7a5d7..665445c5 100644 --- a/src/models/filecitation.ts +++ b/src/models/filecitation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0e609723dbc8 */ import * as z from "zod/v4"; diff --git a/src/models/filepath.ts b/src/models/filepath.ts index 08abb411..90ff601b 100644 --- a/src/models/filepath.ts +++ b/src/models/filepath.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0f8d4008ed8e */ import * as z from "zod/v4"; diff --git a/src/models/forbiddenresponseerrordata.ts b/src/models/forbiddenresponseerrordata.ts index 95d7139a..2d84cb3d 100644 --- a/src/models/forbiddenresponseerrordata.ts +++ b/src/models/forbiddenresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cc3fdc45a2fd */ import * as z from "zod/v4"; diff --git a/src/models/imagegenerationstatus.ts b/src/models/imagegenerationstatus.ts index 448a4bc9..db61647c 100644 --- a/src/models/imagegenerationstatus.ts +++ b/src/models/imagegenerationstatus.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2a72a5923e5a */ import * as z from "zod/v4"; diff --git a/src/models/index.ts b/src/models/index.ts index 75a97006..f8e040d1 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f93644b0f37e */ export * from "./activityitem.js"; @@ -154,3 +155,4 @@ export * from "./usermessage.js"; export * from "./websearchengine.js"; export * from "./websearchpreviewtooluserlocation.js"; export * from "./websearchstatus.js"; +export * from "./claude-message.js"; diff --git a/src/models/inputmodality.ts b/src/models/inputmodality.ts index 7ce05bff..a92bcc40 100644 --- a/src/models/inputmodality.ts +++ b/src/models/inputmodality.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 771d5d4c91ec */ import * as z from "zod/v4"; diff --git a/src/models/instructtype.ts b/src/models/instructtype.ts index 2353fbb0..339d2ae8 100644 --- a/src/models/instructtype.ts +++ b/src/models/instructtype.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 970f140dadec */ import * as z from "zod/v4"; diff --git a/src/models/internalserverresponseerrordata.ts b/src/models/internalserverresponseerrordata.ts index cba30682..1676c40a 100644 --- a/src/models/internalserverresponseerrordata.ts +++ b/src/models/internalserverresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 48c17eec376a */ import * as z from "zod/v4"; diff --git a/src/models/jsonschemaconfig.ts b/src/models/jsonschemaconfig.ts index cc17f5ee..4ea4757a 100644 --- a/src/models/jsonschemaconfig.ts +++ b/src/models/jsonschemaconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a5dbdd0305ec */ import * as z from "zod/v4"; diff --git a/src/models/listendpointsresponse.ts b/src/models/listendpointsresponse.ts index 184395b4..b6d6af83 100644 --- a/src/models/listendpointsresponse.ts +++ b/src/models/listendpointsresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5178e92a44ba */ import * as z from "zod/v4"; diff --git a/src/models/message.ts b/src/models/message.ts index 616bb498..9c6974a6 100644 --- a/src/models/message.ts +++ b/src/models/message.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 34645e53d993 */ import * as z from "zod/v4"; diff --git a/src/models/model.ts b/src/models/model.ts index 656b3ff5..6248dbe4 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b99d4c14e794 */ import * as z from "zod/v4"; diff --git a/src/models/modelarchitecture.ts b/src/models/modelarchitecture.ts index cc1af3ba..7b404df1 100644 --- a/src/models/modelarchitecture.ts +++ b/src/models/modelarchitecture.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 57607576095f */ import * as z from "zod/v4"; diff --git a/src/models/modelgroup.ts b/src/models/modelgroup.ts index 46567fe6..9c40d281 100644 --- a/src/models/modelgroup.ts +++ b/src/models/modelgroup.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b65482ec4223 */ import * as z from "zod/v4"; diff --git a/src/models/modelscountresponse.ts b/src/models/modelscountresponse.ts index 370d489b..cb6c47ea 100644 --- a/src/models/modelscountresponse.ts +++ b/src/models/modelscountresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cf41f6279453 */ import * as z from "zod/v4"; diff --git a/src/models/modelslistresponse.ts b/src/models/modelslistresponse.ts index b36813b7..f3fae481 100644 --- a/src/models/modelslistresponse.ts +++ b/src/models/modelslistresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ea0e62a13d8d */ import * as z from "zod/v4"; diff --git a/src/models/namedtoolchoice.ts b/src/models/namedtoolchoice.ts index acc523e5..1603f2c8 100644 --- a/src/models/namedtoolchoice.ts +++ b/src/models/namedtoolchoice.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: db68e36b6a77 */ import * as z from "zod/v4"; diff --git a/src/models/notfoundresponseerrordata.ts b/src/models/notfoundresponseerrordata.ts index ba991ce7..aa237f7f 100644 --- a/src/models/notfoundresponseerrordata.ts +++ b/src/models/notfoundresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6c2943dd4f02 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesannotation.ts b/src/models/openairesponsesannotation.ts index 7720e9dc..c402006e 100644 --- a/src/models/openairesponsesannotation.ts +++ b/src/models/openairesponsesannotation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5828fa2314e3 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesincludable.ts b/src/models/openairesponsesincludable.ts index f377c38a..ca3d42fe 100644 --- a/src/models/openairesponsesincludable.ts +++ b/src/models/openairesponsesincludable.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3b5ed15267fc */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesincompletedetails.ts b/src/models/openairesponsesincompletedetails.ts index 03fb41a8..0e524e09 100644 --- a/src/models/openairesponsesincompletedetails.ts +++ b/src/models/openairesponsesincompletedetails.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f2aabee6a438 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesinputunion.ts b/src/models/openairesponsesinputunion.ts index 73702880..b840e414 100644 --- a/src/models/openairesponsesinputunion.ts +++ b/src/models/openairesponsesinputunion.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0b061e126936 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesprompt.ts b/src/models/openairesponsesprompt.ts index 91c80fb2..faf39e85 100644 --- a/src/models/openairesponsesprompt.ts +++ b/src/models/openairesponsesprompt.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c583d897e9d2 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesreasoningconfig.ts b/src/models/openairesponsesreasoningconfig.ts index f8b75c5c..eeea2c05 100644 --- a/src/models/openairesponsesreasoningconfig.ts +++ b/src/models/openairesponsesreasoningconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 60a66fbc6068 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesreasoningeffort.ts b/src/models/openairesponsesreasoningeffort.ts index 97d8746d..9d53b5f5 100644 --- a/src/models/openairesponsesreasoningeffort.ts +++ b/src/models/openairesponsesreasoningeffort.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: af69873eff63 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesrefusalcontent.ts b/src/models/openairesponsesrefusalcontent.ts index dd3273b1..2252e00a 100644 --- a/src/models/openairesponsesrefusalcontent.ts +++ b/src/models/openairesponsesrefusalcontent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5445ae4a5385 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesresponsestatus.ts b/src/models/openairesponsesresponsestatus.ts index 7d0c0764..aea8bf92 100644 --- a/src/models/openairesponsesresponsestatus.ts +++ b/src/models/openairesponsesresponsestatus.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b721d7085e40 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsesservicetier.ts b/src/models/openairesponsesservicetier.ts index 6189fd19..8299718d 100644 --- a/src/models/openairesponsesservicetier.ts +++ b/src/models/openairesponsesservicetier.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 88b4cb1f9919 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsestoolchoiceunion.ts b/src/models/openairesponsestoolchoiceunion.ts index 5c98f015..f35263df 100644 --- a/src/models/openairesponsestoolchoiceunion.ts +++ b/src/models/openairesponsestoolchoiceunion.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 73d80db9cd46 */ import * as z from "zod/v4"; diff --git a/src/models/openairesponsestruncation.ts b/src/models/openairesponsestruncation.ts index f556163b..b307aa9d 100644 --- a/src/models/openairesponsestruncation.ts +++ b/src/models/openairesponsestruncation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 03de9ac74888 */ import * as z from "zod/v4"; diff --git a/src/models/openresponseseasyinputmessage.ts b/src/models/openresponseseasyinputmessage.ts index 5e75df15..dedeed37 100644 --- a/src/models/openresponseseasyinputmessage.ts +++ b/src/models/openresponseseasyinputmessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9cae543ceb47 */ import * as z from "zod/v4"; diff --git a/src/models/openresponseserrorevent.ts b/src/models/openresponseserrorevent.ts index ad39bdad..6585539c 100644 --- a/src/models/openresponseserrorevent.ts +++ b/src/models/openresponseserrorevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 508880501ed2 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesfunctioncalloutput.ts b/src/models/openresponsesfunctioncalloutput.ts index 58f5bb17..0fe2b77d 100644 --- a/src/models/openresponsesfunctioncalloutput.ts +++ b/src/models/openresponsesfunctioncalloutput.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5e801f7b2903 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesfunctiontoolcall.ts b/src/models/openresponsesfunctiontoolcall.ts index e3978832..b3b12fca 100644 --- a/src/models/openresponsesfunctiontoolcall.ts +++ b/src/models/openresponsesfunctiontoolcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b028e3118a4e */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesimagegencallcompleted.ts b/src/models/openresponsesimagegencallcompleted.ts index 83345a07..7b5eff27 100644 --- a/src/models/openresponsesimagegencallcompleted.ts +++ b/src/models/openresponsesimagegencallcompleted.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8f2a1c3fbf5d */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesimagegencallgenerating.ts b/src/models/openresponsesimagegencallgenerating.ts index 71facbf7..b06bf7fd 100644 --- a/src/models/openresponsesimagegencallgenerating.ts +++ b/src/models/openresponsesimagegencallgenerating.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 97b22c3fad75 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesimagegencallinprogress.ts b/src/models/openresponsesimagegencallinprogress.ts index 04bb03c9..c04765b1 100644 --- a/src/models/openresponsesimagegencallinprogress.ts +++ b/src/models/openresponsesimagegencallinprogress.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 402a8da9c8da */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesimagegencallpartialimage.ts b/src/models/openresponsesimagegencallpartialimage.ts index e21d39d5..aedca402 100644 --- a/src/models/openresponsesimagegencallpartialimage.ts +++ b/src/models/openresponsesimagegencallpartialimage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 053a18912617 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesinput.ts b/src/models/openresponsesinput.ts index ce9a2391..7f007b7a 100644 --- a/src/models/openresponsesinput.ts +++ b/src/models/openresponsesinput.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cc6c94fdea13 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesinputmessageitem.ts b/src/models/openresponsesinputmessageitem.ts index 4f210753..d95f5d29 100644 --- a/src/models/openresponsesinputmessageitem.ts +++ b/src/models/openresponsesinputmessageitem.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cccc4eb21a9b */ import * as z from "zod/v4"; diff --git a/src/models/openresponseslogprobs.ts b/src/models/openresponseslogprobs.ts index 567cdfc4..ea0b9a92 100644 --- a/src/models/openresponseslogprobs.ts +++ b/src/models/openresponseslogprobs.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7ec69a3158fc */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesnonstreamingresponse.ts b/src/models/openresponsesnonstreamingresponse.ts index 2467beaa..55771267 100644 --- a/src/models/openresponsesnonstreamingresponse.ts +++ b/src/models/openresponsesnonstreamingresponse.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ffd6f7198dd7 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoning.ts b/src/models/openresponsesreasoning.ts index 22ec11c4..2bf9ff6b 100644 --- a/src/models/openresponsesreasoning.ts +++ b/src/models/openresponsesreasoning.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 296442f2d24a */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningconfig.ts b/src/models/openresponsesreasoningconfig.ts index f4e607ba..6c2046fa 100644 --- a/src/models/openresponsesreasoningconfig.ts +++ b/src/models/openresponsesreasoningconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c2f9d074fbd4 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningdeltaevent.ts b/src/models/openresponsesreasoningdeltaevent.ts index 82853c01..d306e0a7 100644 --- a/src/models/openresponsesreasoningdeltaevent.ts +++ b/src/models/openresponsesreasoningdeltaevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 32b751d1d3d7 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningdoneevent.ts b/src/models/openresponsesreasoningdoneevent.ts index 5d037417..adafa6bf 100644 --- a/src/models/openresponsesreasoningdoneevent.ts +++ b/src/models/openresponsesreasoningdoneevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f76803b0bdd0 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningsummarypartaddedevent.ts b/src/models/openresponsesreasoningsummarypartaddedevent.ts index 2aed51bb..1a65568c 100644 --- a/src/models/openresponsesreasoningsummarypartaddedevent.ts +++ b/src/models/openresponsesreasoningsummarypartaddedevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e83b9ca2ee64 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningsummarytextdeltaevent.ts b/src/models/openresponsesreasoningsummarytextdeltaevent.ts index c0160cd6..f29f6bbe 100644 --- a/src/models/openresponsesreasoningsummarytextdeltaevent.ts +++ b/src/models/openresponsesreasoningsummarytextdeltaevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 61ee69f0a41f */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesreasoningsummarytextdoneevent.ts b/src/models/openresponsesreasoningsummarytextdoneevent.ts index cced6a23..438e3268 100644 --- a/src/models/openresponsesreasoningsummarytextdoneevent.ts +++ b/src/models/openresponsesreasoningsummarytextdoneevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0519f084cea8 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesrequest.ts b/src/models/openresponsesrequest.ts index c53f8ce5..b415f732 100644 --- a/src/models/openresponsesrequest.ts +++ b/src/models/openresponsesrequest.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ff8a31d46b1c */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesresponsetext.ts b/src/models/openresponsesresponsetext.ts index ee8a07de..56f6d642 100644 --- a/src/models/openresponsesresponsetext.ts +++ b/src/models/openresponsesresponsetext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: aded1ce23b04 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesstreamevent.ts b/src/models/openresponsesstreamevent.ts index f38f9125..40398c79 100644 --- a/src/models/openresponsesstreamevent.ts +++ b/src/models/openresponsesstreamevent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: bdd51c7b4bd0 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsestoplogprobs.ts b/src/models/openresponsestoplogprobs.ts index 88ce3acd..12a5897e 100644 --- a/src/models/openresponsestoplogprobs.ts +++ b/src/models/openresponsestoplogprobs.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9deb0a6359d1 */ import * as z from "zod/v4"; diff --git a/src/models/openresponsesusage.ts b/src/models/openresponsesusage.ts index f083cbbd..736c9789 100644 --- a/src/models/openresponsesusage.ts +++ b/src/models/openresponsesusage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 806527de3bfd */ import * as z from "zod/v4"; diff --git a/src/models/openresponseswebsearch20250826tool.ts b/src/models/openresponseswebsearch20250826tool.ts index 2b54b4f1..a8ec3ef2 100644 --- a/src/models/openresponseswebsearch20250826tool.ts +++ b/src/models/openresponseswebsearch20250826tool.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7650f38c7184 */ import * as z from "zod/v4"; diff --git a/src/models/openresponseswebsearchpreview20250311tool.ts b/src/models/openresponseswebsearchpreview20250311tool.ts index a2ef0deb..767d79d8 100644 --- a/src/models/openresponseswebsearchpreview20250311tool.ts +++ b/src/models/openresponseswebsearchpreview20250311tool.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d450efb8b660 */ import * as z from "zod/v4"; diff --git a/src/models/openresponseswebsearchpreviewtool.ts b/src/models/openresponseswebsearchpreviewtool.ts index 02bf2042..53d80f92 100644 --- a/src/models/openresponseswebsearchpreviewtool.ts +++ b/src/models/openresponseswebsearchpreviewtool.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7d594dd37b72 */ import * as z from "zod/v4"; diff --git a/src/models/openresponseswebsearchtool.ts b/src/models/openresponseswebsearchtool.ts index 24137408..187fdd5a 100644 --- a/src/models/openresponseswebsearchtool.ts +++ b/src/models/openresponseswebsearchtool.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 510ab58460c2 */ import * as z from "zod/v4"; diff --git a/src/models/operations/createauthkeyscode.ts b/src/models/operations/createauthkeyscode.ts index 5dc902ac..5309dfd7 100644 --- a/src/models/operations/createauthkeyscode.ts +++ b/src/models/operations/createauthkeyscode.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1443f6afbf40 */ import * as z from "zod/v4"; diff --git a/src/models/operations/createcoinbasecharge.ts b/src/models/operations/createcoinbasecharge.ts index bab9d0e9..a16d5a04 100644 --- a/src/models/operations/createcoinbasecharge.ts +++ b/src/models/operations/createcoinbasecharge.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1e75ac2debf2 */ import * as z from "zod/v4"; diff --git a/src/models/operations/createembeddings.ts b/src/models/operations/createembeddings.ts index ceb5e6bf..fa8b7586 100644 --- a/src/models/operations/createembeddings.ts +++ b/src/models/operations/createembeddings.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7c210337fdff */ import * as z from "zod/v4"; diff --git a/src/models/operations/createkeys.ts b/src/models/operations/createkeys.ts index da22a19b..24aa7279 100644 --- a/src/models/operations/createkeys.ts +++ b/src/models/operations/createkeys.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e7a250c8b7bb */ import * as z from "zod/v4"; diff --git a/src/models/operations/createresponses.ts b/src/models/operations/createresponses.ts index 19fa18fb..5e74e0c6 100644 --- a/src/models/operations/createresponses.ts +++ b/src/models/operations/createresponses.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7ad611b27e9d */ import * as z from "zod/v4"; diff --git a/src/models/operations/deletekeys.ts b/src/models/operations/deletekeys.ts index 9fc5fc73..f939ec44 100644 --- a/src/models/operations/deletekeys.ts +++ b/src/models/operations/deletekeys.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: efa22339a3d6 */ import * as z from "zod/v4"; diff --git a/src/models/operations/exchangeauthcodeforapikey.ts b/src/models/operations/exchangeauthcodeforapikey.ts index 4b04707e..95540a83 100644 --- a/src/models/operations/exchangeauthcodeforapikey.ts +++ b/src/models/operations/exchangeauthcodeforapikey.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 440595fac2ad */ import * as z from "zod/v4"; diff --git a/src/models/operations/getcredits.ts b/src/models/operations/getcredits.ts index 6a9562ec..4fe313fe 100644 --- a/src/models/operations/getcredits.ts +++ b/src/models/operations/getcredits.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0e5a438307ae */ import * as z from "zod/v4"; diff --git a/src/models/operations/getcurrentkey.ts b/src/models/operations/getcurrentkey.ts index 9a1a8dab..2c7c2dc7 100644 --- a/src/models/operations/getcurrentkey.ts +++ b/src/models/operations/getcurrentkey.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ddb4fa558414 */ import * as z from "zod/v4"; diff --git a/src/models/operations/getgeneration.ts b/src/models/operations/getgeneration.ts index 30a163ee..98e74eb7 100644 --- a/src/models/operations/getgeneration.ts +++ b/src/models/operations/getgeneration.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5cdb2959d2a5 */ import * as z from "zod/v4"; diff --git a/src/models/operations/getkey.ts b/src/models/operations/getkey.ts index ecef0560..55d4f0f8 100644 --- a/src/models/operations/getkey.ts +++ b/src/models/operations/getkey.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 27d0f86c087f */ import * as z from "zod/v4"; diff --git a/src/models/operations/getmodels.ts b/src/models/operations/getmodels.ts index aa1233a7..97bb2f81 100644 --- a/src/models/operations/getmodels.ts +++ b/src/models/operations/getmodels.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f1343fbaaed5 */ import * as z from "zod/v4"; diff --git a/src/models/operations/getparameters.ts b/src/models/operations/getparameters.ts index 4a987678..8efe05fe 100644 --- a/src/models/operations/getparameters.ts +++ b/src/models/operations/getparameters.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9b364a4cca61 */ import * as z from "zod/v4"; diff --git a/src/models/operations/getuseractivity.ts b/src/models/operations/getuseractivity.ts index 6691a27a..fa427fbd 100644 --- a/src/models/operations/getuseractivity.ts +++ b/src/models/operations/getuseractivity.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 19535b4511a4 */ import * as z from "zod/v4"; diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 42e9912a..5293b341 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0d9ffaf774d2 */ export * from "./createauthkeyscode.js"; diff --git a/src/models/operations/list.ts b/src/models/operations/list.ts index 2d056b0e..64016f5b 100644 --- a/src/models/operations/list.ts +++ b/src/models/operations/list.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ce11386ad30f */ import * as z from "zod/v4"; diff --git a/src/models/operations/listendpoints.ts b/src/models/operations/listendpoints.ts index 5a2891de..de8fe54b 100644 --- a/src/models/operations/listendpoints.ts +++ b/src/models/operations/listendpoints.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 253a81bc10af */ import * as z from "zod/v4"; diff --git a/src/models/operations/listendpointszdr.ts b/src/models/operations/listendpointszdr.ts index 10c81042..9cbbeba4 100644 --- a/src/models/operations/listendpointszdr.ts +++ b/src/models/operations/listendpointszdr.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d52e6aeefb5e */ import * as z from "zod/v4"; diff --git a/src/models/operations/listmodelsuser.ts b/src/models/operations/listmodelsuser.ts index 53219054..c0201c38 100644 --- a/src/models/operations/listmodelsuser.ts +++ b/src/models/operations/listmodelsuser.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0846aac6be02 */ import * as z from "zod/v4"; diff --git a/src/models/operations/listproviders.ts b/src/models/operations/listproviders.ts index 93c7f3be..45baf6eb 100644 --- a/src/models/operations/listproviders.ts +++ b/src/models/operations/listproviders.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 76a35169de06 */ import * as z from "zod/v4"; diff --git a/src/models/operations/sendchatcompletionrequest.ts b/src/models/operations/sendchatcompletionrequest.ts index c14e884c..80091bf5 100644 --- a/src/models/operations/sendchatcompletionrequest.ts +++ b/src/models/operations/sendchatcompletionrequest.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 52a55a780d2d */ import * as z from "zod/v4"; diff --git a/src/models/operations/updatekeys.ts b/src/models/operations/updatekeys.ts index 61095dfa..2cfcfae8 100644 --- a/src/models/operations/updatekeys.ts +++ b/src/models/operations/updatekeys.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 30a0942aa2b9 */ import * as z from "zod/v4"; diff --git a/src/models/outputitemimagegenerationcall.ts b/src/models/outputitemimagegenerationcall.ts index 266766d3..1a292f67 100644 --- a/src/models/outputitemimagegenerationcall.ts +++ b/src/models/outputitemimagegenerationcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9c3ac6a7a9ad */ import * as z from "zod/v4"; diff --git a/src/models/outputmessage.ts b/src/models/outputmessage.ts index 4f63fed3..76b98b2c 100644 --- a/src/models/outputmessage.ts +++ b/src/models/outputmessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fa128cf87d51 */ import * as z from "zod/v4"; diff --git a/src/models/outputmodality.ts b/src/models/outputmodality.ts index 29f6c937..fa199361 100644 --- a/src/models/outputmodality.ts +++ b/src/models/outputmodality.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6b2d2af692c7 */ import * as z from "zod/v4"; diff --git a/src/models/parameter.ts b/src/models/parameter.ts index 51cddbfd..df6c3118 100644 --- a/src/models/parameter.ts +++ b/src/models/parameter.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 066287ded212 */ import * as z from "zod/v4"; diff --git a/src/models/payloadtoolargeresponseerrordata.ts b/src/models/payloadtoolargeresponseerrordata.ts index 2638b539..7be78556 100644 --- a/src/models/payloadtoolargeresponseerrordata.ts +++ b/src/models/payloadtoolargeresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 59c2c424ea9b */ import * as z from "zod/v4"; diff --git a/src/models/paymentrequiredresponseerrordata.ts b/src/models/paymentrequiredresponseerrordata.ts index 1ea9f353..e11a0a71 100644 --- a/src/models/paymentrequiredresponseerrordata.ts +++ b/src/models/paymentrequiredresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b38a7e0e1166 */ import * as z from "zod/v4"; diff --git a/src/models/pdfparserengine.ts b/src/models/pdfparserengine.ts index 2d7b48ee..dcbfbed0 100644 --- a/src/models/pdfparserengine.ts +++ b/src/models/pdfparserengine.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3c0c5ac60652 */ import * as z from "zod/v4"; diff --git a/src/models/pdfparseroptions.ts b/src/models/pdfparseroptions.ts index f68c84b8..d32dc10b 100644 --- a/src/models/pdfparseroptions.ts +++ b/src/models/pdfparseroptions.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 704f51d4a5f7 */ import * as z from "zod/v4"; diff --git a/src/models/perrequestlimits.ts b/src/models/perrequestlimits.ts index d7ebb6ce..a5bfb5dc 100644 --- a/src/models/perrequestlimits.ts +++ b/src/models/perrequestlimits.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2b2b6cf6a019 */ import * as z from "zod/v4"; diff --git a/src/models/providername.ts b/src/models/providername.ts index 0999cb10..db7996c0 100644 --- a/src/models/providername.ts +++ b/src/models/providername.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 89e536fb023a */ import * as z from "zod/v4"; diff --git a/src/models/provideroverloadedresponseerrordata.ts b/src/models/provideroverloadedresponseerrordata.ts index a76b7f36..a4299469 100644 --- a/src/models/provideroverloadedresponseerrordata.ts +++ b/src/models/provideroverloadedresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 379f1256314f */ import * as z from "zod/v4"; diff --git a/src/models/providerpreferences.ts b/src/models/providerpreferences.ts index b58a7cfa..d783498d 100644 --- a/src/models/providerpreferences.ts +++ b/src/models/providerpreferences.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3a47295d7b91 */ import * as z from "zod/v4"; diff --git a/src/models/providersort.ts b/src/models/providersort.ts index 763d4a5f..2d28a616 100644 --- a/src/models/providersort.ts +++ b/src/models/providersort.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7d1e919d1ec3 */ import * as z from "zod/v4"; diff --git a/src/models/providersortconfig.ts b/src/models/providersortconfig.ts index 978c094c..56f70b24 100644 --- a/src/models/providersortconfig.ts +++ b/src/models/providersortconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1491329aae16 */ import * as z from "zod/v4"; diff --git a/src/models/providersortunion.ts b/src/models/providersortunion.ts index 461955ca..ab212a4c 100644 --- a/src/models/providersortunion.ts +++ b/src/models/providersortunion.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7a2d23baab80 */ import * as z from "zod/v4"; diff --git a/src/models/publicendpoint.ts b/src/models/publicendpoint.ts index 4580d344..23f47a30 100644 --- a/src/models/publicendpoint.ts +++ b/src/models/publicendpoint.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 396ce3186017 */ import * as z from "zod/v4"; diff --git a/src/models/publicpricing.ts b/src/models/publicpricing.ts index 22d325a4..7b271af0 100644 --- a/src/models/publicpricing.ts +++ b/src/models/publicpricing.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0a44a1c3bab5 */ import * as z from "zod/v4"; diff --git a/src/models/quantization.ts b/src/models/quantization.ts index ba97cd53..55082b7e 100644 --- a/src/models/quantization.ts +++ b/src/models/quantization.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b28328f1822c */ import * as z from "zod/v4"; diff --git a/src/models/reasoningsummarytext.ts b/src/models/reasoningsummarytext.ts index a00f7331..b9720f51 100644 --- a/src/models/reasoningsummarytext.ts +++ b/src/models/reasoningsummarytext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9c06c18de6d6 */ import * as z from "zod/v4"; diff --git a/src/models/reasoningsummaryverbosity.ts b/src/models/reasoningsummaryverbosity.ts index 8b95035c..58291795 100644 --- a/src/models/reasoningsummaryverbosity.ts +++ b/src/models/reasoningsummaryverbosity.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a51c85f04729 */ import * as z from "zod/v4"; diff --git a/src/models/reasoningtextcontent.ts b/src/models/reasoningtextcontent.ts index 5347eb07..10912a90 100644 --- a/src/models/reasoningtextcontent.ts +++ b/src/models/reasoningtextcontent.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e5520210e3cb */ import * as z from "zod/v4"; diff --git a/src/models/requesttimeoutresponseerrordata.ts b/src/models/requesttimeoutresponseerrordata.ts index 49b6fa93..c9eac87a 100644 --- a/src/models/requesttimeoutresponseerrordata.ts +++ b/src/models/requesttimeoutresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a08eeff8786c */ import * as z from "zod/v4"; diff --git a/src/models/responseformatjsonschema.ts b/src/models/responseformatjsonschema.ts index 3fe19d90..cb2913fd 100644 --- a/src/models/responseformatjsonschema.ts +++ b/src/models/responseformatjsonschema.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ff0b42f802dc */ import * as z from "zod/v4"; diff --git a/src/models/responseformattextconfig.ts b/src/models/responseformattextconfig.ts index 1deaf3cf..09480e22 100644 --- a/src/models/responseformattextconfig.ts +++ b/src/models/responseformattextconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4408142ee314 */ import * as z from "zod/v4"; diff --git a/src/models/responseformattextgrammar.ts b/src/models/responseformattextgrammar.ts index 0743dfdb..407bdc01 100644 --- a/src/models/responseformattextgrammar.ts +++ b/src/models/responseformattextgrammar.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5bc0a32fad4c */ import * as z from "zod/v4"; diff --git a/src/models/responseinputaudio.ts b/src/models/responseinputaudio.ts index da7b24b1..9201796d 100644 --- a/src/models/responseinputaudio.ts +++ b/src/models/responseinputaudio.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 259dfb8718b4 */ import * as z from "zod/v4"; diff --git a/src/models/responseinputfile.ts b/src/models/responseinputfile.ts index 8f59ccd2..1d2aefa1 100644 --- a/src/models/responseinputfile.ts +++ b/src/models/responseinputfile.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f449677cc221 */ import * as z from "zod/v4"; diff --git a/src/models/responseinputimage.ts b/src/models/responseinputimage.ts index 1e26f22b..44c63262 100644 --- a/src/models/responseinputimage.ts +++ b/src/models/responseinputimage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9c7a50d121df */ import * as z from "zod/v4"; diff --git a/src/models/responseinputtext.ts b/src/models/responseinputtext.ts index 56f8bb7a..5b8f3dec 100644 --- a/src/models/responseinputtext.ts +++ b/src/models/responseinputtext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 841523070a3c */ import * as z from "zod/v4"; diff --git a/src/models/responseoutputtext.ts b/src/models/responseoutputtext.ts index 6b6f99bb..5028e794 100644 --- a/src/models/responseoutputtext.ts +++ b/src/models/responseoutputtext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2d5e61e53c46 */ import * as z from "zod/v4"; diff --git a/src/models/responseserrorfield.ts b/src/models/responseserrorfield.ts index 1c81b4b9..9672f19f 100644 --- a/src/models/responseserrorfield.ts +++ b/src/models/responseserrorfield.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 830ea3d3b590 */ import * as z from "zod/v4"; diff --git a/src/models/responsesformatjsonobject.ts b/src/models/responsesformatjsonobject.ts index a13fdf60..8da5d102 100644 --- a/src/models/responsesformatjsonobject.ts +++ b/src/models/responsesformatjsonobject.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cd67052e598c */ import * as z from "zod/v4"; diff --git a/src/models/responsesformattext.ts b/src/models/responsesformattext.ts index 3e45270a..ae37ccd5 100644 --- a/src/models/responsesformattext.ts +++ b/src/models/responsesformattext.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 30c4a4421b1d */ import * as z from "zod/v4"; diff --git a/src/models/responsesformattextjsonschemaconfig.ts b/src/models/responsesformattextjsonschemaconfig.ts index e5c98a85..c4101884 100644 --- a/src/models/responsesformattextjsonschemaconfig.ts +++ b/src/models/responsesformattextjsonschemaconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 631c61a1b658 */ import * as z from "zod/v4"; diff --git a/src/models/responsesimagegenerationcall.ts b/src/models/responsesimagegenerationcall.ts index d3daf416..c27555dd 100644 --- a/src/models/responsesimagegenerationcall.ts +++ b/src/models/responsesimagegenerationcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 51f0104f0dbf */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputitem.ts b/src/models/responsesoutputitem.ts index 3ae6f029..796f37fd 100644 --- a/src/models/responsesoutputitem.ts +++ b/src/models/responsesoutputitem.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4e7df3e415cd */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputitemfilesearchcall.ts b/src/models/responsesoutputitemfilesearchcall.ts index 86c6b0b2..740c6fec 100644 --- a/src/models/responsesoutputitemfilesearchcall.ts +++ b/src/models/responsesoutputitemfilesearchcall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e5ac80adf28b */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputitemfunctioncall.ts b/src/models/responsesoutputitemfunctioncall.ts index d870232c..4b2a84ba 100644 --- a/src/models/responsesoutputitemfunctioncall.ts +++ b/src/models/responsesoutputitemfunctioncall.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ff553c6d83b4 */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputitemreasoning.ts b/src/models/responsesoutputitemreasoning.ts index 4a046785..60b06c0e 100644 --- a/src/models/responsesoutputitemreasoning.ts +++ b/src/models/responsesoutputitemreasoning.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 191f7f61ea84 */ import * as z from "zod/v4"; diff --git a/src/models/responsesoutputmessage.ts b/src/models/responsesoutputmessage.ts index 154a30fb..dc3999ba 100644 --- a/src/models/responsesoutputmessage.ts +++ b/src/models/responsesoutputmessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 32cb33488ea2 */ import * as z from "zod/v4"; diff --git a/src/models/responsessearchcontextsize.ts b/src/models/responsessearchcontextsize.ts index 5bb9e554..cd259586 100644 --- a/src/models/responsessearchcontextsize.ts +++ b/src/models/responsessearchcontextsize.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3c1dd9e04db4 */ import * as z from "zod/v4"; diff --git a/src/models/responseswebsearchcalloutput.ts b/src/models/responseswebsearchcalloutput.ts index e7a4b3ee..8858d5bb 100644 --- a/src/models/responseswebsearchcalloutput.ts +++ b/src/models/responseswebsearchcalloutput.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c1c0ab68e92c */ import * as z from "zod/v4"; diff --git a/src/models/responseswebsearchuserlocation.ts b/src/models/responseswebsearchuserlocation.ts index ffe619c4..036cdd23 100644 --- a/src/models/responseswebsearchuserlocation.ts +++ b/src/models/responseswebsearchuserlocation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 08377a5f88b1 */ import * as z from "zod/v4"; diff --git a/src/models/responsetextconfig.ts b/src/models/responsetextconfig.ts index e36ea294..ad0047e3 100644 --- a/src/models/responsetextconfig.ts +++ b/src/models/responsetextconfig.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0f516033ff9c */ import * as z from "zod/v4"; diff --git a/src/models/schema0.ts b/src/models/schema0.ts index 7d8a4383..b2669445 100644 --- a/src/models/schema0.ts +++ b/src/models/schema0.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 14bff3bd8497 */ import * as z from "zod/v4"; diff --git a/src/models/schema3.ts b/src/models/schema3.ts index 4c60f355..366ab7b1 100644 --- a/src/models/schema3.ts +++ b/src/models/schema3.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6f7380bcbcea */ import * as z from "zod/v4"; diff --git a/src/models/security.ts b/src/models/security.ts index 9a9e7534..af44b3ab 100644 --- a/src/models/security.ts +++ b/src/models/security.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d90c6c784ca5 */ import * as z from "zod/v4"; diff --git a/src/models/serviceunavailableresponseerrordata.ts b/src/models/serviceunavailableresponseerrordata.ts index 5468d207..f6242052 100644 --- a/src/models/serviceunavailableresponseerrordata.ts +++ b/src/models/serviceunavailableresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 842927f7dc14 */ import * as z from "zod/v4"; diff --git a/src/models/systemmessage.ts b/src/models/systemmessage.ts index 8a634d7e..68f3666f 100644 --- a/src/models/systemmessage.ts +++ b/src/models/systemmessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2a179ca48627 */ import * as z from "zod/v4"; diff --git a/src/models/toolcallstatus.ts b/src/models/toolcallstatus.ts index 79485fd7..1585e3f9 100644 --- a/src/models/toolcallstatus.ts +++ b/src/models/toolcallstatus.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 54eb9c06bedb */ import * as z from "zod/v4"; diff --git a/src/models/tooldefinitionjson.ts b/src/models/tooldefinitionjson.ts index 52240c6c..8456579f 100644 --- a/src/models/tooldefinitionjson.ts +++ b/src/models/tooldefinitionjson.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 546c340f3013 */ import * as z from "zod/v4"; diff --git a/src/models/toolresponsemessage.ts b/src/models/toolresponsemessage.ts index 31c998ba..1cadd683 100644 --- a/src/models/toolresponsemessage.ts +++ b/src/models/toolresponsemessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 1122bbfb530b */ import * as z from "zod/v4"; diff --git a/src/models/toomanyrequestsresponseerrordata.ts b/src/models/toomanyrequestsresponseerrordata.ts index d2b2c10e..5b47d772 100644 --- a/src/models/toomanyrequestsresponseerrordata.ts +++ b/src/models/toomanyrequestsresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ff9492357bd9 */ import * as z from "zod/v4"; diff --git a/src/models/topproviderinfo.ts b/src/models/topproviderinfo.ts index c1cf18b1..c95a2f12 100644 --- a/src/models/topproviderinfo.ts +++ b/src/models/topproviderinfo.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7439c7b1a9c6 */ import * as z from "zod/v4"; diff --git a/src/models/unauthorizedresponseerrordata.ts b/src/models/unauthorizedresponseerrordata.ts index a5d3f69b..3b24025f 100644 --- a/src/models/unauthorizedresponseerrordata.ts +++ b/src/models/unauthorizedresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d335c48e0c3e */ import * as z from "zod/v4"; diff --git a/src/models/unprocessableentityresponseerrordata.ts b/src/models/unprocessableentityresponseerrordata.ts index 48619818..0c68c696 100644 --- a/src/models/unprocessableentityresponseerrordata.ts +++ b/src/models/unprocessableentityresponseerrordata.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 557063315301 */ import * as z from "zod/v4"; diff --git a/src/models/urlcitation.ts b/src/models/urlcitation.ts index 69471973..4d03e2fd 100644 --- a/src/models/urlcitation.ts +++ b/src/models/urlcitation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ccd6ecd62c64 */ import * as z from "zod/v4"; diff --git a/src/models/usermessage.ts b/src/models/usermessage.ts index 9cfcc7ae..ec761e7f 100644 --- a/src/models/usermessage.ts +++ b/src/models/usermessage.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e34f73b285e1 */ import * as z from "zod/v4"; diff --git a/src/models/websearchengine.ts b/src/models/websearchengine.ts index f486570b..5d8c6ef9 100644 --- a/src/models/websearchengine.ts +++ b/src/models/websearchengine.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 49b0152fd59a */ import * as z from "zod/v4"; diff --git a/src/models/websearchpreviewtooluserlocation.ts b/src/models/websearchpreviewtooluserlocation.ts index 8c162ac5..38b0d83f 100644 --- a/src/models/websearchpreviewtooluserlocation.ts +++ b/src/models/websearchpreviewtooluserlocation.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cb1960e09942 */ import * as z from "zod/v4"; diff --git a/src/models/websearchstatus.ts b/src/models/websearchstatus.ts index ac6dbc70..3243a6ae 100644 --- a/src/models/websearchstatus.ts +++ b/src/models/websearchstatus.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 55795920a937 */ import * as z from "zod/v4"; diff --git a/src/sdk/analytics.ts b/src/sdk/analytics.ts index ea966006..41f17bc8 100644 --- a/src/sdk/analytics.ts +++ b/src/sdk/analytics.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 411d91261be3 */ import { analyticsGetUserActivity } from "../funcs/analyticsGetUserActivity.js"; diff --git a/src/sdk/apikeys.ts b/src/sdk/apikeys.ts index 38a955a8..87017a4d 100644 --- a/src/sdk/apikeys.ts +++ b/src/sdk/apikeys.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5dda931501e1 */ import { apiKeysCreate } from "../funcs/apiKeysCreate.js"; diff --git a/src/sdk/beta.ts b/src/sdk/beta.ts index 69bee63f..0fe9a46a 100644 --- a/src/sdk/beta.ts +++ b/src/sdk/beta.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: afeac65e28f8 */ import { ClientSDK } from "../lib/sdks.js"; diff --git a/src/sdk/chat.ts b/src/sdk/chat.ts index d1a2aeac..fe7bba6e 100644 --- a/src/sdk/chat.ts +++ b/src/sdk/chat.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c56babc22a20 */ import { chatSend } from "../funcs/chatSend.js"; diff --git a/src/sdk/completions.ts b/src/sdk/completions.ts index 3c79bd7f..ac2caf3a 100644 --- a/src/sdk/completions.ts +++ b/src/sdk/completions.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b452d35d53b4 */ import { completionsGenerate } from "../funcs/completionsGenerate.js"; diff --git a/src/sdk/credits.ts b/src/sdk/credits.ts index c8035fff..9c43c6dd 100644 --- a/src/sdk/credits.ts +++ b/src/sdk/credits.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: c72074b5f165 */ import { creditsCreateCoinbaseCharge } from "../funcs/creditsCreateCoinbaseCharge.js"; diff --git a/src/sdk/embeddings.ts b/src/sdk/embeddings.ts index 45313d01..1607646a 100644 --- a/src/sdk/embeddings.ts +++ b/src/sdk/embeddings.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 70cbb18bedaf */ import { embeddingsGenerate } from "../funcs/embeddingsGenerate.js"; diff --git a/src/sdk/endpoints.ts b/src/sdk/endpoints.ts index cd981d50..1951a884 100644 --- a/src/sdk/endpoints.ts +++ b/src/sdk/endpoints.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f159be23d878 */ import { endpointsList } from "../funcs/endpointsList.js"; diff --git a/src/sdk/generations.ts b/src/sdk/generations.ts index c2eb0a0b..ebd85c57 100644 --- a/src/sdk/generations.ts +++ b/src/sdk/generations.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e28b205da063 */ import { generationsGetGeneration } from "../funcs/generationsGetGeneration.js"; diff --git a/src/sdk/index.ts b/src/sdk/index.ts index ecac2264..5c82fe38 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a857902a703f */ export * from "./sdk.js"; diff --git a/src/sdk/models.ts b/src/sdk/models.ts index 7fd2396d..bb38b404 100644 --- a/src/sdk/models.ts +++ b/src/sdk/models.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8c761ab180fd */ import { modelsCount } from "../funcs/modelsCount.js"; diff --git a/src/sdk/oauth.ts b/src/sdk/oauth.ts index 1cae78b7..12f35868 100644 --- a/src/sdk/oauth.ts +++ b/src/sdk/oauth.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 37b7f9b2970b */ import { oAuthCreateAuthCode } from "../funcs/oAuthCreateAuthCode.js"; diff --git a/src/sdk/parameters.ts b/src/sdk/parameters.ts index 5279660e..f6e0e933 100644 --- a/src/sdk/parameters.ts +++ b/src/sdk/parameters.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6e4ef00c29b7 */ import { parametersGetParameters } from "../funcs/parametersGetParameters.js"; diff --git a/src/sdk/providers.ts b/src/sdk/providers.ts index f57c3987..dc6908e0 100644 --- a/src/sdk/providers.ts +++ b/src/sdk/providers.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fb8faa7013d0 */ import { providersList } from "../funcs/providersList.js"; diff --git a/src/sdk/responses.ts b/src/sdk/responses.ts index a906114b..fc8f29b9 100644 --- a/src/sdk/responses.ts +++ b/src/sdk/responses.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fc4b535757c5 */ import { betaResponsesSend } from "../funcs/betaResponsesSend.js"; diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index fbaf5fd5..dd293732 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 784571af2f69 */ import { ClientSDK } from "../lib/sdks.js"; @@ -17,12 +18,14 @@ import { OAuth } from "./oauth.js"; import { ParametersT } from "./parameters.js"; import { Providers } from "./providers.js"; // #region imports -import { callModel as callModelFunc } from "../funcs/callModel.js"; -import type { ResponseWrapper } from "../lib/response-wrapper.js"; +import { + callModel as callModelFunc, +} from "../funcs/call-model.js"; +import type { ModelResult } from "../lib/model-result.js"; import type { RequestOptions } from "../lib/sdks.js"; import { type MaxToolRounds, Tool, ToolType } from "../lib/tool-types.js"; -import type { OpenResponsesInput } from "../models/openresponsesinput.js"; import type { OpenResponsesRequest } from "../models/openresponsesrequest.js"; +import type { OpenResponsesInput } from "../models/openresponsesinput.js"; export { ToolType }; export type { MaxToolRounds }; @@ -102,7 +105,7 @@ export class OpenRouter extends ClientSDK { maxToolRounds?: MaxToolRounds; }, options?: RequestOptions, - ): ResponseWrapper { + ): ModelResult { return callModelFunc(this, request, options); } // #endregion sdk-class-body diff --git a/src/types/async.ts b/src/types/async.ts index 689dba5d..634e549a 100644 --- a/src/types/async.ts +++ b/src/types/async.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: fac8da972f86 */ export type APICall = diff --git a/src/types/blobs.ts b/src/types/blobs.ts index babb51ee..6986071c 100644 --- a/src/types/blobs.ts +++ b/src/types/blobs.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f8ab9b326c86 */ import * as z from "zod/v4"; diff --git a/src/types/constdatetime.ts b/src/types/constdatetime.ts index 2a21bec6..6e667b0e 100644 --- a/src/types/constdatetime.ts +++ b/src/types/constdatetime.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0f7b6f513917 */ import * as z from "zod/v4"; diff --git a/src/types/discriminatedUnion.ts b/src/types/discriminatedUnion.ts index d8774298..3527dc38 100644 --- a/src/types/discriminatedUnion.ts +++ b/src/types/discriminatedUnion.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 44cf2d277540 */ import * as z from "zod/v4"; diff --git a/src/types/enums.ts b/src/types/enums.ts index 12f862a1..f13dbd9e 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 4d03ddfe5100 */ import * as z from "zod/v4"; diff --git a/src/types/fp.ts b/src/types/fp.ts index ccbe51ea..7d4f9f13 100644 --- a/src/types/fp.ts +++ b/src/types/fp.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ae9f0fb8aab6 */ /** diff --git a/src/types/index.ts b/src/types/index.ts index abf0b7ab..dfb23ead 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: cd7a0a5ed005 */ export { blobLikeSchema, isBlobLike } from "./blobs.js"; diff --git a/src/types/operations.ts b/src/types/operations.ts index beb81e10..a1c2b38e 100644 --- a/src/types/operations.ts +++ b/src/types/operations.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 314da01dca47 */ import { Result } from "./fp.js"; diff --git a/src/types/rfcdate.ts b/src/types/rfcdate.ts index c79b3f53..05a12a9e 100644 --- a/src/types/rfcdate.ts +++ b/src/types/rfcdate.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9eb64906dcd6 */ const dateRE = /^\d{4}-\d{2}-\d{2}$/; diff --git a/src/types/streams.ts b/src/types/streams.ts index a0163e7a..88c11154 100644 --- a/src/types/streams.ts +++ b/src/types/streams.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: f99be9c4bf14 */ export function isReadableStream( diff --git a/src/types/unrecognized.ts b/src/types/unrecognized.ts index b7a2a13f..4ccb9fff 100644 --- a/src/types/unrecognized.ts +++ b/src/types/unrecognized.ts @@ -1,5 +1,6 @@ /* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 476605c40716 */ declare const __brand: unique symbol; diff --git a/tests/e2e/callModel-tools.test.ts b/tests/e2e/call-model-tools.test.ts similarity index 98% rename from tests/e2e/callModel-tools.test.ts rename to tests/e2e/call-model-tools.test.ts index 68a08310..40f487d6 100644 --- a/tests/e2e/callModel-tools.test.ts +++ b/tests/e2e/call-model-tools.test.ts @@ -1,7 +1,7 @@ import * as dotenv from 'dotenv'; import { beforeAll, describe, expect, it } from 'vitest'; import { toJSONSchema, z } from 'zod/v4'; -import { OpenRouter, ToolType } from '../../src/index.js'; +import { OpenRouter, ToolType, toChatMessage } from '../../src/index.js'; dotenv.config(); @@ -589,7 +589,8 @@ describe('Enhanced Tool Support for callModel', () => { ], }); - const message = await response.getMessage(); + const fullResponse = await response.getResponse(); + const message = toChatMessage(fullResponse); expect(message).toBeDefined(); }, 30000); @@ -638,7 +639,8 @@ describe('Enhanced Tool Support for callModel', () => { }, ); - const finalMessage = await response.getMessage(); + const fullResponse = await response.getResponse(); + const finalMessage = toChatMessage(fullResponse); expect(finalMessage).toBeDefined(); expect(finalMessage.content).toBeTruthy(); }, 30000); diff --git a/tests/e2e/callModel.test.ts b/tests/e2e/call-model.test.ts similarity index 81% rename from tests/e2e/callModel.test.ts rename to tests/e2e/call-model.test.ts index 6cc2c532..f3349c88 100644 --- a/tests/e2e/callModel.test.ts +++ b/tests/e2e/call-model.test.ts @@ -1,10 +1,12 @@ import type { ChatStreamEvent, EnhancedResponseStreamEvent } from '../../src/lib/tool-types.js'; -import type { AssistantMessage } from '../../src/models/assistantmessage.js'; -import type { ToolResponseMessage } from '../../src/models/toolresponsemessage.js'; +import type { ClaudeMessageParam } from '../../src/models/claude-message.js'; +import type { ResponsesOutputMessage } from '../../src/models/responsesoutputmessage.js'; +import type { OpenResponsesFunctionCallOutput } from '../../src/models/openresponsesfunctioncalloutput.js'; import { beforeAll, describe, expect, it } from 'vitest'; import { z } from 'zod/v4'; import { OpenRouter, ToolType } from '../../src/sdk/sdk.js'; +import { toChatMessage } from '../../src/lib/chat-compat.js'; import { OpenResponsesNonStreamingResponse } from '../../src/models/openresponsesnonstreamingresponse.js'; import { OpenResponsesStreamEvent } from '../../src/models/openresponsesstreamevent.js'; @@ -176,6 +178,108 @@ describe('callModel E2E Tests', () => { }, 30000); }); + describe('Claude-style messages support', () => { + it('should accept Claude-style MessageParam array with string content', async () => { + const claudeMessages: ClaudeMessageParam[] = [ + { + role: 'user', + content: "Say 'claude test' and nothing else.", + }, + ]; + + const response = client.callModel({ + model: 'meta-llama/llama-3.2-1b-instruct', + input: claudeMessages, + }); + + const text = await response.getText(); + + expect(text).toBeDefined(); + expect(typeof text).toBe('string'); + expect(text.length).toBeGreaterThan(0); + }); + + it('should handle Claude-style messages with content blocks array', async () => { + const claudeMessages: ClaudeMessageParam[] = [ + { + role: 'user', + content: [ + { + type: 'text', + text: "Say 'hello from blocks' and nothing else.", + }, + ], + }, + ]; + + const response = client.callModel({ + model: 'meta-llama/llama-3.2-1b-instruct', + input: claudeMessages, + }); + + const text = await response.getText(); + + expect(text).toBeDefined(); + expect(typeof text).toBe('string'); + expect(text.length).toBeGreaterThan(0); + }); + + it('should handle multi-turn Claude-style conversation', async () => { + const claudeMessages: ClaudeMessageParam[] = [ + { + role: 'user', + content: 'My name is Alice.', + }, + { + role: 'assistant', + content: "Nice to meet you, Alice! How can I help you today?", + }, + { + role: 'user', + content: 'What is my name?', + }, + ]; + + const response = client.callModel({ + model: 'meta-llama/llama-3.2-1b-instruct', + input: claudeMessages, + }); + + const text = await response.getText(); + + expect(text).toBeDefined(); + expect(text.toLowerCase()).toContain('alice'); + }); + + it('should handle Claude-style messages with multiple text blocks', async () => { + const claudeMessages: ClaudeMessageParam[] = [ + { + role: 'user', + content: [ + { + type: 'text', + text: 'Hello!', + }, + { + type: 'text', + text: " What's 2+2?", + }, + ], + }, + ]; + + const response = client.callModel({ + model: 'meta-llama/llama-3.2-1b-instruct', + input: claudeMessages, + }); + + const text = await response.getText(); + + expect(text).toBeDefined(); + expect(typeof text).toBe('string'); + }); + }); + describe('response.text - Text extraction', () => { it('should successfully get text from a response', async () => { const response = client.callModel({ @@ -234,7 +338,8 @@ describe('callModel E2E Tests', () => { ], }); - const message = await response.getMessage(); + const fullResponse = await response.getResponse(); + const message = toChatMessage(fullResponse); expect(message).toBeDefined(); expect(message.role).toBe('assistant'); @@ -267,7 +372,8 @@ describe('callModel E2E Tests', () => { ], }); - const message = await response.getMessage(); + const fullResponse = await response.getResponse(); + const message = toChatMessage(fullResponse); // Ensure the message fully matches the OpenAI Chat API assistant message shape expect(message).toMatchObject({ @@ -375,8 +481,8 @@ describe('callModel E2E Tests', () => { }, 15000); }); - describe('response.newMessagesStream - Streaming message updates', () => { - it('should successfully stream incremental message updates', async () => { + describe('response.newMessagesStream - Streaming message updates (Responses format)', () => { + it('should successfully stream incremental message updates in ResponsesOutputMessage format', async () => { const response = client.callModel({ model: 'meta-llama/llama-3.2-1b-instruct', input: [ @@ -387,12 +493,11 @@ describe('callModel E2E Tests', () => { ], }); - const messages: (AssistantMessage | ToolResponseMessage)[] = []; + const messages: (ResponsesOutputMessage | OpenResponsesFunctionCallOutput)[] = []; for await (const message of response.getNewMessagesStream()) { expect(message).toBeDefined(); - expect(message.role).toBe('assistant'); - expect(typeof message.content).toBe('string'); + expect(message.type).toBe('message'); messages.push(message); } @@ -400,17 +505,25 @@ describe('callModel E2E Tests', () => { // Verify content grows over time if (messages.length > 1) { - const firstMessage = messages[0]; - const lastMessage = messages[messages.length - 1]; + const firstMessage = messages[0] as ResponsesOutputMessage; + const lastMessage = messages[messages.length - 1] as ResponsesOutputMessage; - const firstText = (firstMessage.content as string) || ''; - const lastText = (lastMessage.content as string) || ''; + // Extract text from content array + const getTextFromContent = (msg: ResponsesOutputMessage) => { + return msg.content + .filter((c): c is { type: 'output_text'; text: string } => 'type' in c && c.type === 'output_text') + .map((c) => c.text) + .join(''); + }; + + const firstText = getTextFromContent(firstMessage); + const lastText = getTextFromContent(lastMessage); expect(lastText.length).toBeGreaterThanOrEqual(firstText.length); } }, 15000); - it('should return AssistantMessages with correct shape', async () => { + it('should return ResponsesOutputMessage with correct shape', async () => { const response = client.callModel({ model: 'meta-llama/llama-3.2-1b-instruct', input: [ @@ -421,62 +534,45 @@ describe('callModel E2E Tests', () => { ], }); - const messages: (AssistantMessage | ToolResponseMessage)[] = []; + const messages: (ResponsesOutputMessage | OpenResponsesFunctionCallOutput)[] = []; for await (const message of response.getNewMessagesStream()) { messages.push(message); - // Deep validation of AssistantMessage shape - expect(message).toHaveProperty('role'); - expect(message).toHaveProperty('content'); - - if (message.role === 'assistant') { - // Validate AssistantMessage structure - expect(message.role).toBe('assistant'); - - // content must be string, array, null, or undefined - const contentType = typeof message.content; - const isValidContent = - contentType === 'string' || - Array.isArray(message.content) || - message.content === null || - message.content === undefined; - expect(isValidContent).toBe(true); - - // If content is an array, each item must have a type - if (Array.isArray(message.content)) { - for (const item of message.content) { - expect(item).toHaveProperty('type'); - expect(typeof item.type).toBe('string'); - } + if (message.type === 'message') { + const outputMessage = message as ResponsesOutputMessage; + + // Validate ResponsesOutputMessage structure + expect(outputMessage.type).toBe('message'); + expect(outputMessage.role).toBe('assistant'); + expect(outputMessage.id).toBeDefined(); + expect(typeof outputMessage.id).toBe('string'); + expect(Array.isArray(outputMessage.content)).toBe(true); + + // Validate content array items + for (const item of outputMessage.content) { + expect(item).toHaveProperty('type'); + expect(typeof item.type).toBe('string'); + // Content items should be output_text or refusal + expect(['output_text', 'refusal']).toContain(item.type); } - // If toolCalls present, validate their shape - if ('toolCalls' in message && message.toolCalls) { - expect(Array.isArray(message.toolCalls)).toBe(true); - for (const toolCall of message.toolCalls) { - expect(toolCall).toHaveProperty('id'); - expect(toolCall).toHaveProperty('type'); - expect(toolCall).toHaveProperty('function'); - expect(typeof toolCall.id).toBe('string'); - expect(typeof toolCall.type).toBe('string'); - expect(toolCall.function).toHaveProperty('name'); - expect(toolCall.function).toHaveProperty('arguments'); - expect(typeof toolCall.function.name).toBe('string'); - expect(typeof toolCall.function.arguments).toBe('string'); - } + // Validate optional status field + if (outputMessage.status !== undefined) { + expect(['completed', 'incomplete', 'in_progress']).toContain(outputMessage.status); } } } expect(messages.length).toBeGreaterThan(0); - // Verify last message has the complete assistant response shape - const lastMessage = messages[messages.length - 1]; + // Verify last message has the complete ResponsesOutputMessage shape + const lastMessage = messages[messages.length - 1] as ResponsesOutputMessage; + expect(lastMessage.type).toBe('message'); expect(lastMessage.role).toBe('assistant'); }, 15000); - it('should include ToolResponseMessages with correct shape when tools are executed', async () => { + it('should include OpenResponsesFunctionCallOutput with correct shape when tools are executed', async () => { const response = client.callModel({ model: 'openai/gpt-4o-mini', input: [ @@ -509,44 +605,39 @@ describe('callModel E2E Tests', () => { ], }); - const messages: (AssistantMessage | ToolResponseMessage)[] = []; - let hasAssistantMessage = false; - let hasToolResponseMessage = false; + const messages: (ResponsesOutputMessage | OpenResponsesFunctionCallOutput)[] = []; + let hasOutputMessage = false; + let hasFunctionCallOutput = false; for await (const message of response.getNewMessagesStream()) { messages.push(message); - // Validate each message has correct shape based on role - expect(message).toHaveProperty('role'); - expect(message).toHaveProperty('content'); - - if (message.role === 'assistant') { - hasAssistantMessage = true; - - // Validate AssistantMessage shape - const contentType = typeof message.content; - const isValidContent = - contentType === 'string' || - Array.isArray(message.content) || - message.content === null || - message.content === undefined; - expect(isValidContent).toBe(true); - } else if (message.role === 'tool') { - hasToolResponseMessage = true; - - // Deep validation of ToolResponseMessage shape - expect(message).toHaveProperty('toolCallId'); - expect(typeof (message as ToolResponseMessage).toolCallId).toBe('string'); - expect((message as ToolResponseMessage).toolCallId.length).toBeGreaterThan(0); - - // content must be string or array - const contentType = typeof message.content; - const isValidContent = contentType === 'string' || Array.isArray(message.content); - expect(isValidContent).toBe(true); - - // If content is string, it should be parseable JSON (our tool result) - if (typeof message.content === 'string' && message.content.length > 0) { - const parsed = JSON.parse(message.content); + // Validate each message has correct shape based on type + expect(message).toHaveProperty('type'); + + if (message.type === 'message') { + hasOutputMessage = true; + const outputMessage = message as ResponsesOutputMessage; + + // Validate ResponsesOutputMessage shape + expect(outputMessage.role).toBe('assistant'); + expect(Array.isArray(outputMessage.content)).toBe(true); + } else if (message.type === 'function_call_output') { + hasFunctionCallOutput = true; + const fnOutput = message as OpenResponsesFunctionCallOutput; + + // Deep validation of OpenResponsesFunctionCallOutput shape + expect(fnOutput.type).toBe('function_call_output'); + expect(fnOutput).toHaveProperty('callId'); + expect(typeof fnOutput.callId).toBe('string'); + expect(fnOutput.callId.length).toBeGreaterThan(0); + + // output must be a string (JSON stringified result) + expect(typeof fnOutput.output).toBe('string'); + + // If output is non-empty, it should be parseable JSON (our tool result) + if (fnOutput.output.length > 0) { + const parsed = JSON.parse(fnOutput.output); expect(parsed).toBeDefined(); // Verify it matches our tool output schema expect(parsed).toHaveProperty('temperature'); @@ -558,23 +649,23 @@ describe('callModel E2E Tests', () => { } expect(messages.length).toBeGreaterThan(0); - // We must have tool responses since we have an executable tool - expect(hasToolResponseMessage).toBe(true); + // We must have function call outputs since we have an executable tool + expect(hasFunctionCallOutput).toBe(true); - // If the model provided a final text response, verify proper ordering - if (hasAssistantMessage) { - const lastToolIndex = messages.reduce( - (lastIdx, m, i) => (m.role === 'tool' ? i : lastIdx), + // If the model provided a final message, verify proper ordering + if (hasOutputMessage) { + const lastFnOutputIndex = messages.reduce( + (lastIdx, m, i) => (m.type === 'function_call_output' ? i : lastIdx), -1, ); - const lastAssistantIndex = messages.reduce( - (lastIdx, m, i) => (m.role === 'assistant' ? i : lastIdx), + const lastMessageIndex = messages.reduce( + (lastIdx, m, i) => (m.type === 'message' ? i : lastIdx), -1, ); - // The final assistant message should come after tool responses - if (lastToolIndex !== -1 && lastAssistantIndex !== -1) { - expect(lastAssistantIndex).toBeGreaterThan(lastToolIndex); + // The final message should come after function call outputs + if (lastFnOutputIndex !== -1 && lastMessageIndex !== -1) { + expect(lastMessageIndex).toBeGreaterThan(lastFnOutputIndex); } } }, 30000); @@ -591,38 +682,29 @@ describe('callModel E2E Tests', () => { }); for await (const message of response.getNewMessagesStream()) { - // role must be a string and one of the valid values - expect(typeof message.role).toBe('string'); - expect([ - 'assistant', - 'tool', - ]).toContain(message.role); - - // content must exist (even if null) - expect('content' in message).toBe(true); - - if (message.role === 'assistant') { - // AssistantMessage specific validations - const validContentTypes = [ - 'string', - 'object', - 'undefined', - ]; - expect(validContentTypes).toContain(typeof message.content); - - // If content is array, validate structure - if (Array.isArray(message.content)) { - expect( - message.content.every( - (item) => typeof item === 'object' && item !== null && 'type' in item, - ), - ).toBe(true); + // type must be a string and one of the valid values + expect(typeof message.type).toBe('string'); + expect(['message', 'function_call_output']).toContain(message.type); + + if (message.type === 'message') { + const outputMessage = message as ResponsesOutputMessage; + // ResponsesOutputMessage specific validations + expect(outputMessage.role).toBe('assistant'); + expect(outputMessage.id).toBeDefined(); + expect(Array.isArray(outputMessage.content)).toBe(true); + + // Validate content items + for (const item of outputMessage.content) { + expect(typeof item).toBe('object'); + expect(item).not.toBeNull(); + expect(item).toHaveProperty('type'); } - } else if (message.role === 'tool') { - // ToolResponseMessage specific validations - const toolMsg = message as ToolResponseMessage; - expect(typeof toolMsg.toolCallId).toBe('string'); - expect(toolMsg.toolCallId.length).toBeGreaterThan(0); + } else if (message.type === 'function_call_output') { + // OpenResponsesFunctionCallOutput specific validations + const fnOutput = message as OpenResponsesFunctionCallOutput; + expect(typeof fnOutput.callId).toBe('string'); + expect(fnOutput.callId.length).toBeGreaterThan(0); + expect(typeof fnOutput.output).toBe('string'); } } }, 15000); @@ -1049,7 +1131,7 @@ describe('callModel E2E Tests', () => { })(); const newMessagesStreamPromise = (async () => { - const messages: (AssistantMessage | ToolResponseMessage)[] = []; + const messages: (ResponsesOutputMessage | OpenResponsesFunctionCallOutput)[] = []; for await (const message of response.getNewMessagesStream()) { messages.push(message); } @@ -1066,8 +1148,12 @@ describe('callModel E2E Tests', () => { // Verify consistency between streams const textFromDeltas = textDeltas.join(''); - const lastMessage = messages[messages.length - 1]; - const textFromMessage = (lastMessage.content as string) || ''; + const lastMessage = messages[messages.length - 1] as ResponsesOutputMessage; + // Extract text from ResponsesOutputMessage content array + const textFromMessage = lastMessage.content + .filter((c): c is { type: 'output_text'; text: string } => 'type' in c && c.type === 'output_text') + .map((c) => c.text) + .join(''); expect(textFromDeltas).toBe(textFromMessage); }, 20000);