From b125bdddb4d91bdc1f7f23d4242e343f851efa01 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 8 May 2024 16:10:41 -0400 Subject: [PATCH 1/2] feat(api): adding file purposes (#831) --- .stats.yml | 2 +- src/resources/files.ts | 18 +++++++++--------- tests/api-resources/files.test.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.stats.yml b/.stats.yml index 49956282b..50c6b293d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 64 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-edb5af3ade0cd27cf366b0654b90c7a81c43c433e11fc3f6e621e2c779de10d4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2e14236d4015bf3b956290ea8b656224a0c7b206a356c6af2a7ae43fdbceb04c.yml diff --git a/src/resources/files.ts b/src/resources/files.ts index 820c7a1fa..63dff5bd4 100644 --- a/src/resources/files.ts +++ b/src/resources/files.ts @@ -148,10 +148,11 @@ export interface FileObject { object: 'file'; /** - * The intended purpose of the file. Supported values are `fine-tune`, - * `fine-tune-results`, `assistants`, and `assistants_output`. + * The intended purpose of the file. Supported values are `assistants`, + * `assistants_output`, `batch`, `batch_output`, `fine-tune`, and + * `fine-tune-results`. */ - purpose: 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output'; + purpose: 'assistants' | 'assistants_output' | 'batch' | 'batch_output' | 'fine-tune' | 'fine-tune-results'; /** * @deprecated: Deprecated. The current status of the file, which can be either @@ -175,14 +176,13 @@ export interface FileCreateParams { /** * The intended purpose of the uploaded file. * - * Use "fine-tune" for - * [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and - * "assistants" for + * Use "assistants" for * [Assistants](https://platform.openai.com/docs/api-reference/assistants) and - * [Messages](https://platform.openai.com/docs/api-reference/messages). This allows - * us to validate the format of the uploaded file is correct for fine-tuning. + * [Messages](https://platform.openai.com/docs/api-reference/messages), "batch" for + * [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for + * [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). */ - purpose: 'fine-tune' | 'assistants'; + purpose: 'assistants' | 'batch' | 'fine-tune'; } export interface FileListParams { diff --git a/tests/api-resources/files.test.ts b/tests/api-resources/files.test.ts index 514f42e3a..2fda1c947 100644 --- a/tests/api-resources/files.test.ts +++ b/tests/api-resources/files.test.ts @@ -12,7 +12,7 @@ describe('resource files', () => { test('create: only required params', async () => { const responsePromise = openai.files.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), - purpose: 'fine-tune', + purpose: 'assistants', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,7 +26,7 @@ describe('resource files', () => { test('create: required and optional params', async () => { const response = await openai.files.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), - purpose: 'fine-tune', + purpose: 'assistants', }); }); From 579edb5f89896b99be0b35e112455cef9b864bc0 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 8 May 2024 16:11:02 -0400 Subject: [PATCH 2/2] release: 4.43.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- package.json | 2 +- scripts/build-deno | 2 +- src/version.ts | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bca107b6c..f533aa156 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.42.0" + ".": "4.43.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 98885d747..18e728d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.43.0 (2024-05-08) + +Full Changelog: [v4.42.0...v4.43.0](https://github.com/openai/openai-node/compare/v4.42.0...v4.43.0) + +### Features + +* **api:** adding file purposes ([#831](https://github.com/openai/openai-node/issues/831)) ([a62b877](https://github.com/openai/openai-node/commit/a62b8779ff7261cdd6aa7bf72fb6407cc7e3fd21)) + ## 4.42.0 (2024-05-06) Full Changelog: [v4.41.1...v4.42.0](https://github.com/openai/openai-node/compare/v4.41.1...v4.42.0) diff --git a/README.md b/README.md index e4c0ad332..621b53a84 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You can import in Deno via: ```ts -import OpenAI from 'https://deno.land/x/openai@v4.42.0/mod.ts'; +import OpenAI from 'https://deno.land/x/openai@v4.43.0/mod.ts'; ``` diff --git a/package.json b/package.json index 97854fcd8..434e0686b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "4.42.0", + "version": "4.43.0", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/scripts/build-deno b/scripts/build-deno index 358ed3685..7badf1191 100755 --- a/scripts/build-deno +++ b/scripts/build-deno @@ -16,7 +16,7 @@ This is a build produced from https://github.com/openai/openai-node – please g Usage: \`\`\`ts -import OpenAI from "https://deno.land/x/openai@v4.42.0/mod.ts"; +import OpenAI from "https://deno.land/x/openai@v4.43.0/mod.ts"; const client = new OpenAI(); \`\`\` diff --git a/src/version.ts b/src/version.ts index c1a790c33..8be389808 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.42.0'; // x-release-please-version +export const VERSION = '4.43.0'; // x-release-please-version