diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6c8775576..b5e915730 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.1.1" + ".": "5.2.0" } diff --git a/.stats.yml b/.stats.yml index 035814eca..25b450006 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0205acb1015d29b2312a48526734c0399f93026d4fe2dff5c7768f566e333fd2.yml -openapi_spec_hash: 1772cc9056c2f6dfb2a4e9cb77ee6343 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-4865dda2b62927bd141cbc85f81be3d88602f103e2c581e15eb1caded3e3aaa2.yml +openapi_spec_hash: 7d14a9b23ef4ac93ea46d629601b6f6b config_hash: ed1e6b3c5f93d12b80d31167f55c557c diff --git a/CHANGELOG.md b/CHANGELOG.md index 6acc4963f..ae565e0ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## 5.2.0 (2025-06-09) + +Full Changelog: [v5.1.1...v5.2.0](https://github.com/openai/openai-node/compare/v5.1.1...v5.2.0) + +### Features + +* **api:** Add tools and structured outputs to evals ([64844f1](https://github.com/openai/openai-node/commit/64844f1be2da9658a603fac304d1387f28a110a4)) + + +### Bug Fixes + +* **changelog:** remove duplicated entries ([18484cc](https://github.com/openai/openai-node/commit/18484cceea615a01b62590b9b626b9e2140c7dd9)) + + +### Chores + +* avoid type error in certain environments ([44ac3d9](https://github.com/openai/openai-node/commit/44ac3d96eb258cd777edb02004763ccef253ae7a)) + + +### Documentation + +* **changelog:** reference MIGRATION.md ([b3d488f](https://github.com/openai/openai-node/commit/b3d488feff5acb020f5db6f27ea94884c56bc767)), closes [#1539](https://github.com/openai/openai-node/issues/1539) + ## 5.1.1 (2025-06-05) Full Changelog: [v5.1.0...v5.1.1](https://github.com/openai/openai-node/compare/v5.1.0...v5.1.1) @@ -53,6 +76,8 @@ Full Changelog: [v5.0.0...v5.0.1](https://github.com/openai/openai-node/compare/ ## 5.0.0 (2025-05-29) +This release migrates from node-fetch to builtin fetch, for full release notes see [MIGRATION.md](https://github.com/openai/openai-node/blob/master/MIGRATION.md). + Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/compare/v5.0.0-alpha.0...v5.0.0) ### Features @@ -61,33 +86,18 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ * add migration guide ([cfd2088](https://github.com/openai/openai-node/commit/cfd2088219464381077dec62d38d1830ab0b43f3)) * add SKIP_BREW env var to ./scripts/bootstrap ([7ea4a24](https://github.com/openai/openai-node/commit/7ea4a244d5b39e0745aea1a89abff940e2c3922f)) * **api:** add /v1/responses and built-in tools ([91af47c](https://github.com/openai/openai-node/commit/91af47cc4f62b08a451bc39f44c64244a71c1f2c)) -* **api:** add /v1/responses and built-in tools ([0612242](https://github.com/openai/openai-node/commit/06122424a4d783aff07b7089b64986fb35bc24e4)) * **api:** add `get /chat/completions` endpoint ([9697139](https://github.com/openai/openai-node/commit/9697139a5f38bcc2dffa3322ff575eb1fc8b4e35)) -* **api:** add `get /chat/completions` endpoint ([16c67be](https://github.com/openai/openai-node/commit/16c67be29bbb976660ac01d76f54e8735e71c1e0)) * **api:** add `get /responses/{response_id}/input_items` endpoint ([f2c5aba](https://github.com/openai/openai-node/commit/f2c5aba736f99550a9a7837be22b39b36a7495d0)) -* **api:** add `get /responses/{response_id}/input_items` endpoint ([3676d34](https://github.com/openai/openai-node/commit/3676d34127cd88a67dde6e6d24f2b6a7b65d3073)) * **api:** add container endpoint ([3ffca5c](https://github.com/openai/openai-node/commit/3ffca5c5b2dc6819e955ed343b2bb6e2095e7bdf)) -* **api:** add container endpoint ([e973476](https://github.com/openai/openai-node/commit/e9734764625275c50ef612ff934804be8cb2adff)) * **api:** Add evalapi to sdk ([70092d7](https://github.com/openai/openai-node/commit/70092d768426b8e0dd4bca21e7a3dea009e25b9f)) -* **api:** Add evalapi to sdk ([#1456](https://github.com/openai/openai-node/issues/1456)) ([33b66f5](https://github.com/openai/openai-node/commit/33b66f517e756e63c676efee97f7122b3cf165d1)) * **api:** add gpt-4.5-preview ([1d4478d](https://github.com/openai/openai-node/commit/1d4478d7935028e20a9d9d11ff29ff8b991c44f9)) -* **api:** add gpt-4.5-preview ([#1349](https://github.com/openai/openai-node/issues/1349)) ([bb269a1](https://github.com/openai/openai-node/commit/bb269a1a6fda11c533fb88fa1250a342a5a11ed0)) * **api:** add image sizes, reasoning encryption ([0c25021](https://github.com/openai/openai-node/commit/0c2502187f8895f029277a7be9825862f458e9aa)) -* **api:** add image sizes, reasoning encryption ([31cd88f](https://github.com/openai/openai-node/commit/31cd88fae84f630c8e86e1acab6c4cd9283c886c)) * **api:** add o3 and o4-mini model IDs ([19cda5d](https://github.com/openai/openai-node/commit/19cda5d3b908238ae6c6f5609ac3a118d4d8acc2)) -* **api:** add o3 and o4-mini model IDs ([a0d0000](https://github.com/openai/openai-node/commit/a0d000094f69db82974de4ba792cd07d4ab59c21)) * **api:** Add reinforcement fine-tuning api support ([e6bbaf5](https://github.com/openai/openai-node/commit/e6bbaf577aa6bdf3bcdaf25a5a7d4e8202831c7a)) -* **api:** Add reinforcement fine-tuning api support ([fabe6ec](https://github.com/openai/openai-node/commit/fabe6ec948c08c11588f6168f0a7560bf307d780)) * **api:** add support for storing chat completions ([59da177](https://github.com/openai/openai-node/commit/59da1771b93158d5d89efc9e63e1ef9c09a634f3)) -* **api:** add support for storing chat completions ([#1327](https://github.com/openai/openai-node/issues/1327)) ([be1ca6b](https://github.com/openai/openai-node/commit/be1ca6b9a6732214ac21ca375b5b0a9b7f492fd6)) * **api:** adding gpt-4.1 family of model IDs ([8a2a745](https://github.com/openai/openai-node/commit/8a2a7454bee0fbe9e4729d47f6b894e5f25d68f5)) -* **api:** adding gpt-4.1 family of model IDs ([840e7de](https://github.com/openai/openai-node/commit/840e7de7870835488d4c823d97afdf5d53a739be)) * **api:** adding new image model support ([a0010fd](https://github.com/openai/openai-node/commit/a0010fdb60fe723ebc70103cceca552aca51855e)) -* **api:** adding new image model support ([c353531](https://github.com/openai/openai-node/commit/c353531a238863e7f386a66dcee9f02b8115dd47)) -* **api:** Config update for pakrym-stream-param ([71c3d31](https://github.com/openai/openai-node/commit/71c3d31dad568030fd563a0b5c7c2bd26d472df1)) -* **api:** Config update for pakrym-stream-param ([b4d1b46](https://github.com/openai/openai-node/commit/b4d1b4627622157593a06f64f02ee5aa72deb6b3)) * **api:** Config update for pakrym-stream-param ([469ad7b](https://github.com/openai/openai-node/commit/469ad7b9d76b674aa3fd829128a54758ab7adfbd)) -* **api:** further updates for evals API ([3019a7e](https://github.com/openai/openai-node/commit/3019a7e67614942b5dc6d7e788f2b5b30b3bc874)) * **api:** further updates for evals API ([3f6f248](https://github.com/openai/openai-node/commit/3f6f248191b45015924be76fd5154d149c4ed8a0)) * **api:** manual updates ([debe529](https://github.com/openai/openai-node/commit/debe5295d077f79cc4b4eefefb008e5a10b32793)) * **api:** manual updates ([e83286b](https://github.com/openai/openai-node/commit/e83286b10b20d3e4c02903739b045af5cbf71cde)) @@ -101,33 +111,23 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ * **api:** manual updates ([c1c2819](https://github.com/openai/openai-node/commit/c1c281983e23dcfdca964720265d3cba28b17795)) * **api:** manual updates ([efce6d3](https://github.com/openai/openai-node/commit/efce6d3d719ad463b035b22e9a1cf461ab62b5af)) * **api:** manual updates ([32afb00](https://github.com/openai/openai-node/commit/32afb0022939b19069c37fcd9cabfe666ea86b77)) -* **api:** new API tools ([0cc8994](https://github.com/openai/openai-node/commit/0cc899456091f0b13fc98daa03a4299473f528dc)) * **api:** new API tools ([fb4014f](https://github.com/openai/openai-node/commit/fb4014ffac7b220d37bd03c94fa745386b010bf0)) -* **api:** new models for TTS, STT, + new audio features for Realtime ([1eab9ed](https://github.com/openai/openai-node/commit/1eab9edf9e5eb08e7c3d0d0ff21f378cacf7cb5b)) * **api:** new models for TTS, STT, + new audio features for Realtime ([#1407](https://github.com/openai/openai-node/issues/1407)) ([d11b13c](https://github.com/openai/openai-node/commit/d11b13cdf5412f03e551365297a27e610a36edda)) -* **api:** new streaming helpers for background responses ([c071491](https://github.com/openai/openai-node/commit/c07149125128687f026df0d04b304167cf6c9910)) * **api:** new streaming helpers for background responses ([1ddd6ff](https://github.com/openai/openai-node/commit/1ddd6ff182b09d696954fda4bde50fb82f1d6585)) -* **api:** o1-pro now available through the API ([3540b06](https://github.com/openai/openai-node/commit/3540b069fcec32ab5acbdf3def579f21759dada6)) * **api:** o1-pro now available through the API ([#1398](https://github.com/openai/openai-node/issues/1398)) ([aefd267](https://github.com/openai/openai-node/commit/aefd2675154ff848032a7fec856f0db6ed2ad629)) -* **api:** responses x eval api ([b349ade](https://github.com/openai/openai-node/commit/b349adeff0df0b6c56d937da082900e7331d1ab6)) * **api:** responses x eval api ([ea1d56c](https://github.com/openai/openai-node/commit/ea1d56c979ad7136aa584a773904b0570ba14783)) -* **api:** Updating Assistants and Evals API schemas ([e68f598](https://github.com/openai/openai-node/commit/e68f598107aba01ce1bcab61ac616d4cf70380c9)) * **api:** Updating Assistants and Evals API schemas ([8cc63d3](https://github.com/openai/openai-node/commit/8cc63d351057678d474fe1a16e3077370c83fddb)) * **client:** accept RFC6838 JSON content types ([67da9ce](https://github.com/openai/openai-node/commit/67da9ce89ea010813779b98c18fea84d9964c7de)) * **client:** add Realtime API support ([7737d25](https://github.com/openai/openai-node/commit/7737d2547c5c6c45004fe281b8122c9e2adc0efb)) * **client:** add withOptions helper ([7e9ea85](https://github.com/openai/openai-node/commit/7e9ea85f63a0989b3446834d9e1a94c0d050cf87)) * **client:** improve logging ([ead0ba4](https://github.com/openai/openai-node/commit/ead0ba4dc9f51c35007c5fe20f9954855f558652)) * **client:** promote beta completions methods to GA ([4c622f9](https://github.com/openai/openai-node/commit/4c622f9f55529e3aab30c834349d341038499db1)) -* version 5 ([855144b](https://github.com/openai/openai-node/commit/855144b105c647b91a389c08c07f215d39ff8920)) -* version 5 ([855144b](https://github.com/openai/openai-node/commit/855144b105c647b91a389c08c07f215d39ff8920)) ### Bug Fixes * **api:** add missing file rank enum + more metadata ([b943a0a](https://github.com/openai/openai-node/commit/b943a0ae4682a410172e1063a9424f5150cd9010)) -* **api:** correct some Responses types ([3ca8965](https://github.com/openai/openai-node/commit/3ca89652489e911890d0be9a2e93341ef026a20f)) * **api:** correct some Responses types ([#1391](https://github.com/openai/openai-node/issues/1391)) ([e983d0c](https://github.com/openai/openai-node/commit/e983d0c61d33b106f149d87eed90378bd0bbc349)) -* **api:** improve type resolution when importing as a package ([b6bf469](https://github.com/openai/openai-node/commit/b6bf4694cbd0ab86e7d6689289faed9ddbfb46ee)) * **api:** improve type resolution when importing as a package ([#1444](https://github.com/openai/openai-node/issues/1444)) ([4af79dd](https://github.com/openai/openai-node/commit/4af79ddd5b19925fa09d9ae877470aa8304535c2)) * **assistants:** handle `thread.run.incomplete` event ([a2714bb](https://github.com/openai/openai-node/commit/a2714bb5253ade80cb15455ceb8f6dbea63cb1d0)) * **audio:** correctly handle transcription streaming ([9c7d352](https://github.com/openai/openai-node/commit/9c7d352181c690156e26c9538c00edff6db5b384)) @@ -167,17 +167,12 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ * **jsr:** correct zod config ([04e30c0](https://github.com/openai/openai-node/commit/04e30c03ce0496a718aebf4cc2daac82ebba1ddb)) * **jsr:** export realtime helpers ([0ea64eb](https://github.com/openai/openai-node/commit/0ea64eb2bde99e243761ea2e3d9d3c294c9f7fbc)) * **jsr:** export zod helpers ([77e1180](https://github.com/openai/openai-node/commit/77e118082334710cab361efb95934422e4db6b18)) -* **mcp:** remove unused tools.ts ([752f4f1](https://github.com/openai/openai-node/commit/752f4f182116df46e4e25d6f94dcffbe504b89fd)) * **mcp:** remove unused tools.ts ([#1445](https://github.com/openai/openai-node/issues/1445)) ([4ba9947](https://github.com/openai/openai-node/commit/4ba994773b41a3ed05a3ad908b235fc5f3810dfc)) -* optimize sse chunk reading off-by-one error ([a7effe8](https://github.com/openai/openai-node/commit/a7effe8ba3a65a535ae082d3d4e0d639aba7b7c1)) * optimize sse chunk reading off-by-one error ([#1339](https://github.com/openai/openai-node/issues/1339)) ([b0b4189](https://github.com/openai/openai-node/commit/b0b4189420e1c5bb5fc4bbb8925f88fe65f9b217)) -* **package:** add chat/completions.ts back in ([#1333](https://github.com/openai/openai-node/issues/1333)) ([ee34833](https://github.com/openai/openai-node/commit/ee34833b6d097bda278ea07d261527e0bf51bf65)) * **package:** add chat/completions.ts back in ([#1333](https://github.com/openai/openai-node/issues/1333)) ([1f38cc1](https://github.com/openai/openai-node/commit/1f38cc1976f4091a90a38d49e6ddc1c22e5c39ab)) -* **parsing:** remove tool_calls default empty array ([#1341](https://github.com/openai/openai-node/issues/1341)) ([40e8dd2](https://github.com/openai/openai-node/commit/40e8dd2de0329c6cff53717d49c6e07852b352e2)) * **parsing:** remove tool_calls default empty array ([#1341](https://github.com/openai/openai-node/issues/1341)) ([6d056bf](https://github.com/openai/openai-node/commit/6d056bf95c9be4046decf20ec4c98dfa2bea2723)) * **realtime:** call .toString() on WebSocket url ([#1324](https://github.com/openai/openai-node/issues/1324)) ([6e9444c](https://github.com/openai/openai-node/commit/6e9444c6c77a93ff4ce06bd5b27a9c236ba6f307)) * **responses:** correct computer use enum value ([66fb815](https://github.com/openai/openai-node/commit/66fb8157217de604d7f535e917b085fa8b6754d4)) -* **responses:** correct reasoning output type ([1698b95](https://github.com/openai/openai-node/commit/1698b95af215ed5a3f0fcf512779efe89a95d4d2)) * **responses:** correct reasoning output type ([9cb9576](https://github.com/openai/openai-node/commit/9cb95763cab5678c5098b37ad0fe1ec83d2c1cb7)) * **responses:** correctly add output_text ([8ae07cc](https://github.com/openai/openai-node/commit/8ae07cc036895529a028134451fe2ab5c1661871)) * **responses:** support streaming retrieve calls ([657807c](https://github.com/openai/openai-node/commit/657807c2d7cbf2c6fc9a92ce98bb7295bb156326)) @@ -190,7 +185,6 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ * **types:** export AssistantStream ([#1472](https://github.com/openai/openai-node/issues/1472)) ([bc492ba](https://github.com/openai/openai-node/commit/bc492ba124cddd545eec7a1199712452c573a7a4)) * **types:** export ParseableToolsParams ([#1486](https://github.com/openai/openai-node/issues/1486)) ([3e7c92c](https://github.com/openai/openai-node/commit/3e7c92c8a76c1f747610d63d9d69a88b796ee9fc)) * **types:** ignore missing `id` in responses pagination ([d2be74a](https://github.com/openai/openai-node/commit/d2be74a28dec48cd7d88db88af95e8bc608cdede)) -* **types:** improve responses type names ([96ed4db](https://github.com/openai/openai-node/commit/96ed4dbd0c142d30d6cf80c2f850e77e02bd47a4)) * **types:** improve responses type names ([#1392](https://github.com/openai/openai-node/issues/1392)) ([4548326](https://github.com/openai/openai-node/commit/454832606ebe9d5cf8ffd436eac09375f682c495)) * **zod:** warn on optional field usage ([#1469](https://github.com/openai/openai-node/issues/1469)) ([aea2d12](https://github.com/openai/openai-node/commit/aea2d123d200e6a7eae11e66583127270a8db8bf)) @@ -203,94 +197,63 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ ### Chores * add hash of OpenAPI spec/config inputs to .stats.yml ([1b0a94d](https://github.com/openai/openai-node/commit/1b0a94d088c2891fcad0ca0de3a1e4e205a7c9cf)) -* add hash of OpenAPI spec/config inputs to .stats.yml ([48921aa](https://github.com/openai/openai-node/commit/48921aaabc3456408907e4bcf1cc074a9228c459)) * add missing type alias exports ([5d75cb9](https://github.com/openai/openai-node/commit/5d75cb95019ae77eafb0c878b355f09a1f87c3bd)) -* add missing type alias exports ([#1390](https://github.com/openai/openai-node/issues/1390)) ([f4647cc](https://github.com/openai/openai-node/commit/f4647cc7546d06145bf34113be22aabbd1b7e7ee)) * **api:** updates to supported Voice IDs ([28130c7](https://github.com/openai/openai-node/commit/28130c7fe172dd90fcf2036dc72750e485e42645)) -* **api:** updates to supported Voice IDs ([#1424](https://github.com/openai/openai-node/issues/1424)) ([fb0e96a](https://github.com/openai/openai-node/commit/fb0e96a7fa8c020ac6109951bb36f9a4ada24d03)) * **ci:** add timeout thresholds for CI jobs ([5775451](https://github.com/openai/openai-node/commit/5775451a55212687ba998b332c1394528d98121f)) -* **ci:** add timeout thresholds for CI jobs ([939f636](https://github.com/openai/openai-node/commit/939f6365c304c037e0473207d85bbc2f2731b105)) * **ci:** bump node version for release workflows ([bbf5d45](https://github.com/openai/openai-node/commit/bbf5d45259a8bfba62e2217955597ec0f6cfead4)) * **ci:** only use depot for staging repos ([c59c3b5](https://github.com/openai/openai-node/commit/c59c3b5ead95b424b27c8c9f2120ad4283fb280e)) -* **ci:** only use depot for staging repos ([214da39](https://github.com/openai/openai-node/commit/214da398c76f46d40994665f3ca7e10e203e9579)) * **ci:** run on more branches and use depot runners ([e17a4f8](https://github.com/openai/openai-node/commit/e17a4f8e1fc3de02c953421debf39827ea72d52c)) -* **ci:** run on more branches and use depot runners ([ead76fc](https://github.com/openai/openai-node/commit/ead76fc6429ac52a1c8b008ac5c0afcefaa0bae5)) * **client:** drop support for EOL node versions ([a326944](https://github.com/openai/openai-node/commit/a326944e8a8822bc70f86d7046de3142f9dff530)) * **client:** expose headers on some streaming errors ([#1423](https://github.com/openai/openai-node/issues/1423)) ([6c93a23](https://github.com/openai/openai-node/commit/6c93a23b79f335a21c65b52d1192890a5325ed6d)) * **client:** minor internal fixes ([5032c28](https://github.com/openai/openai-node/commit/5032c2802bd51885270badf47e27768f62240d25)) -* **client:** minor internal fixes ([6558b7c](https://github.com/openai/openai-node/commit/6558b7ca8aef2f98f47a07bc206eb4a789097510)) * **client:** more accurate streaming errors ([0c21914](https://github.com/openai/openai-node/commit/0c21914d90b0ef1073d99c539cf9ef18912b8d0b)) * **client:** move misc public files to new `core/` directory, deprecate old paths ([38c9d54](https://github.com/openai/openai-node/commit/38c9d548fded9000cde85270b38085c61905b5c1)) * **client:** only accept standard types for file uploads ([53e35c8](https://github.com/openai/openai-node/commit/53e35c8b10a8e3ef95c0d644d59ab915225b8114)) * deprecate Assistants API ([0be23b9](https://github.com/openai/openai-node/commit/0be23b98b6be9f8922d035270b1c907307010a29)) -* deprecate Assistants API ([1726e6b](https://github.com/openai/openai-node/commit/1726e6bfe0f4e83db79ac2f2939b4131d797b42a)) -* deprecate Assistants API ([5b34fcd](https://github.com/openai/openai-node/commit/5b34fcdd1454b8cccbaaf05ace6516afb3b09273)) -* **docs:** add missing deprecation warnings ([5495529](https://github.com/openai/openai-node/commit/54955295ff5c7ab0fecb522b3aaadaaecb229d51)) * **docs:** add missing deprecation warnings ([995075b](https://github.com/openai/openai-node/commit/995075b632051b5bb33c0381056107b2fe93931e)) -* **docs:** grammar improvements ([d5d62b0](https://github.com/openai/openai-node/commit/d5d62b0c45273e746e25e389c0e268f3f463eec1)) * **docs:** grammar improvements ([7761cfb](https://github.com/openai/openai-node/commit/7761cfb0a8a56d056a73c046a6a613f66ada4abe)) * **docs:** improve docs for withResponse/asResponse ([9f4c30b](https://github.com/openai/openai-node/commit/9f4c30b9bcc2f373b3087dba69bd837f96f79d81)) * **docs:** improve migration doc ([732d870](https://github.com/openai/openai-node/commit/732d87001cbd9aa095e7b58dc843e86547e3f510)) * **docs:** update zod tool call example, fix azure tests ([f18ced8](https://github.com/openai/openai-node/commit/f18ced883e4b5d689e0569d9b163b1958688b669)) -* **exports:** cleaner resource index imports ([0da1c16](https://github.com/openai/openai-node/commit/0da1c1653896f872b9f17e8a3248c8206994c535)) * **exports:** cleaner resource index imports ([#1396](https://github.com/openai/openai-node/issues/1396)) ([023d106](https://github.com/openai/openai-node/commit/023d106185abf62f892bff66faf617eb45777004)) * **exports:** stop using path fallbacks ([09af7ff](https://github.com/openai/openai-node/commit/09af7ffd42458c6c26d9325060fcb8925aca7c81)) * **exports:** stop using path fallbacks ([#1397](https://github.com/openai/openai-node/issues/1397)) ([7c3d212](https://github.com/openai/openai-node/commit/7c3d212b47ee3090f5bbb82dd21026ba532da6e0)) * fix example types ([20f179d](https://github.com/openai/openai-node/commit/20f179db1bb681db5d1a91adcaab16012d6ffcdf)) -* improve publish-npm script --latest tag logic ([6d3cc5c](https://github.com/openai/openai-node/commit/6d3cc5c99ba005c39a1550b30c4243ba454b9cb1)) -* improve publish-npm script --latest tag logic ([1f59811](https://github.com/openai/openai-node/commit/1f59811d1c5616ff949e01cb2f90cfc62fdefc7e)) * improve publish-npm script --latest tag logic ([6207a2a](https://github.com/openai/openai-node/commit/6207a2a03d3279423de594eed18c5efb4ce321af)) -* **internal:** add aliases for Record and Array ([8957ff4](https://github.com/openai/openai-node/commit/8957ff47e6dc6cbaf750482c76929e99e5eca48c)) * **internal:** add aliases for Record and Array ([#1443](https://github.com/openai/openai-node/issues/1443)) ([1cb66b6](https://github.com/openai/openai-node/commit/1cb66b6ccbcecaa6e48b90d37d8cac4840bb69a4)) * **internal:** add back release workflow ([ca6266e](https://github.com/openai/openai-node/commit/ca6266eea5229056a3bc2b5e4225b9ea9eaa459e)) * **internal:** add Bun.File ecosystem test ([cb4194f](https://github.com/openai/openai-node/commit/cb4194f08a2dcb4fc4231bf1b74ed5d6e0aca435)) -* **internal:** add missing return type annotation ([00ce31b](https://github.com/openai/openai-node/commit/00ce31bb6248002b0e575db2dfdd5c4bbbbcb37d)) * **internal:** add missing return type annotation ([#1334](https://github.com/openai/openai-node/issues/1334)) ([13aab10](https://github.com/openai/openai-node/commit/13aab101588c2eee1250d7c50b2abfeca1c5fa3d)) * **internal:** add proxy ecosystem tests ([619711a](https://github.com/openai/openai-node/commit/619711ae0da5243c64c266d615703279f7651f58)) * **internal:** bump migration cli version ([a899c97](https://github.com/openai/openai-node/commit/a899c9748de17ef468a03a97b9ed82124189ff4c)) -* **internal:** codegen related update ([fa48353](https://github.com/openai/openai-node/commit/fa48353ffd03bfa2fb81ee16a9fb5fae0b0073c1)) * **internal:** codegen related update ([c735a3c](https://github.com/openai/openai-node/commit/c735a3c24ac8255df50f89c519fb7dfc617db045)) -* **internal:** fix devcontainers setup ([873e273](https://github.com/openai/openai-node/commit/873e273b8c4e4e7f45feec466896b7e5ce0d8577)) * **internal:** fix devcontainers setup ([#1343](https://github.com/openai/openai-node/issues/1343)) ([9485f5d](https://github.com/openai/openai-node/commit/9485f5d4d6718bff7f579223c9aa528898451533)) * **internal:** fix eslint ignores ([ad5a9b6](https://github.com/openai/openai-node/commit/ad5a9b6f07002df70764f1b9e5d6cd675eba87ea)) -* **internal:** fix examples ([db23ff3](https://github.com/openai/openai-node/commit/db23ff3a179229557de07eefcda879492435b572)) * **internal:** fix examples ([#1457](https://github.com/openai/openai-node/issues/1457)) ([a100f0a](https://github.com/openai/openai-node/commit/a100f0a0e1d336f8a78c8bbd9e3703cda3f0c5d8)) * **internal:** fix format script ([3e1ea40](https://github.com/openai/openai-node/commit/3e1ea4063327ac34f4f46536600a8923f96dbbb0)) * **internal:** fix formatting ([6469d53](https://github.com/openai/openai-node/commit/6469d5323b653f19e90a7470d81c914c640c6f8b)) * **internal:** fix lint ([45a372c](https://github.com/openai/openai-node/commit/45a372ca0436f2f79c2387665b1c1bc04fd3bfed)) -* **internal:** fix release workflows ([0e4b982](https://github.com/openai/openai-node/commit/0e4b98261e412417dd0f6d1c799ef77398bfb7c0)) * **internal:** fix release workflows ([353349d](https://github.com/openai/openai-node/commit/353349de9ee10d32d3243cb5c60a8ae982c49d37)) * **internal:** fix tests failing on node v18 ([c54270a](https://github.com/openai/openai-node/commit/c54270a58ada1d0d7878ce80c7c2093a56fed158)) * **internal:** fix tests not always being type checked ([0266b41](https://github.com/openai/openai-node/commit/0266b41efa311205f0fc51b6dc6d29ab003254a6)) * **internal:** improve node 18 shims ([ee3f483](https://github.com/openai/openai-node/commit/ee3f48333a1d73a096f3417b2701fd722e4fbc68)) * **internal:** minor client file refactoring ([d1aa00a](https://github.com/openai/openai-node/commit/d1aa00afc760f73624a8a109600c03deba40e72b)) * **internal:** only run examples workflow in main repo ([#1450](https://github.com/openai/openai-node/issues/1450)) ([93569f3](https://github.com/openai/openai-node/commit/93569f39799512604db439af20f0ef0ad3dae295)) -* **internal:** reduce CI branch coverage ([bb39dba](https://github.com/openai/openai-node/commit/bb39dbae2830f64ede70f0ae1cea2935d1720911)) * **internal:** reduce CI branch coverage ([77fc77f](https://github.com/openai/openai-node/commit/77fc77f7d05d03eafe6c8f002044c60c4bab3c64)) * **internal:** refactor utils ([e7fbfbc](https://github.com/openai/openai-node/commit/e7fbfbce41c00aaa7d3b75a4bf001c7562b5b722)) -* **internal:** remove CI condition ([ef43345](https://github.com/openai/openai-node/commit/ef43345f0828a5313b595ed1715094d110f2f44e)) * **internal:** remove CI condition ([#1381](https://github.com/openai/openai-node/issues/1381)) ([e905c95](https://github.com/openai/openai-node/commit/e905c95a27213ee65210b061ead4c982de01648b)) * **internal:** remove unnecessary todo ([b55321e](https://github.com/openai/openai-node/commit/b55321e2d0713d41b4050e8ccf0ac4eefb45be3a)) * **internal:** run CI on update-specs branch ([9c45ef3](https://github.com/openai/openai-node/commit/9c45ef37249e7db3ba8aa2e81886ffe306b95da4)) * **internal:** run example files in CI ([#1357](https://github.com/openai/openai-node/issues/1357)) ([1044c48](https://github.com/openai/openai-node/commit/1044c487566569e773d5f6c1a94ce6b614e62b80)) * **internal:** share typescript helpers ([2470933](https://github.com/openai/openai-node/commit/247093374538f0e714178134c38813bc4fde9ecf)) -* **internal:** skip broken test ([5b81f62](https://github.com/openai/openai-node/commit/5b81f62ac12969cf0a6da8bf0bfde81ff025e092)) * **internal:** skip broken test ([#1458](https://github.com/openai/openai-node/issues/1458)) ([58f4559](https://github.com/openai/openai-node/commit/58f4559d952f6e56a8f27a6bcaba0acf295623df)) * **internal:** update @types/bun ([d94b41a](https://github.com/openai/openai-node/commit/d94b41a58e24c82c3f7369bd1360b394e93cf1dd)) * **internal:** update release workflows ([2cbf49a](https://github.com/openai/openai-node/commit/2cbf49a0b9a8cfbee29cec558c5ccdcebd72396f)) -* **internal:** upload builds and expand CI branch coverage ([3dcbe17](https://github.com/openai/openai-node/commit/3dcbe171d4d2a93e645828b39395363f064136b0)) * **internal:** upload builds and expand CI branch coverage ([#1460](https://github.com/openai/openai-node/issues/1460)) ([2d45287](https://github.com/openai/openai-node/commit/2d452879000c07f3ef4e775e19a527f5f6fa7b4c)) -* **internal:** version bump ([b40e830](https://github.com/openai/openai-node/commit/b40e8302ec11683b6a360a050236ad1284afc760)) -* **internal:** version bump ([5123fe0](https://github.com/openai/openai-node/commit/5123fe08a56f3d0040b1cc67129382f3eacc3cca)) -* **internal:** version bump ([#1393](https://github.com/openai/openai-node/issues/1393)) ([2e49526](https://github.com/openai/openai-node/commit/2e495267329b6853edff76c415e4c5ddc5e143e8)) * **migration:** add beta handling ([3508099](https://github.com/openai/openai-node/commit/3508099991ecfa260d77678037275133130e09dc)) * move ChatModel type to shared ([236dbf4](https://github.com/openai/openai-node/commit/236dbf4092fccf7697852c6341a8f38f0241770c)) * **package:** remove engines ([500a82f](https://github.com/openai/openai-node/commit/500a82f45d46697be14987e12d896acb2b109d32)) * **perf:** faster base64 decoding ([11b9534](https://github.com/openai/openai-node/commit/11b9534d317f87cdcb1934ead013f058865e675e)) -* Remove deprecated/unused remote spec feature ([00bdda3](https://github.com/openai/openai-node/commit/00bdda332097787a1b09ef903b3304d3e61cde1c)) -* Remove deprecated/unused remote spec feature ([71950f6](https://github.com/openai/openai-node/commit/71950f6e891ba0813c25b2992db93a61ef6c9664)) -* revert temporary version change ([47a8350](https://github.com/openai/openai-node/commit/47a83508645b0b5a0e4bf994f753c5752717fdc2)) -* **tests:** improve enum examples ([0b30331](https://github.com/openai/openai-node/commit/0b30331a7e89ed9c400bb1b9ebfb33867a00f8bd)) * **tests:** improve enum examples ([#1454](https://github.com/openai/openai-node/issues/1454)) ([15a86c9](https://github.com/openai/openai-node/commit/15a86c958bf300486907f2498e1028fc9bc50b00)) * **tests:** stop using node-fetch, don't directly upload FormDataFile ([ebd464f](https://github.com/openai/openai-node/commit/ebd464f5ad07f440ad476c0a7ce733947da414e2)) * **tests:** switch proxy tests to fetchOptions ([da6ed5f](https://github.com/openai/openai-node/commit/da6ed5fc4c9ec203d9add28c34c90532b0334a3e)) @@ -304,11 +267,9 @@ Full Changelog: [v5.0.0-alpha.0...v5.0.0](https://github.com/openai/openai-node/ * add examples to tsdocs ([e8d2092](https://github.com/openai/openai-node/commit/e8d2092e51015b05fe7ef33ef5a9d7652846b137)) * fix "procesing" -> "processing" in realtime examples ([#1406](https://github.com/openai/openai-node/issues/1406)) ([dfbdc65](https://github.com/openai/openai-node/commit/dfbdc65d3ed17f0063d02906239371b88e04e5fd)) -* **migration:** mention function renames ([eb773ee](https://github.com/openai/openai-node/commit/eb773ee26df88ab6da5918521c5e979860a5aaee)) * **migration:** mention zod helpers error ([43b870d](https://github.com/openai/openai-node/commit/43b870d1651d0c13e4ec10a53de2dfbae276c3e7)) * **readme:** fix typo ([c44ed98](https://github.com/openai/openai-node/commit/c44ed98a3e7f497a656d612037667dd1f2e6816b)) * **readme:** fix typo ([0989ddc](https://github.com/openai/openai-node/commit/0989ddcfd5ed0a149bbc67d61f93e0f49c397c72)) -* update URLs from stainlessapi.com to stainless.com ([e4e737d](https://github.com/openai/openai-node/commit/e4e737d90718d077c266e4c382a1535fc4bf1c69)) * update URLs from stainlessapi.com to stainless.com ([#1352](https://github.com/openai/openai-node/issues/1352)) ([634a209](https://github.com/openai/openai-node/commit/634a209a6025640e2849133f6997af8faa28d4d8)) diff --git a/jsr.json b/jsr.json index bd734c294..e16515fd8 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "5.1.1", + "version": "5.2.0", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index 1e425a912..3b846b774 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "5.1.1", + "version": "5.2.0", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/internal/uploads.ts b/src/internal/uploads.ts index b21555747..fbc48b298 100644 --- a/src/internal/uploads.ts +++ b/src/internal/uploads.ts @@ -138,7 +138,7 @@ export const createForm = async >( // We check for Blob not File because Bun.File doesn't inherit from File, // but they both inherit from Blob and have a `name` property at runtime. -const isNamedBlob = (value: object) => value instanceof Blob && 'name' in value; +const isNamedBlob = (value: unknown) => value instanceof Blob && 'name' in value; const isUploadable = (value: unknown) => typeof value === 'object' && diff --git a/src/resources/evals/runs/runs.ts b/src/resources/evals/runs/runs.ts index 55cff4f93..5df206cb9 100644 --- a/src/resources/evals/runs/runs.ts +++ b/src/resources/evals/runs/runs.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../../core/resource'; import * as Shared from '../../shared'; import * as ResponsesAPI from '../../responses/responses'; +import * as CompletionsAPI from '../../chat/completions/completions'; import * as OutputItemsAPI from './output-items'; import { OutputItemListParams, @@ -257,6 +258,23 @@ export namespace CreateEvalCompletionsRunDataSource { */ max_completion_tokens?: number; + /** + * An object specifying the format that the model must output. + * + * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + * Outputs which ensures the model will match your supplied JSON schema. Learn more + * in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + response_format?: + | Shared.ResponseFormatText + | Shared.ResponseFormatJSONSchema + | Shared.ResponseFormatJSONObject; + /** * A seed value to initialize the randomness, during sampling. */ @@ -267,6 +285,13 @@ export namespace CreateEvalCompletionsRunDataSource { */ temperature?: number; + /** + * A list of tools the model may call. Currently, only functions are supported as a + * tool. Use this to provide a list of functions the model may generate JSON inputs + * for. A max of 128 functions are supported. + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ @@ -649,11 +674,66 @@ export namespace RunCreateResponse { */ temperature?: number; + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + text?: SamplingParams.Text; + + /** + * An array of tools the model may call while generating a response. You can + * specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like + * [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). + * Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, enabling + * the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ top_p?: number; } + + export namespace SamplingParams { + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + export interface Text { + /** + * An object specifying the format that the model must output. + * + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + * ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * The default format is `{ "type": "text" }` with no additional options. + * + * **Not recommended for gpt-4o and newer models:** + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + format?: ResponsesAPI.ResponseFormatTextConfig; + } + } } export interface PerModelUsage { @@ -1041,11 +1121,66 @@ export namespace RunRetrieveResponse { */ temperature?: number; + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + text?: SamplingParams.Text; + + /** + * An array of tools the model may call while generating a response. You can + * specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like + * [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). + * Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, enabling + * the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ top_p?: number; } + + export namespace SamplingParams { + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + export interface Text { + /** + * An object specifying the format that the model must output. + * + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + * ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * The default format is `{ "type": "text" }` with no additional options. + * + * **Not recommended for gpt-4o and newer models:** + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + format?: ResponsesAPI.ResponseFormatTextConfig; + } + } } export interface PerModelUsage { @@ -1430,11 +1565,66 @@ export namespace RunListResponse { */ temperature?: number; + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + text?: SamplingParams.Text; + + /** + * An array of tools the model may call while generating a response. You can + * specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like + * [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). + * Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, enabling + * the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ top_p?: number; } + + export namespace SamplingParams { + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + export interface Text { + /** + * An object specifying the format that the model must output. + * + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + * ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * The default format is `{ "type": "text" }` with no additional options. + * + * **Not recommended for gpt-4o and newer models:** + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + format?: ResponsesAPI.ResponseFormatTextConfig; + } + } } export interface PerModelUsage { @@ -1830,11 +2020,66 @@ export namespace RunCancelResponse { */ temperature?: number; + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + text?: SamplingParams.Text; + + /** + * An array of tools the model may call while generating a response. You can + * specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like + * [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). + * Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, enabling + * the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ top_p?: number; } + + export namespace SamplingParams { + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + export interface Text { + /** + * An object specifying the format that the model must output. + * + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + * ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * The default format is `{ "type": "text" }` with no additional options. + * + * **Not recommended for gpt-4o and newer models:** + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + format?: ResponsesAPI.ResponseFormatTextConfig; + } + } } export interface PerModelUsage { @@ -2169,11 +2414,66 @@ export namespace RunCreateParams { */ temperature?: number; + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + text?: SamplingParams.Text; + + /** + * An array of tools the model may call while generating a response. You can + * specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like + * [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). + * Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, enabling + * the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). + */ + tools?: Array; + /** * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ top_p?: number; } + + export namespace SamplingParams { + /** + * Configuration options for a text response from the model. Can be plain text or + * structured JSON data. Learn more: + * + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ + export interface Text { + /** + * An object specifying the format that the model must output. + * + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, which + * ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * The default format is `{ "type": "text" }` with no additional options. + * + * **Not recommended for gpt-4o and newer models:** + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` is + * preferred for models that support it. + */ + format?: ResponsesAPI.ResponseFormatTextConfig; + } + } } } diff --git a/src/version.ts b/src/version.ts index 08dfa7aba..a7cd4eea8 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.1.1'; // x-release-please-version +export const VERSION = '5.2.0'; // x-release-please-version