From 3f1cde78008b94b75cbf007ae497f2c7aa784857 Mon Sep 17 00:00:00 2001 From: opper-bot Date: Mon, 19 Jan 2026 09:17:27 +0000 Subject: [PATCH] chore: update TypeScript SDK via automated generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Automated SDK update to version 3.4.2 - ✅ Speakeasy SDK generation completed - ✅ TypeScript compilation verified - ✅ ESLint validation passed - ✅ Build artifacts generated - ✅ Smoke tests passed Generated on: 2026-01-19 09:17:27 UTC This PR was created automatically by the SDK generation workflow. --- .speakeasy/gen.lock | 158 +++++++++--------- .speakeasy/gen.yaml | 5 +- .speakeasy/workflow.lock | 12 +- ...ctionrequest.md => callfunctionrequest.md} | 6 +- ...ionresponse.md => callfunctionresponse.md} | 8 +- ...ctionfunctionsfunctionidcallpostrequest.md | 10 +- ...ionsfunctionidcallrevisionidpostrequest.md | 12 +- ...unctionsfunctionidcallstreampostrequest.md | 10 +- ...nctionidcallstreamrevisionidpostrequest.md | 12 +- .../updatespanspansspanidpatchrequest.md | 4 +- docs/models/updatespanrequest.md | 8 +- examples/package-lock.json | 4 +- jsr.json | 2 +- package-lock.json | 12 +- package.json | 4 +- src/funcs/functionsCall.ts | 30 ++-- src/funcs/functionsCallRevision.ts | 30 ++-- src/funcs/functionsStream.ts | 19 +-- src/funcs/functionsStreamRevision.ts | 19 +-- src/lib/config.ts | 6 +- src/lib/sdks.ts | 4 +- src/mcp-server/mcp-server.ts | 2 +- src/mcp-server/server.ts | 2 +- src/mcp-server/tools/functionsCall.ts | 5 +- src/mcp-server/tools/functionsCallRevision.ts | 5 +- src/mcp-server/tools/functionsStream.ts | 5 +- .../tools/functionsStreamRevision.ts | 5 +- ...apipublicv2functionscallfunctionrequest.ts | 92 ---------- ...pipublicv2functionscallfunctionresponse.ts | 118 ------------- src/models/callfunctionrequest.ts | 84 ++++++++++ src/models/callfunctionresponse.ts | 107 ++++++++++++ src/models/index.ts | 4 +- ...callfunctionfunctionsfunctionidcallpost.ts | 18 +- ...onfunctionsfunctionidcallrevisionidpost.ts | 18 +- ...nctionfunctionsfunctionidcallstreampost.ts | 18 +- ...tionsfunctionidcallstreamrevisionidpost.ts | 18 +- src/sdk/functions.ts | 24 ++- 37 files changed, 413 insertions(+), 487 deletions(-) rename docs/models/{appapipublicv2functionscallfunctionrequest.md => callfunctionrequest.md} (94%) rename docs/models/{appapipublicv2functionscallfunctionresponse.md => callfunctionresponse.md} (98%) delete mode 100644 src/models/appapipublicv2functionscallfunctionrequest.ts delete mode 100644 src/models/appapipublicv2functionscallfunctionresponse.ts create mode 100644 src/models/callfunctionrequest.ts create mode 100644 src/models/callfunctionresponse.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9e1ba85..c1507c3 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,22 +1,22 @@ lockVersion: 2.0.0 id: 7fd487cb-2a73-459e-99e5-2c4e6547175f management: - docChecksum: 4ca2e5a38cd1267ee6f3904ffb919fe6 + docChecksum: a3028e459d9508964f000f0eb312e495 docVersion: 2.0.0 - speakeasyVersion: 1.680.11 - generationVersion: 2.788.15 - releaseVersion: 3.4.1 - configChecksum: 2505d61983a54516502c3199a3877c7c + speakeasyVersion: 1.688.0 + generationVersion: 2.796.4 + releaseVersion: 3.4.2 + configChecksum: 57b4a05d11d9ccc65deb1163f7a56009 persistentEdits: - generation_id: c243171f-defa-4e30-9fef-03726035f93a - pristine_commit_hash: acd0fa57347a4055ff5a89cf590b5de329234259 - pristine_tree_hash: afc296ed1d811aa5354b5065995ab67b4ba15949 + generation_id: feeeb2b5-1247-4f85-99fa-fd28a891249c + pristine_commit_hash: 41752cd2b6ae89810d9fd35fdaefd97735b15655 + pristine_tree_hash: 6cd24480814c4a927777ba821c5540e614dceb89 features: typescript: additionalDependencies: 0.1.0 - additionalProperties: 0.1.2 + additionalProperties: 0.1.3 constsAndDefaults: 0.1.12 - core: 3.26.17 + core: 3.26.22 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 devContainers: 2.90.1 @@ -90,14 +90,6 @@ trackedFiles: id: 428a6cce6b14 last_write_checksum: sha1:a51c7a09d03d54f4e4bf299fc1290c01873882d2 pristine_git_object: 6878c439a8ca7ded8093f1c416005ed1b86dac36 - docs/models/appapipublicv2functionscallfunctionrequest.md: - id: e9f082ece3bc - last_write_checksum: sha1:abb193368ce7bef80a85a16a6173aa9b5b25966b - pristine_git_object: 09740231dbb24d729909e9495389e6b579d469f1 - docs/models/appapipublicv2functionscallfunctionresponse.md: - id: 062b4a4a392e - last_write_checksum: sha1:62bfae090d4e163dcecf416d30650058f9327a3c - pristine_git_object: 67b1ba857adfe53c2753c822cffe894667c237de docs/models/audio.md: id: 197ec2b1424a last_write_checksum: sha1:00b68653717a326ce7f94d71265af195b5067474 @@ -110,6 +102,14 @@ trackedFiles: id: 89cc22c950cb last_write_checksum: sha1:6917e6b053b1d43dd2392837acd793b3d65a36ea pristine_git_object: 61f52a3a329d9de087d65cff600d713d7c00f11f + docs/models/callfunctionrequest.md: + id: 6e402141eaaf + last_write_checksum: sha1:061503c787eb042a0d1836c370f0a1140651f946 + pristine_git_object: dd78cead055c7cdd617a160def77050da40b5a47 + docs/models/callfunctionresponse.md: + id: 7edcead03403 + last_write_checksum: sha1:262206159387d63431939611d28a387d08062790 + pristine_git_object: 47ef292421b0d25b71d4b444d8c77377c12f7ecd docs/models/chatcompletion.md: id: 7087ed1b2694 last_write_checksum: sha1:bb6e9c542aa316ae5a0214b3651c2675025c8300 @@ -764,12 +764,12 @@ trackedFiles: pristine_git_object: ee3bacfc9e6be5fd8c0465d47939fb25a07611f6 docs/models/operations/callfunctionfunctionsfunctionidcallpostrequest.md: id: b81f98a044f9 - last_write_checksum: sha1:b054daa2ba502229ac39ac6349ae85a750d74864 - pristine_git_object: 70cd214f4f758fc4be4c8292267f5e52b5fe63da + last_write_checksum: sha1:a280c8185bc7876b223400018459db4256bff4dc + pristine_git_object: 996a9686145f61808cafb34bad15b16d1f526621 docs/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpostrequest.md: id: dcd2f682ef2c - last_write_checksum: sha1:e2052fec55981c15d4f7e937775dc8622a329652 - pristine_git_object: 7f9c7ea816fa3f92e5d4ee1fb14612d89bea3dcc + last_write_checksum: sha1:f0291aef1fc868d59642ea0815776922c1f67258 + pristine_git_object: 1fc77d08ed654291b35f69695e16c92487a7614f docs/models/operations/createdatasetentrydatasetsdatasetidpostrequest.md: id: 7ce6366ac93c last_write_checksum: sha1:60fddd431526cb8537275451cbc63bb3de19b19b @@ -956,8 +956,8 @@ trackedFiles: pristine_git_object: d80cea564262831a6769bace097faabe225a91c2 docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostrequest.md: id: 35f119d73075 - last_write_checksum: sha1:edecdf5441a85424c0a513bbbe1ad3b7f26e3b14 - pristine_git_object: 12e16cfab4ab9140e30d7138e020425825d81192 + last_write_checksum: sha1:c340cbd67243184c4d571606ea74e3e5fc44ac6c + pristine_git_object: a22146d7eb6f0a7ab134ca1a0e742c5b3794d7ac docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostresponse.md: id: 0cf8352d3981 last_write_checksum: sha1:df6d77f38452ef9eadf807a6940c7a79d3c919fe @@ -972,8 +972,8 @@ trackedFiles: pristine_git_object: c76e9ee29bf1cf0951640557acf14200773de27f docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md: id: a222d7078e48 - last_write_checksum: sha1:f9a92843ccda2c162a3bbc9925424a95da2a9e14 - pristine_git_object: ca8a1d6b3be211a6809f352cacbe05d7a662d558 + last_write_checksum: sha1:dd33d263a43b066e56d48287ec6df3786d962a0f + pristine_git_object: c8cd29be393296fb04af28cc71faab5a86791444 docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostresponse.md: id: abf1400ec2c1 last_write_checksum: sha1:af877b590604116411ac39f7274fdfddf9478199 @@ -1012,8 +1012,8 @@ trackedFiles: pristine_git_object: b91b7fbdba7b1d4a82692d7b29f9cd3f9f890170 docs/models/operations/updatespanspansspanidpatchrequest.md: id: 3807d912b962 - last_write_checksum: sha1:3832cb1143b4a8ea9dcb0809b032942d8e720def - pristine_git_object: 0da6d5c0bf13d7af9b4bb7603a9693bc60f33d61 + last_write_checksum: sha1:319520fe39d662fee4fe0faefd8ae6487f022106 + pristine_git_object: 4c810277bfb8a8b54278ffa188a7227f0dafaf24 docs/models/operations/uploadfileknowledgeknowledgebaseiduploadpostrequest.md: id: 660a4bf8bd1e last_write_checksum: sha1:d3db44f9870a08cad951ee61a78ef0c1f9d9f8b5 @@ -1228,8 +1228,8 @@ trackedFiles: pristine_git_object: 475ebf38d243b062fd2522c7848c7c5136d47ec0 docs/models/updatespanrequest.md: id: 0cc273f44164 - last_write_checksum: sha1:b19db8375d6f1b813bd81d5c810fdc29a64cc863 - pristine_git_object: f2a8f24129932c94124888a5c80a493c564823ec + last_write_checksum: sha1:0306967ef5358c80e290f6757620b3fb63bf18f6 + pristine_git_object: 090413d21ca6cc3b965b05c0c3edb5b0b90fc06c docs/models/updatespanresponse.md: id: 163e62c13f3d last_write_checksum: sha1:0f1aa3c4814eb509f0fa5f0ba8f6cb9e51542a76 @@ -1284,12 +1284,12 @@ trackedFiles: pristine_git_object: fe49b0d036cb4737c253de7bdd79294bb45c2890 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:a32844da90a797c5ecd7aedc7aca129389648baf - pristine_git_object: 029e1aba29ef99d1b6bc463c75dd5a67073e318f + last_write_checksum: sha1:cee2848ee04ac72ef57a913c033725171aeed352 + pristine_git_object: 09e1d27fd104a000ed55ae5f90285d05985d21b3 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:5e9dc44d73656fa94a07bbd579d7258fd8613481 - pristine_git_object: dbe4d6769292c1dcc94898c4d5ced43ee83894ee + last_write_checksum: sha1:ca883751c58afad524136f169e5bc92a40c57101 + pristine_git_object: 29d5c2ab9493f09d589af5475c7b188ec5672642 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:7fe1d083a687c984082d7324a6c70efa04ac3019 @@ -1332,12 +1332,12 @@ trackedFiles: pristine_git_object: 3b63c19c4761dfe8c5ee625686c6d079d0d28a21 src/funcs/functionsCall.ts: id: b6629434e293 - last_write_checksum: sha1:fea43d3940547c5c77b85b89880c836e6403731a - pristine_git_object: 7e4d888fbf386b9cb0201d402d3a9492fb3b5bc0 + last_write_checksum: sha1:a973f3a8c08cb26e5340ba9ec22d53b5bc9ee187 + pristine_git_object: c2845c825207fb414de01039c691f3d811f17804 src/funcs/functionsCallRevision.ts: id: 796938f8e8aa - last_write_checksum: sha1:1e409d439de18183e3bb3f47d83796a19df9f6c3 - pristine_git_object: 64d2c5540c66df206d01f81c51b71c0e2467e35b + last_write_checksum: sha1:6a96c2a3247a2234734a977146962605ab46a51f + pristine_git_object: aa59331b9725c5f34c0f6f599f8c9dcbdaac17ae src/funcs/functionsCreate.ts: id: aef7bf511c25 last_write_checksum: sha1:801c9b52ca76bbd84b95e02b64afa56cd467fa89 @@ -1368,12 +1368,12 @@ trackedFiles: pristine_git_object: 8efec923d95c2523856818b56431e6b32ac5f285 src/funcs/functionsStream.ts: id: c5f7f605a46f - last_write_checksum: sha1:d626a2c92dc4f6f12292f04eca94270ad03d60a4 - pristine_git_object: 369120fc42c5cedbc94a0fc8a2e9ebf3625ada23 + last_write_checksum: sha1:c1b9c89fd51a74efb0e1328d7348ebb1f30b9293 + pristine_git_object: 1048b23bf9846637b260b4aa79da4710fec8d8d1 src/funcs/functionsStreamRevision.ts: id: b94430efa6b4 - last_write_checksum: sha1:edb1c7c577bd00b217b23112531b301432844158 - pristine_git_object: 97bce5b22ee37a09a129e0e30f15d3be11cfe44b + last_write_checksum: sha1:24b2397f04ea4851574db36d06edea02cc158240 + pristine_git_object: a707ef1e50b3e03c9ad490a322433172e3e7a141 src/funcs/functionsUpdate.ts: id: ac35d35c28a7 last_write_checksum: sha1:bf14adbdc8ea4a978bcd4f1a2441030187365dfc @@ -1588,8 +1588,8 @@ trackedFiles: pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:6db96ee9f023e595f0af87d37558c21faa713794 - pristine_git_object: 7d8478ec487b3d2f106dafd22c85cf72246ab426 + last_write_checksum: sha1:f32e3cb79f6deafa99bdefd20887f23fadab73d7 + pristine_git_object: e0978b9e7131358e3e86817eecafd61119eb44e3 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 @@ -1640,8 +1640,8 @@ trackedFiles: pristine_git_object: 47edb9725c2482c667e2ddc8a56b1fec4285c492 src/lib/sdks.ts: id: 8a6d91f1218d - last_write_checksum: sha1:f7db2d55ac9f5280a24b1b242779b6a231602289 - pristine_git_object: e90348cc7f8959614e2f0e67e89740d9f1415727 + last_write_checksum: sha1:bfcd51a60e2c11e03aeb8ce0772a2b3d34b191a7 + pristine_git_object: f96b5799df1b2450c894d2f2287d3f1eca5467e8 src/lib/security.ts: id: 0502afa7922e last_write_checksum: sha1:119ceae76323648a76e7e78c3a7cdbeaf9c1ccfd @@ -1676,8 +1676,8 @@ trackedFiles: pristine_git_object: 0955a573c2ce989d63c737410ab8cc28706d9f74 src/mcp-server/mcp-server.ts: id: aabbc4ab07c1 - last_write_checksum: sha1:630b11682e88bac36bbc88ec0ebb43823518b683 - pristine_git_object: 8df222da77bfab5b06933a886c14f53bae5dfbba + last_write_checksum: sha1:c22a980ca9d795c6ae4794939aa6c20c863594c7 + pristine_git_object: ed9ca8f4611ed0609bdef4ef55d572c506e5024f src/mcp-server/prompts.ts: id: 26f3d73cbf31 last_write_checksum: sha1:aab17727e4e0e625fffd088ba2943d9700e6c049 @@ -1692,8 +1692,8 @@ trackedFiles: pristine_git_object: c25696d4c4f70e081fa5d87ad6891874c509a577 src/mcp-server/server.ts: id: 2784dd48e82a - last_write_checksum: sha1:3ff63519ef2de8f1ea71a2a8d4d8e9ddb43d4e5f - pristine_git_object: 4513112dfd7a8da6011287fa82d88b03ab44943c + last_write_checksum: sha1:78fb732c2f1005f3b043592fba3e0b2b39a5166e + pristine_git_object: e3308bfa9ad2483f79e6a186ff6b6a5283c7ff9e src/mcp-server/shared.ts: id: 074e80d4be1e last_write_checksum: sha1:56c73d4429691516e35541825e759a0285747a2b @@ -1740,12 +1740,12 @@ trackedFiles: pristine_git_object: b8c12f8343f4dc75b374591bd885358ee96ae3cd src/mcp-server/tools/functionsCall.ts: id: ad25c3c2a89a - last_write_checksum: sha1:51e8620644422c23591205a7cf50499e09a7db85 - pristine_git_object: 819b27c4e2e41bec8446cb25e82888f45803181f + last_write_checksum: sha1:2b1d168b925cf8b4777cd5315e29a3544d3f421a + pristine_git_object: 80bc4a61d5b024528e63dd910373d962882f5615 src/mcp-server/tools/functionsCallRevision.ts: id: 081a1dde7964 - last_write_checksum: sha1:e20bfc3846a096c351ddba2379167c752e575d62 - pristine_git_object: 6c49ee6249af4d093d0901c6a771375457a00bad + last_write_checksum: sha1:ca6a0847d5f85e92ad88e8e5ca89f0e3d40e745f + pristine_git_object: 929526e47183f6f96d2657a5f4493c91a2501b48 src/mcp-server/tools/functionsCreate.ts: id: 93593157a808 last_write_checksum: sha1:cf2705683beb9cf72b86c12fe2610f4d70425f1c @@ -1776,12 +1776,12 @@ trackedFiles: pristine_git_object: c19f57ce225fac48cced2fc33f16d9f941a5171f src/mcp-server/tools/functionsStream.ts: id: 9fa0756f3fcc - last_write_checksum: sha1:0cffa983755c100ad72dc4112ab93201f1258bcd - pristine_git_object: 996c7a0ebc49186025c81c9948ea6fdfce6feafc + last_write_checksum: sha1:3e256f4d83c2279bc7e707726478e120829d94b3 + pristine_git_object: 9cb4dfb5e672222b9a5eb87ae84b0225c88fe349 src/mcp-server/tools/functionsStreamRevision.ts: id: 5f16d49cdb69 - last_write_checksum: sha1:14b380d60765f15c00ef0ac8febf0bd15b34e551 - pristine_git_object: d65a42161023d40ce6131e7d97ef03646d07d367 + last_write_checksum: sha1:2c1b7ba68879a119416d1772cb3d181446c9aa59 + pristine_git_object: 1aa9ba849d41cedf8a6814777344d6bac8c6fbca src/mcp-server/tools/functionsUpdate.ts: id: 629d35092770 last_write_checksum: sha1:d9a50ea64e39267788ce272ef1f4070d0b140d7c @@ -1994,14 +1994,6 @@ trackedFiles: id: bc9b70199c5a last_write_checksum: sha1:bc89171dc945ade15b64b261d963bfcdfbda75a2 pristine_git_object: ddef5eb27611638b7db28433f1b6dbe0a6ac4d0d - src/models/appapipublicv2functionscallfunctionrequest.ts: - id: cfc6ca65127c - last_write_checksum: sha1:21a85c34b00e3a3568d368314efbdbbf9f98d039 - pristine_git_object: eb1583acd9cdac04e5022ea123bbe05dd5fac927 - src/models/appapipublicv2functionscallfunctionresponse.ts: - id: 7dad677b6ebe - last_write_checksum: sha1:540a57a92ba4e7d628507aa252d4c44fcbb228f5 - pristine_git_object: bdc3b95d9a0b50ce240e5f28e73bc8b54adfadc3 src/models/audio.ts: id: 4b0a8214f90e last_write_checksum: sha1:ab7ccb9e3da028e8d174b677c5cd5b495c933265 @@ -2010,6 +2002,14 @@ trackedFiles: id: 16bf9a5901fb last_write_checksum: sha1:7ab25367090caeb3260862b5e2a3067dee8a17e8 pristine_git_object: 07a13149845ba2a8e85708661cfe2776757c4928 + src/models/callfunctionrequest.ts: + id: e0432cc8379c + last_write_checksum: sha1:a0d0e92e7c2508bb132f37ff58c1c04a489d7ec0 + pristine_git_object: 7128d0a424425ff5a4e557fabb2d3a7565dc0955 + src/models/callfunctionresponse.ts: + id: 9c7a1c14567a + last_write_checksum: sha1:98de4926405be66a9f276b31710d4680bd7e0322 + pristine_git_object: d161c2961d8c4c2e2aa8e7f6823cbf8eb471f0f6 src/models/chatcompletion.ts: id: 92c8e8bb5ac2 last_write_checksum: sha1:afd602d8f1b3a3d8c78dd639f84634b775c807dd @@ -2388,8 +2388,8 @@ trackedFiles: pristine_git_object: 61690cc62ba68deb1c15e548bf466dbf815de24b src/models/index.ts: id: f93644b0f37e - last_write_checksum: sha1:c26720b1ea4b6e33fc06e2a35d62aed2d25e5a81 - pristine_git_object: 60b3a6acc6559d117716f6b57946a04be5657c68 + last_write_checksum: sha1:4383c71e6252236c20a570e9d671b24aadddca68 + pristine_git_object: 0f71983b2b46727ad5e02bed3cf3e1ba8a5e5290 src/models/inputaudio.ts: id: 9bdc14c7565f last_write_checksum: sha1:cbdd2b85ee862c49ab572f2a402be112b7d21c0a @@ -2520,12 +2520,12 @@ trackedFiles: pristine_git_object: aeb81b9f689d146df985767a842cbef0f546e275 src/models/operations/callfunctionfunctionsfunctionidcallpost.ts: id: 1644db62c9ec - last_write_checksum: sha1:b0b402117254e721ec5fc689a88e255bb020944a - pristine_git_object: 3c0b1aefcccb6292af975cfb77b112b87b3161af + last_write_checksum: sha1:15d6306b476a68d00e2ee3375be30923e544dba3 + pristine_git_object: 67fabc5381af0b5057197e4862120952626463ee src/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.ts: id: 836a8f944d2c - last_write_checksum: sha1:0084e9c477b50668479b8760e13ace38d4df2fa6 - pristine_git_object: d50137f5ffee53817c3761bec166fa806fdc79ed + last_write_checksum: sha1:fc1fb3433a60cdc17827b6d176354d11ca7406d4 + pristine_git_object: 27867fa8ef44886eda855b1196e386a823d0ee96 src/models/operations/chatcompletionsopenaichatcompletionspost.ts: id: c41eaba7d6db last_write_checksum: sha1:46d54fb7be01c703bed3ec1b8952e904ff064773 @@ -2704,12 +2704,12 @@ trackedFiles: pristine_git_object: e4865764ed20eb001efc709ea404efc2d7ed7633 src/models/operations/streamfunctionfunctionsfunctionidcallstreampost.ts: id: 07b7965e3d2a - last_write_checksum: sha1:ac26e55dde7cbaf0b6c7e656c61c1ccdbf4a1a59 - pristine_git_object: c5e209297c2d6b43b38cfe3957bc5b4b9d715a2a + last_write_checksum: sha1:b59fcb8b60f814b2c0a4c1322149401540317881 + pristine_git_object: 7e5c406ed3930b381041ba88862762f1d850451e src/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.ts: id: 23b4043d5b3b - last_write_checksum: sha1:c2f12403cdb84b20e2ca77da85804a972c06d8af - pristine_git_object: e4a05eaf485a6acd52649c048a886a784885c6da + last_write_checksum: sha1:c9a7780a6fdc1b35511e80dd09a01ce7505a1036 + pristine_git_object: a164f57fc1db7dfeec939ddf6b1771a17030b4d9 src/models/operations/submitspanfeedbackspansspanidfeedbackpost.ts: id: 2d935520f209 last_write_checksum: sha1:bd5106f5bd91eac640a4c4c42bf6f9f29be5ff66 @@ -2980,8 +2980,8 @@ trackedFiles: pristine_git_object: 37c2f97fe32b9eec41886eb3e8f157d482339e1d src/sdk/functions.ts: id: cbc1d38a7d46 - last_write_checksum: sha1:92fb1021fbe6c93c21f0642aaf9099d94c58dfed - pristine_git_object: 062812a1a0ca8f1225a42cd86cfce49d449f35d4 + last_write_checksum: sha1:2a9991394aafe9df146bbd6a1f1920af443d3a9a + pristine_git_object: 3bb6366165eecb86a72ad527620240f86797f589 src/sdk/index.ts: id: a857902a703f last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f @@ -3348,7 +3348,7 @@ examples: path: span_id: "77b258a2-45c1-4b87-a50c-9116bc8ed1d6" requestBody: - application/json: {"name": "my span", "start_time": "2026-01-02T11:36:47.278310Z", "type": "email_tool", "end_time": "2026-01-02T11:36:47.278372Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} + application/json: {"name": "my span", "start_time": "2026-01-19T03:07:23.413492Z", "type": "email_tool", "end_time": "2026-01-19T03:07:23.413553Z", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} responses: "200": application/json: {"name": "my span", "start_time": "2024-03-20T10:00:00+00:00", "id": "84d9ffc8-336c-4953-b92f-fe05d5405951", "trace_id": "123e4567-e89b-12d3-a456-426614174000", "parent_id": "123e4567-e89b-12d3-a456-426614174000", "type": "email_tool", "end_time": "2024-03-20T10:00:10+00:00", "input": "Hello, world!", "output": "Hello, world!", "error": "Exception: This is an error message", "meta": {"key": "value"}, "score": 10} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5de72b5..61c73df 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,6 +16,7 @@ generation: requestResponseComponentNamesFeb2024: true securityFeb2025: true sharedErrorComponentsApr2025: true + sharedNestedComponentsJan2026: false auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true @@ -30,7 +31,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 3.4.1 + version: 3.4.2 acceptHeaderEnum: true additionalDependencies: dependencies: {} @@ -53,6 +54,7 @@ typescript: enumFormat: union envVarPrefix: OPPER exportZodModelNamespace: false + flatAdditionalProperties: false flattenGlobalSecurity: true flatteningOrder: parameters-first formStringArrayEncodeMode: encoded-string @@ -79,6 +81,7 @@ typescript: outputModelSuffix: output packageName: opperai preApplyUnionDiscriminators: true + preserveModelFieldNames: false responseFormat: flat sseFlatResponse: false templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 40af9e3..dcf8bb1 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.680.11 +speakeasyVersion: 1.688.0 sources: FastAPI: sourceNamespace: fast-api - sourceRevisionDigest: sha256:68b0cbe004a918df9af2bdb9f14fb8603d166eee2514fe752773b87a0b06a602 - sourceBlobDigest: sha256:9a8a62a66b7d61f0a406be7b4c63c1b2d555b9ce44d9e3f998d10c31df1d5009 + sourceRevisionDigest: sha256:a905a7f9a1d6b1aa6dd9f6c8a7a9859151149d405e6afacf01b6a8bd5b2a8f74 + sourceBlobDigest: sha256:6b70a714876885873207cc1141ba4ccee9ea99a2c5f0e5e7ed6673bd7cb4904d tags: - latest - main @@ -12,10 +12,10 @@ targets: opper: source: FastAPI sourceNamespace: fast-api - sourceRevisionDigest: sha256:68b0cbe004a918df9af2bdb9f14fb8603d166eee2514fe752773b87a0b06a602 - sourceBlobDigest: sha256:9a8a62a66b7d61f0a406be7b4c63c1b2d555b9ce44d9e3f998d10c31df1d5009 + sourceRevisionDigest: sha256:a905a7f9a1d6b1aa6dd9f6c8a7a9859151149d405e6afacf01b6a8bd5b2a8f74 + sourceBlobDigest: sha256:6b70a714876885873207cc1141ba4ccee9ea99a2c5f0e5e7ed6673bd7cb4904d codeSamplesNamespace: fast-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:5c5b7fb4892a2ddb5a8cf1e04b161f2742e976efee6a8b613f3d666aa8474a96 + codeSamplesRevisionDigest: sha256:c37461f4938c89c1fe2c02ad80df924d48491a6baa794e22ce2ab8e82ebde87f workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/appapipublicv2functionscallfunctionrequest.md b/docs/models/callfunctionrequest.md similarity index 94% rename from docs/models/appapipublicv2functionscallfunctionrequest.md rename to docs/models/callfunctionrequest.md index 0974023..dd78cea 100644 --- a/docs/models/appapipublicv2functionscallfunctionrequest.md +++ b/docs/models/callfunctionrequest.md @@ -1,11 +1,11 @@ -# AppApiPublicV2FunctionsCallFunctionRequest +# CallFunctionRequest ## Example Usage ```typescript -import { AppApiPublicV2FunctionsCallFunctionRequest } from "opperai/models"; +import { CallFunctionRequest } from "opperai/models"; -let value: AppApiPublicV2FunctionsCallFunctionRequest = { +let value: CallFunctionRequest = { input: { "x": 4, "y": 5, diff --git a/docs/models/appapipublicv2functionscallfunctionresponse.md b/docs/models/callfunctionresponse.md similarity index 98% rename from docs/models/appapipublicv2functionscallfunctionresponse.md rename to docs/models/callfunctionresponse.md index 67b1ba8..47ef292 100644 --- a/docs/models/appapipublicv2functionscallfunctionresponse.md +++ b/docs/models/callfunctionresponse.md @@ -1,12 +1,12 @@ -# AppApiPublicV2FunctionsCallFunctionResponse +# CallFunctionResponse ## Example Usage ```typescript -import { AppApiPublicV2FunctionsCallFunctionResponse } from "opperai/models"; +import { CallFunctionResponse } from "opperai/models"; -let value: AppApiPublicV2FunctionsCallFunctionResponse = { - spanId: "a81c6454-5ac4-4060-a3f1-5a2d8f1af4cc", +let value: CallFunctionResponse = { + spanId: "e9cdfdda-24c9-49c9-b80b-1a2728c3f909", message: "The sum of 1 and 3 is 4", jsonPayload: { "sum": 4, diff --git a/docs/models/operations/callfunctionfunctionsfunctionidcallpostrequest.md b/docs/models/operations/callfunctionfunctionsfunctionidcallpostrequest.md index 70cd214..996a968 100644 --- a/docs/models/operations/callfunctionfunctionsfunctionidcallpostrequest.md +++ b/docs/models/operations/callfunctionfunctionsfunctionidcallpostrequest.md @@ -7,7 +7,7 @@ import { CallFunctionFunctionsFunctionIdCallPostRequest } from "opperai/models/o let value: CallFunctionFunctionsFunctionIdCallPostRequest = { functionId: "771b74ef-3e63-4e30-89a1-837525070c24", - appApiPublicV2FunctionsCallFunctionRequest: { + callFunctionRequest: { input: { "x": 4, "y": 5, @@ -33,7 +33,7 @@ let value: CallFunctionFunctionsFunctionIdCallPostRequest = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | -| `appApiPublicV2FunctionsCallFunctionRequest` | [models.AppApiPublicV2FunctionsCallFunctionRequest](../../models/appapipublicv2functionscallfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | +| `callFunctionRequest` | [models.CallFunctionRequest](../../models/callfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpostrequest.md b/docs/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpostrequest.md index 7f9c7ea..1fc77d0 100644 --- a/docs/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpostrequest.md +++ b/docs/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpostrequest.md @@ -8,7 +8,7 @@ import { CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest } from let value: CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest = { functionId: "bd5c888f-ced7-4001-933d-0de6d9e4c217", revisionId: "7845175b-c54e-4fe1-b8fb-1e34dbf28957", - appApiPublicV2FunctionsCallFunctionRequest: { + callFunctionRequest: { input: { "x": 4, "y": 5, @@ -34,8 +34,8 @@ let value: CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | -| `revisionId` | *string* | :heavy_check_mark: | The id of the revision to call | -| `appApiPublicV2FunctionsCallFunctionRequest` | [models.AppApiPublicV2FunctionsCallFunctionRequest](../../models/appapipublicv2functionscallfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | +| `revisionId` | *string* | :heavy_check_mark: | The id of the revision to call | +| `callFunctionRequest` | [models.CallFunctionRequest](../../models/callfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostrequest.md b/docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostrequest.md index 12e16cf..a22146d 100644 --- a/docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostrequest.md +++ b/docs/models/operations/streamfunctionfunctionsfunctionidcallstreampostrequest.md @@ -7,7 +7,7 @@ import { StreamFunctionFunctionsFunctionIdCallStreamPostRequest } from "opperai/ let value: StreamFunctionFunctionsFunctionIdCallStreamPostRequest = { functionId: "c3ca1b27-b06d-4da0-9bb3-c09b9a4e67bb", - appApiPublicV2FunctionsCallFunctionRequest: { + callFunctionRequest: { input: { "x": 4, "y": 5, @@ -33,7 +33,7 @@ let value: StreamFunctionFunctionsFunctionIdCallStreamPostRequest = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | -| `appApiPublicV2FunctionsCallFunctionRequest` | [models.AppApiPublicV2FunctionsCallFunctionRequest](../../models/appapipublicv2functionscallfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | +| `callFunctionRequest` | [models.CallFunctionRequest](../../models/callfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md b/docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md index ca8a1d6..c8cd29b 100644 --- a/docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md +++ b/docs/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpostrequest.md @@ -9,7 +9,7 @@ let value: StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostRequest = { functionId: "6c1256fb-29fc-4d4a-9db7-250250736273", revisionId: "c8d8f228-67ba-4b69-9ce9-cc136b704f92", - appApiPublicV2FunctionsCallFunctionRequest: { + callFunctionRequest: { input: { "x": 4, "y": 5, @@ -35,8 +35,8 @@ let value: ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | -| `revisionId` | *string* | :heavy_check_mark: | The id of the revision to call | -| `appApiPublicV2FunctionsCallFunctionRequest` | [models.AppApiPublicV2FunctionsCallFunctionRequest](../../models/appapipublicv2functionscallfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `functionId` | *string* | :heavy_check_mark: | The id of the function to call | +| `revisionId` | *string* | :heavy_check_mark: | The id of the revision to call | +| `callFunctionRequest` | [models.CallFunctionRequest](../../models/callfunctionrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatespanspansspanidpatchrequest.md b/docs/models/operations/updatespanspansspanidpatchrequest.md index 0da6d5c..4c81027 100644 --- a/docs/models/operations/updatespanspansspanidpatchrequest.md +++ b/docs/models/operations/updatespanspansspanidpatchrequest.md @@ -9,9 +9,9 @@ let value: UpdateSpanSpansSpanIdPatchRequest = { spanId: "c4686ca8-5f9f-483e-8cc2-e12731bcf9e5", updateSpanRequest: { name: "my span", - startTime: new Date("2026-01-02T11:36:47.278310Z"), + startTime: new Date("2026-01-19T03:07:23.413492Z"), type: "email_tool", - endTime: new Date("2026-01-02T11:36:47.278372Z"), + endTime: new Date("2026-01-19T03:07:23.413553Z"), input: "Hello, world!", output: "Hello, world!", error: "Exception: This is an error message", diff --git a/docs/models/updatespanrequest.md b/docs/models/updatespanrequest.md index f2a8f24..090413d 100644 --- a/docs/models/updatespanrequest.md +++ b/docs/models/updatespanrequest.md @@ -7,9 +7,9 @@ import { UpdateSpanRequest } from "opperai/models"; let value: UpdateSpanRequest = { name: "my span", - startTime: new Date("2026-01-02T11:36:47.278310Z"), + startTime: new Date("2026-01-19T03:07:23.413492Z"), type: "email_tool", - endTime: new Date("2026-01-02T11:36:47.278372Z"), + endTime: new Date("2026-01-19T03:07:23.413553Z"), input: "Hello, world!", output: "Hello, world!", error: "Exception: This is an error message", @@ -25,9 +25,9 @@ let value: UpdateSpanRequest = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `name` | *string* | :heavy_minus_sign: | The name of the span, something descriptive about the span that will be used to identify it when querying | my span | -| `startTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The start time of the span in UTC | 2026-01-02T11:36:47.278310Z | +| `startTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The start time of the span in UTC | 2026-01-19T03:07:23.413492Z | | `type` | *string* | :heavy_minus_sign: | The type of the span | email_tool | -| `endTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The end time of the span in UTC | 2026-01-02T11:36:47.278372Z | +| `endTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The end time of the span in UTC | 2026-01-19T03:07:23.413553Z | | `input` | *string* | :heavy_minus_sign: | The input of the span | Hello, world! | | `output` | *string* | :heavy_minus_sign: | The output of the span | Hello, world! | | `error` | *string* | :heavy_minus_sign: | In case of an error, the error message | Exception: This is an error message | diff --git a/examples/package-lock.json b/examples/package-lock.json index 044e782..a734c98 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,9 +18,9 @@ }, "..": { "name": "opperai", - "version": "3.4.1", + "version": "3.4.2", "dependencies": { - "@modelcontextprotocol/sdk": "^1.24.0", + "@modelcontextprotocol/sdk": "^1.25.2", "zod": "^3.25.0 || ^4.0.0" }, "bin": { diff --git a/jsr.json b/jsr.json index 029e1ab..09e1d27 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "opperai", - "version": "3.4.1", + "version": "3.4.2", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index d0b969c..081284d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { "name": "opperai", - "version": "3.4.1", + "version": "3.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opperai", - "version": "3.4.1", + "version": "3.4.2", "dependencies": { - "@modelcontextprotocol/sdk": "^1.24.0", + "@modelcontextprotocol/sdk": "^1.25.2", "zod": "^3.25.0 || ^4.0.0" }, "bin": { @@ -279,9 +279,9 @@ } }, "node_modules/@modelcontextprotocol/sdk": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.1.tgz", - "integrity": "sha512-yO28oVFFC7EBoiKdAn+VqRm+plcfv4v0xp6osG/VsCB0NlPZWi87ajbCZZ8f/RvOFLEu7//rSRmuZZ7lMoe3gQ==", + "version": "1.25.2", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.2.tgz", + "integrity": "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww==", "license": "MIT", "dependencies": { "@hono/node-server": "^1.19.7", diff --git a/package.json b/package.json index dbe4d67..29d5c2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opperai", - "version": "3.4.1", + "version": "3.4.2", "author": "Speakeasy", "repository": { "type": "git", @@ -47,7 +47,7 @@ "typescript-eslint": "^8.26.0" }, "dependencies": { - "@modelcontextprotocol/sdk": "^1.24.0", + "@modelcontextprotocol/sdk": "^1.25.2", "zod": "^3.25.0 || ^4.0.0" }, "exports": { diff --git a/src/funcs/functionsCall.ts b/src/funcs/functionsCall.ts index 7e4d888..c2845c8 100644 --- a/src/funcs/functionsCall.ts +++ b/src/funcs/functionsCall.ts @@ -35,12 +35,11 @@ import { Result } from "../types/fp.js"; export function functionsCall( client: OpperCore, functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): APIPromise< Result< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -58,7 +57,7 @@ export function functionsCall( return new APIPromise($do( client, functionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -66,13 +65,12 @@ export function functionsCall( async function $do( client: OpperCore, functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< [ Result< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -91,8 +89,7 @@ async function $do( > { const input: operations.CallFunctionFunctionsFunctionIdCallPostRequest = { functionId: functionId, - appApiPublicV2FunctionsCallFunctionRequest: - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: callFunctionRequest, }; const parsed = safeParse( @@ -106,11 +103,9 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON( - "body", - payload.app__api__public__v2__functions__CallFunctionRequest, - { explode: true }, - ); + const body = encodeJSON("body", payload.CallFunctionRequest, { + explode: true, + }); const pathParams = { function_id: encodeSimple("function_id", payload.function_id, { @@ -176,7 +171,7 @@ async function $do( }; const [result] = await M.match< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -190,10 +185,7 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json( - 200, - models.AppApiPublicV2FunctionsCallFunctionResponse$inboundSchema, - ), + M.json(200, models.CallFunctionResponse$inboundSchema), M.jsonErr(400, errors.BadRequestError$inboundSchema), M.jsonErr(401, errors.UnauthorizedError$inboundSchema), M.jsonErr(404, errors.NotFoundError$inboundSchema), diff --git a/src/funcs/functionsCallRevision.ts b/src/funcs/functionsCallRevision.ts index 64d2c55..aa59331 100644 --- a/src/funcs/functionsCallRevision.ts +++ b/src/funcs/functionsCallRevision.ts @@ -36,12 +36,11 @@ export function functionsCallRevision( client: OpperCore, functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): APIPromise< Result< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -60,7 +59,7 @@ export function functionsCallRevision( client, functionId, revisionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -69,13 +68,12 @@ async function $do( client: OpperCore, functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< [ Result< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -97,8 +95,7 @@ async function $do( { functionId: functionId, revisionId: revisionId, - appApiPublicV2FunctionsCallFunctionRequest: - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: callFunctionRequest, }; const parsed = safeParse( @@ -113,11 +110,9 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON( - "body", - payload.app__api__public__v2__functions__CallFunctionRequest, - { explode: true }, - ); + const body = encodeJSON("body", payload.CallFunctionRequest, { + explode: true, + }); const pathParams = { function_id: encodeSimple("function_id", payload.function_id, { @@ -190,7 +185,7 @@ async function $do( }; const [result] = await M.match< - models.AppApiPublicV2FunctionsCallFunctionResponse, + models.CallFunctionResponse, | errors.BadRequestError | errors.UnauthorizedError | errors.NotFoundError @@ -204,10 +199,7 @@ async function $do( | UnexpectedClientError | SDKValidationError >( - M.json( - 200, - models.AppApiPublicV2FunctionsCallFunctionResponse$inboundSchema, - ), + M.json(200, models.CallFunctionResponse$inboundSchema), M.jsonErr(400, errors.BadRequestError$inboundSchema), M.jsonErr(401, errors.UnauthorizedError$inboundSchema), M.jsonErr(404, errors.NotFoundError$inboundSchema), diff --git a/src/funcs/functionsStream.ts b/src/funcs/functionsStream.ts index 369120f..1048b23 100644 --- a/src/funcs/functionsStream.ts +++ b/src/funcs/functionsStream.ts @@ -49,8 +49,7 @@ import { Result } from "../types/fp.js"; export function functionsStream( client: OpperCore, functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): APIPromise< Result< @@ -72,7 +71,7 @@ export function functionsStream( return new APIPromise($do( client, functionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -80,8 +79,7 @@ export function functionsStream( async function $do( client: OpperCore, functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< [ @@ -106,8 +104,7 @@ async function $do( const input: operations.StreamFunctionFunctionsFunctionIdCallStreamPostRequest = { functionId: functionId, - appApiPublicV2FunctionsCallFunctionRequest: - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: callFunctionRequest, }; const parsed = safeParse( @@ -122,11 +119,9 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON( - "body", - payload.app__api__public__v2__functions__CallFunctionRequest, - { explode: true }, - ); + const body = encodeJSON("body", payload.CallFunctionRequest, { + explode: true, + }); const pathParams = { function_id: encodeSimple("function_id", payload.function_id, { diff --git a/src/funcs/functionsStreamRevision.ts b/src/funcs/functionsStreamRevision.ts index 97bce5b..a707ef1 100644 --- a/src/funcs/functionsStreamRevision.ts +++ b/src/funcs/functionsStreamRevision.ts @@ -50,8 +50,7 @@ export function functionsStreamRevision( client: OpperCore, functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): APIPromise< Result< @@ -74,7 +73,7 @@ export function functionsStreamRevision( client, functionId, revisionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -83,8 +82,7 @@ async function $do( client: OpperCore, functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< [ @@ -111,8 +109,7 @@ async function $do( { functionId: functionId, revisionId: revisionId, - appApiPublicV2FunctionsCallFunctionRequest: - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: callFunctionRequest, }; const parsed = safeParse( @@ -127,11 +124,9 @@ async function $do( return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON( - "body", - payload.app__api__public__v2__functions__CallFunctionRequest, - { explode: true }, - ); + const body = encodeJSON("body", payload.CallFunctionRequest, { + explode: true, + }); const pathParams = { function_id: encodeSimple("function_id", payload.function_id, { diff --git a/src/lib/config.ts b/src/lib/config.ts index 7d8478e..e0978b9 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "2.0.0", - sdkVersion: "3.4.1", - genVersion: "2.788.15", - userAgent: "speakeasy-sdk/typescript 3.4.1 2.788.15 2.0.0 opperai", + sdkVersion: "3.4.2", + genVersion: "2.796.4", + userAgent: "speakeasy-sdk/typescript 3.4.2 2.796.4 2.0.0 opperai", } as const; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index e90348c..f96b579 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -307,9 +307,9 @@ export class ClientSDK { } } -const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/; +const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; const jsonlLikeContentTypeRE = - /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/; + /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; async function logRequest(logger: Logger | undefined, req: Request) { if (!logger) { return; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index 8df222d..ed9ca8f 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "3.4.1", + currentVersion: "3.4.2", }, }); diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index 4513112..e3308bf 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -92,7 +92,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Opper", - version: "3.4.1", + version: "3.4.2", }); const client = new OpperCore({ diff --git a/src/mcp-server/tools/functionsCall.ts b/src/mcp-server/tools/functionsCall.ts index 819b27c..80bc4a6 100644 --- a/src/mcp-server/tools/functionsCall.ts +++ b/src/mcp-server/tools/functionsCall.ts @@ -9,8 +9,7 @@ import { formatResult, ToolDefinition } from "../tools.js"; const args = { functionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + callFunctionRequest: models.CallFunctionRequest$inboundSchema, }; export const tool$functionsCall: ToolDefinition = { @@ -23,7 +22,7 @@ Call a function`, const [result, apiCall] = await functionsCall( client, args.functionId, - args.appApiPublicV2FunctionsCallFunctionRequest, + args.callFunctionRequest, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); diff --git a/src/mcp-server/tools/functionsCallRevision.ts b/src/mcp-server/tools/functionsCallRevision.ts index 6c49ee6..929526e 100644 --- a/src/mcp-server/tools/functionsCallRevision.ts +++ b/src/mcp-server/tools/functionsCallRevision.ts @@ -10,8 +10,7 @@ import { formatResult, ToolDefinition } from "../tools.js"; const args = { functionId: z.string(), revisionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + callFunctionRequest: models.CallFunctionRequest$inboundSchema, }; export const tool$functionsCallRevision: ToolDefinition = { @@ -25,7 +24,7 @@ Call a function`, client, args.functionId, args.revisionId, - args.appApiPublicV2FunctionsCallFunctionRequest, + args.callFunctionRequest, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); diff --git a/src/mcp-server/tools/functionsStream.ts b/src/mcp-server/tools/functionsStream.ts index 996c7a0..9cb4dfb 100644 --- a/src/mcp-server/tools/functionsStream.ts +++ b/src/mcp-server/tools/functionsStream.ts @@ -9,8 +9,7 @@ import { formatResult, ToolDefinition } from "../tools.js"; const args = { functionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + callFunctionRequest: models.CallFunctionRequest$inboundSchema, }; export const tool$functionsStream: ToolDefinition = { @@ -37,7 +36,7 @@ The data payload includes: const [result, apiCall] = await functionsStream( client, args.functionId, - args.appApiPublicV2FunctionsCallFunctionRequest, + args.callFunctionRequest, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); diff --git a/src/mcp-server/tools/functionsStreamRevision.ts b/src/mcp-server/tools/functionsStreamRevision.ts index d65a421..1aa9ba8 100644 --- a/src/mcp-server/tools/functionsStreamRevision.ts +++ b/src/mcp-server/tools/functionsStreamRevision.ts @@ -10,8 +10,7 @@ import { formatResult, ToolDefinition } from "../tools.js"; const args = { functionId: z.string(), revisionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + callFunctionRequest: models.CallFunctionRequest$inboundSchema, }; export const tool$functionsStreamRevision: ToolDefinition = { @@ -39,7 +38,7 @@ The data payload includes: client, args.functionId, args.revisionId, - args.appApiPublicV2FunctionsCallFunctionRequest, + args.callFunctionRequest, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); diff --git a/src/models/appapipublicv2functionscallfunctionrequest.ts b/src/models/appapipublicv2functionscallfunctionrequest.ts deleted file mode 100644 index eb1583a..0000000 --- a/src/models/appapipublicv2functionscallfunctionrequest.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; -import { - ExampleIn, - ExampleIn$inboundSchema, - ExampleIn$Outbound, - ExampleIn$outboundSchema, -} from "./examplein.js"; - -export type AppApiPublicV2FunctionsCallFunctionRequest = { - /** - * Input to the function - */ - input?: any | null | undefined; - parentSpanId?: string | null | undefined; - examples?: Array | null | undefined; - /** - * Tags to add to the call event - */ - tags?: { [k: string]: string } | null | undefined; -}; - -/** @internal */ -export const AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema: - z.ZodType = - z.object({ - input: z.nullable(z.any()).optional(), - parent_span_id: z.nullable(z.string()).optional(), - examples: z.nullable(z.array(ExampleIn$inboundSchema)).optional(), - tags: z.nullable(z.record(z.string())).optional(), - }).transform((v) => { - return remap$(v, { - "parent_span_id": "parentSpanId", - }); - }); -/** @internal */ -export type AppApiPublicV2FunctionsCallFunctionRequest$Outbound = { - input?: any | null | undefined; - parent_span_id?: string | null | undefined; - examples?: Array | null | undefined; - tags?: { [k: string]: string } | null | undefined; -}; - -/** @internal */ -export const AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema: - z.ZodType< - AppApiPublicV2FunctionsCallFunctionRequest$Outbound, - z.ZodTypeDef, - AppApiPublicV2FunctionsCallFunctionRequest - > = z.object({ - input: z.nullable(z.any()).optional(), - parentSpanId: z.nullable(z.string()).optional(), - examples: z.nullable(z.array(ExampleIn$outboundSchema)).optional(), - tags: z.nullable(z.record(z.string())).optional(), - }).transform((v) => { - return remap$(v, { - parentSpanId: "parent_span_id", - }); - }); - -export function appApiPublicV2FunctionsCallFunctionRequestToJSON( - appApiPublicV2FunctionsCallFunctionRequest: - AppApiPublicV2FunctionsCallFunctionRequest, -): string { - return JSON.stringify( - AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema.parse( - appApiPublicV2FunctionsCallFunctionRequest, - ), - ); -} -export function appApiPublicV2FunctionsCallFunctionRequestFromJSON( - jsonString: string, -): SafeParseResult< - AppApiPublicV2FunctionsCallFunctionRequest, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'AppApiPublicV2FunctionsCallFunctionRequest' from JSON`, - ); -} diff --git a/src/models/appapipublicv2functionscallfunctionresponse.ts b/src/models/appapipublicv2functionscallfunctionresponse.ts deleted file mode 100644 index bdc3b95..0000000 --- a/src/models/appapipublicv2functionscallfunctionresponse.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { Result as SafeParseResult } from "../types/fp.js"; -import { SDKValidationError } from "./errors/sdkvalidationerror.js"; - -export type AppApiPublicV2FunctionsCallFunctionResponse = { - /** - * The ID of the span of the call - */ - spanId: string; - /** - * Result of the task if the call does not use an output schema - */ - message?: string | null | undefined; - /** - * Result of the task if the call uses an output schema - */ - jsonPayload?: any | null | undefined; - /** - * True if the result was returned from a cached results - */ - cached?: boolean | undefined; - /** - * The images generated by the call. Only available for image models. Depending on the configuration, the response can either be a list of image urls or a base64 encoded images. - */ - images?: Array | null | undefined; - /** - * The usage of the call split into input and output tokens as well as the total tokens and an optional breakdown of the input and output tokens.The input tokens are the tokens sent to the model and the output tokens are the tokens received from the model. The total tokens is the sum of input and output tokens. - */ - usage?: { [k: string]: any } | null | undefined; - /** - * The cost in USD of the call split into total, generation and platform costs where total is the sum of generation and platform costs - */ - cost?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const AppApiPublicV2FunctionsCallFunctionResponse$inboundSchema: - z.ZodType< - AppApiPublicV2FunctionsCallFunctionResponse, - z.ZodTypeDef, - unknown - > = z.object({ - span_id: z.string(), - message: z.nullable(z.string()).optional(), - json_payload: z.nullable(z.any()).optional(), - cached: z.boolean().default(false), - images: z.nullable(z.array(z.string())).optional(), - usage: z.nullable(z.record(z.any())).optional(), - cost: z.nullable(z.record(z.any())).optional(), - }).transform((v) => { - return remap$(v, { - "span_id": "spanId", - "json_payload": "jsonPayload", - }); - }); -/** @internal */ -export type AppApiPublicV2FunctionsCallFunctionResponse$Outbound = { - span_id: string; - message?: string | null | undefined; - json_payload?: any | null | undefined; - cached: boolean; - images?: Array | null | undefined; - usage?: { [k: string]: any } | null | undefined; - cost?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const AppApiPublicV2FunctionsCallFunctionResponse$outboundSchema: - z.ZodType< - AppApiPublicV2FunctionsCallFunctionResponse$Outbound, - z.ZodTypeDef, - AppApiPublicV2FunctionsCallFunctionResponse - > = z.object({ - spanId: z.string(), - message: z.nullable(z.string()).optional(), - jsonPayload: z.nullable(z.any()).optional(), - cached: z.boolean().default(false), - images: z.nullable(z.array(z.string())).optional(), - usage: z.nullable(z.record(z.any())).optional(), - cost: z.nullable(z.record(z.any())).optional(), - }).transform((v) => { - return remap$(v, { - spanId: "span_id", - jsonPayload: "json_payload", - }); - }); - -export function appApiPublicV2FunctionsCallFunctionResponseToJSON( - appApiPublicV2FunctionsCallFunctionResponse: - AppApiPublicV2FunctionsCallFunctionResponse, -): string { - return JSON.stringify( - AppApiPublicV2FunctionsCallFunctionResponse$outboundSchema.parse( - appApiPublicV2FunctionsCallFunctionResponse, - ), - ); -} -export function appApiPublicV2FunctionsCallFunctionResponseFromJSON( - jsonString: string, -): SafeParseResult< - AppApiPublicV2FunctionsCallFunctionResponse, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - AppApiPublicV2FunctionsCallFunctionResponse$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'AppApiPublicV2FunctionsCallFunctionResponse' from JSON`, - ); -} diff --git a/src/models/callfunctionrequest.ts b/src/models/callfunctionrequest.ts new file mode 100644 index 0000000..7128d0a --- /dev/null +++ b/src/models/callfunctionrequest.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; +import { + ExampleIn, + ExampleIn$inboundSchema, + ExampleIn$Outbound, + ExampleIn$outboundSchema, +} from "./examplein.js"; + +export type CallFunctionRequest = { + /** + * Input to the function + */ + input?: any | null | undefined; + parentSpanId?: string | null | undefined; + examples?: Array | null | undefined; + /** + * Tags to add to the call event + */ + tags?: { [k: string]: string } | null | undefined; +}; + +/** @internal */ +export const CallFunctionRequest$inboundSchema: z.ZodType< + CallFunctionRequest, + z.ZodTypeDef, + unknown +> = z.object({ + input: z.nullable(z.any()).optional(), + parent_span_id: z.nullable(z.string()).optional(), + examples: z.nullable(z.array(ExampleIn$inboundSchema)).optional(), + tags: z.nullable(z.record(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + "parent_span_id": "parentSpanId", + }); +}); +/** @internal */ +export type CallFunctionRequest$Outbound = { + input?: any | null | undefined; + parent_span_id?: string | null | undefined; + examples?: Array | null | undefined; + tags?: { [k: string]: string } | null | undefined; +}; + +/** @internal */ +export const CallFunctionRequest$outboundSchema: z.ZodType< + CallFunctionRequest$Outbound, + z.ZodTypeDef, + CallFunctionRequest +> = z.object({ + input: z.nullable(z.any()).optional(), + parentSpanId: z.nullable(z.string()).optional(), + examples: z.nullable(z.array(ExampleIn$outboundSchema)).optional(), + tags: z.nullable(z.record(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + parentSpanId: "parent_span_id", + }); +}); + +export function callFunctionRequestToJSON( + callFunctionRequest: CallFunctionRequest, +): string { + return JSON.stringify( + CallFunctionRequest$outboundSchema.parse(callFunctionRequest), + ); +} +export function callFunctionRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CallFunctionRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CallFunctionRequest' from JSON`, + ); +} diff --git a/src/models/callfunctionresponse.ts b/src/models/callfunctionresponse.ts new file mode 100644 index 0000000..d161c29 --- /dev/null +++ b/src/models/callfunctionresponse.ts @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { Result as SafeParseResult } from "../types/fp.js"; +import { SDKValidationError } from "./errors/sdkvalidationerror.js"; + +export type CallFunctionResponse = { + /** + * The ID of the span of the call + */ + spanId: string; + /** + * Result of the task if the call does not use an output schema + */ + message?: string | null | undefined; + /** + * Result of the task if the call uses an output schema + */ + jsonPayload?: any | null | undefined; + /** + * True if the result was returned from a cached results + */ + cached?: boolean | undefined; + /** + * The images generated by the call. Only available for image models. Depending on the configuration, the response can either be a list of image urls or a base64 encoded images. + */ + images?: Array | null | undefined; + /** + * The usage of the call split into input and output tokens as well as the total tokens and an optional breakdown of the input and output tokens.The input tokens are the tokens sent to the model and the output tokens are the tokens received from the model. The total tokens is the sum of input and output tokens. + */ + usage?: { [k: string]: any } | null | undefined; + /** + * The cost in USD of the call split into total, generation and platform costs where total is the sum of generation and platform costs + */ + cost?: { [k: string]: any } | null | undefined; +}; + +/** @internal */ +export const CallFunctionResponse$inboundSchema: z.ZodType< + CallFunctionResponse, + z.ZodTypeDef, + unknown +> = z.object({ + span_id: z.string(), + message: z.nullable(z.string()).optional(), + json_payload: z.nullable(z.any()).optional(), + cached: z.boolean().default(false), + images: z.nullable(z.array(z.string())).optional(), + usage: z.nullable(z.record(z.any())).optional(), + cost: z.nullable(z.record(z.any())).optional(), +}).transform((v) => { + return remap$(v, { + "span_id": "spanId", + "json_payload": "jsonPayload", + }); +}); +/** @internal */ +export type CallFunctionResponse$Outbound = { + span_id: string; + message?: string | null | undefined; + json_payload?: any | null | undefined; + cached: boolean; + images?: Array | null | undefined; + usage?: { [k: string]: any } | null | undefined; + cost?: { [k: string]: any } | null | undefined; +}; + +/** @internal */ +export const CallFunctionResponse$outboundSchema: z.ZodType< + CallFunctionResponse$Outbound, + z.ZodTypeDef, + CallFunctionResponse +> = z.object({ + spanId: z.string(), + message: z.nullable(z.string()).optional(), + jsonPayload: z.nullable(z.any()).optional(), + cached: z.boolean().default(false), + images: z.nullable(z.array(z.string())).optional(), + usage: z.nullable(z.record(z.any())).optional(), + cost: z.nullable(z.record(z.any())).optional(), +}).transform((v) => { + return remap$(v, { + spanId: "span_id", + jsonPayload: "json_payload", + }); +}); + +export function callFunctionResponseToJSON( + callFunctionResponse: CallFunctionResponse, +): string { + return JSON.stringify( + CallFunctionResponse$outboundSchema.parse(callFunctionResponse), + ); +} +export function callFunctionResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CallFunctionResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CallFunctionResponse' from JSON`, + ); +} diff --git a/src/models/index.ts b/src/models/index.ts index 60b3a6a..0f71983 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -7,10 +7,10 @@ export * from "./annotation.js"; export * from "./annotationurlcitation.js"; export * from "./appapipublicv2functioncallcallfunctionrequest.js"; export * from "./appapipublicv2functioncallcallfunctionresponse.js"; -export * from "./appapipublicv2functionscallfunctionrequest.js"; -export * from "./appapipublicv2functionscallfunctionresponse.js"; export * from "./audio.js"; export * from "./bodyuploadfileknowledgeknowledgebaseiduploadpost.js"; +export * from "./callfunctionrequest.js"; +export * from "./callfunctionresponse.js"; export * from "./chatcompletion.js"; export * from "./chatcompletionallowedtoolchoiceparam.js"; export * from "./chatcompletionallowedtoolsparam.js"; diff --git a/src/models/operations/callfunctionfunctionsfunctionidcallpost.ts b/src/models/operations/callfunctionfunctionsfunctionidcallpost.ts index 3c0b1ae..67fabc5 100644 --- a/src/models/operations/callfunctionfunctionsfunctionidcallpost.ts +++ b/src/models/operations/callfunctionfunctionsfunctionidcallpost.ts @@ -14,8 +14,7 @@ export type CallFunctionFunctionsFunctionIdCallPostRequest = { * The id of the function to call */ functionId: string; - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest; + callFunctionRequest: models.CallFunctionRequest; }; /** @internal */ @@ -26,20 +25,17 @@ export const CallFunctionFunctionsFunctionIdCallPostRequest$inboundSchema: unknown > = z.object({ function_id: z.string(), - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + CallFunctionRequest: models.CallFunctionRequest$inboundSchema, }).transform((v) => { return remap$(v, { "function_id": "functionId", - "app__api__public__v2__functions__CallFunctionRequest": - "appApiPublicV2FunctionsCallFunctionRequest", + "CallFunctionRequest": "callFunctionRequest", }); }); /** @internal */ export type CallFunctionFunctionsFunctionIdCallPostRequest$Outbound = { function_id: string; - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$Outbound; + CallFunctionRequest: models.CallFunctionRequest$Outbound; }; /** @internal */ @@ -50,13 +46,11 @@ export const CallFunctionFunctionsFunctionIdCallPostRequest$outboundSchema: CallFunctionFunctionsFunctionIdCallPostRequest > = z.object({ functionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema, + callFunctionRequest: models.CallFunctionRequest$outboundSchema, }).transform((v) => { return remap$(v, { functionId: "function_id", - appApiPublicV2FunctionsCallFunctionRequest: - "app__api__public__v2__functions__CallFunctionRequest", + callFunctionRequest: "CallFunctionRequest", }); }); diff --git a/src/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.ts b/src/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.ts index d50137f..27867fa 100644 --- a/src/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.ts +++ b/src/models/operations/callfunctionrevisionfunctionsfunctionidcallrevisionidpost.ts @@ -18,8 +18,7 @@ export type CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest = { * The id of the revision to call */ revisionId: string; - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest; + callFunctionRequest: models.CallFunctionRequest; }; /** @internal */ @@ -31,14 +30,12 @@ export const CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest$in > = z.object({ function_id: z.string(), revision_id: z.string(), - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + CallFunctionRequest: models.CallFunctionRequest$inboundSchema, }).transform((v) => { return remap$(v, { "function_id": "functionId", "revision_id": "revisionId", - "app__api__public__v2__functions__CallFunctionRequest": - "appApiPublicV2FunctionsCallFunctionRequest", + "CallFunctionRequest": "callFunctionRequest", }); }); /** @internal */ @@ -46,8 +43,7 @@ export type CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest$Out { function_id: string; revision_id: string; - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$Outbound; + CallFunctionRequest: models.CallFunctionRequest$Outbound; }; /** @internal */ @@ -59,14 +55,12 @@ export const CallFunctionRevisionFunctionsFunctionIdCallRevisionIdPostRequest$ou > = z.object({ functionId: z.string(), revisionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema, + callFunctionRequest: models.CallFunctionRequest$outboundSchema, }).transform((v) => { return remap$(v, { functionId: "function_id", revisionId: "revision_id", - appApiPublicV2FunctionsCallFunctionRequest: - "app__api__public__v2__functions__CallFunctionRequest", + callFunctionRequest: "CallFunctionRequest", }); }); diff --git a/src/models/operations/streamfunctionfunctionsfunctionidcallstreampost.ts b/src/models/operations/streamfunctionfunctionsfunctionidcallstreampost.ts index c5e2092..7e5c406 100644 --- a/src/models/operations/streamfunctionfunctionsfunctionidcallstreampost.ts +++ b/src/models/operations/streamfunctionfunctionsfunctionidcallstreampost.ts @@ -15,8 +15,7 @@ export type StreamFunctionFunctionsFunctionIdCallStreamPostRequest = { * The id of the function to call */ functionId: string; - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest; + callFunctionRequest: models.CallFunctionRequest; }; /** @@ -70,20 +69,17 @@ export const StreamFunctionFunctionsFunctionIdCallStreamPostRequest$inboundSchem unknown > = z.object({ function_id: z.string(), - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + CallFunctionRequest: models.CallFunctionRequest$inboundSchema, }).transform((v) => { return remap$(v, { "function_id": "functionId", - "app__api__public__v2__functions__CallFunctionRequest": - "appApiPublicV2FunctionsCallFunctionRequest", + "CallFunctionRequest": "callFunctionRequest", }); }); /** @internal */ export type StreamFunctionFunctionsFunctionIdCallStreamPostRequest$Outbound = { function_id: string; - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$Outbound; + CallFunctionRequest: models.CallFunctionRequest$Outbound; }; /** @internal */ @@ -94,13 +90,11 @@ export const StreamFunctionFunctionsFunctionIdCallStreamPostRequest$outboundSche StreamFunctionFunctionsFunctionIdCallStreamPostRequest > = z.object({ functionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema, + callFunctionRequest: models.CallFunctionRequest$outboundSchema, }).transform((v) => { return remap$(v, { functionId: "function_id", - appApiPublicV2FunctionsCallFunctionRequest: - "app__api__public__v2__functions__CallFunctionRequest", + callFunctionRequest: "CallFunctionRequest", }); }); diff --git a/src/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.ts b/src/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.ts index e4a05ea..a164f57 100644 --- a/src/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.ts +++ b/src/models/operations/streamfunctionrevisionfunctionsfunctionidcallstreamrevisionidpost.ts @@ -20,8 +20,7 @@ export type StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostReq * The id of the revision to call */ revisionId: string; - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest; + callFunctionRequest: models.CallFunctionRequest; }; /** @@ -79,14 +78,12 @@ export const StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostRe > = z.object({ function_id: z.string(), revision_id: z.string(), - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$inboundSchema, + CallFunctionRequest: models.CallFunctionRequest$inboundSchema, }).transform((v) => { return remap$(v, { "function_id": "functionId", "revision_id": "revisionId", - "app__api__public__v2__functions__CallFunctionRequest": - "appApiPublicV2FunctionsCallFunctionRequest", + "CallFunctionRequest": "callFunctionRequest", }); }); /** @internal */ @@ -94,8 +91,7 @@ export type StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostReq { function_id: string; revision_id: string; - app__api__public__v2__functions__CallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$Outbound; + CallFunctionRequest: models.CallFunctionRequest$Outbound; }; /** @internal */ @@ -107,14 +103,12 @@ export const StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostRe > = z.object({ functionId: z.string(), revisionId: z.string(), - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest$outboundSchema, + callFunctionRequest: models.CallFunctionRequest$outboundSchema, }).transform((v) => { return remap$(v, { functionId: "function_id", revisionId: "revision_id", - appApiPublicV2FunctionsCallFunctionRequest: - "app__api__public__v2__functions__CallFunctionRequest", + callFunctionRequest: "CallFunctionRequest", }); }); diff --git a/src/sdk/functions.ts b/src/sdk/functions.ts index 062812a..3bb6366 100644 --- a/src/sdk/functions.ts +++ b/src/sdk/functions.ts @@ -162,14 +162,13 @@ export class Functions extends ClientSDK { */ async call( functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, - ): Promise { + ): Promise { return unwrapAsync(functionsCall( this, functionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -196,8 +195,7 @@ export class Functions extends ClientSDK { */ async stream( functionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< operations.StreamFunctionFunctionsFunctionIdCallStreamPostResponse @@ -205,7 +203,7 @@ export class Functions extends ClientSDK { return unwrapAsync(functionsStream( this, functionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -219,15 +217,14 @@ export class Functions extends ClientSDK { async callRevision( functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, - ): Promise { + ): Promise { return unwrapAsync(functionsCallRevision( this, functionId, revisionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); } @@ -255,8 +252,7 @@ export class Functions extends ClientSDK { async streamRevision( functionId: string, revisionId: string, - appApiPublicV2FunctionsCallFunctionRequest: - models.AppApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest: models.CallFunctionRequest, options?: RequestOptions, ): Promise< operations.StreamFunctionRevisionFunctionsFunctionIdCallStreamRevisionIdPostResponse @@ -265,7 +261,7 @@ export class Functions extends ClientSDK { this, functionId, revisionId, - appApiPublicV2FunctionsCallFunctionRequest, + callFunctionRequest, options, )); }