From bd5b4ab55ee0fd8baee345413ec79405ece29d09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:53:04 +0000 Subject: [PATCH 1/2] feat(api): add service tier argument for chat completions (#900) --- .stats.yml | 2 +- src/resources/chat/completions.ts | 25 ++++++++++++++++++++ tests/api-resources/chat/completions.test.ts | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c5ada3b5d..aa7e8427b 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-5cb1810135c35c5024698f3365626471a04796e26e393aefe1aa0ba3c0891919.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-8fe357c6b5a425d810d731e4102a052d8e38c5e2d66950e6de1025415160bf88.yml diff --git a/src/resources/chat/completions.ts b/src/resources/chat/completions.ts index b7c301f4e..664def2b2 100644 --- a/src/resources/chat/completions.ts +++ b/src/resources/chat/completions.ts @@ -66,6 +66,12 @@ export interface ChatCompletion { */ object: 'chat.completion'; + /** + * The service tier used for processing the request. This field is only included if + * the `service_tier` parameter is specified in the request. + */ + service_tier?: 'scale' | 'default' | null; + /** * This fingerprint represents the backend configuration that the model runs with. * @@ -205,6 +211,12 @@ export interface ChatCompletionChunk { */ object: 'chat.completion.chunk'; + /** + * The service tier used for processing the request. This field is only included if + * the `service_tier` parameter is specified in the request. + */ + service_tier?: 'scale' | 'default' | null; + /** * This fingerprint represents the backend configuration that the model runs with. * Can be used in conjunction with the `seed` request parameter to understand when @@ -800,6 +812,19 @@ export interface ChatCompletionCreateParamsBase { */ seed?: number | null; + /** + * Specifies the latency tier to use for processing the request. This parameter is + * relevant for customers subscribed to the scale tier service: + * + * - If set to 'auto', the system will utilize scale tier credits until they are + * exhausted. + * - If set to 'default', the request will be processed in the shared cluster. + * + * When this parameter is set, the response body will include the `service_tier` + * utilized. + */ + service_tier?: 'auto' | 'default' | null; + /** * Up to 4 sequences where the API will stop generating further tokens. */ diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 9404e9e18..c63466f99 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -38,6 +38,7 @@ describe('resource completions', () => { presence_penalty: -2, response_format: { type: 'json_object' }, seed: -9223372036854776000, + service_tier: 'auto', stop: 'string', stream: false, stream_options: { include_usage: true }, From 22cf0362c4a72873433d10452248934672bd65ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:53:29 +0000 Subject: [PATCH 2/2] release: 4.52.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 58c53eaeb..5ed75d11b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.51.0" + ".": "4.52.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c2a3b446..f9c5d60a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.52.0 (2024-06-18) + +Full Changelog: [v4.51.0...v4.52.0](https://github.com/openai/openai-node/compare/v4.51.0...v4.52.0) + +### Features + +* **api:** add service tier argument for chat completions ([#900](https://github.com/openai/openai-node/issues/900)) ([91e6651](https://github.com/openai/openai-node/commit/91e66514037a8d6f9c39d3c96cd5769885925a4b)) + ## 4.51.0 (2024-06-12) Full Changelog: [v4.50.0...v4.51.0](https://github.com/openai/openai-node/compare/v4.50.0...v4.51.0) diff --git a/README.md b/README.md index 6dcc2abc4..ebbb38293 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.51.0/mod.ts'; +import OpenAI from 'https://deno.land/x/openai@v4.52.0/mod.ts'; ``` diff --git a/package.json b/package.json index f5401bb8c..c93d881cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "4.51.0", + "version": "4.52.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 2d0cbecc2..c842fa5bc 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.51.0/mod.ts"; +import OpenAI from "https://deno.land/x/openai@v4.52.0/mod.ts"; const client = new OpenAI(); \`\`\` diff --git a/src/version.ts b/src/version.ts index 9daf60a23..0f31a0778 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.51.0'; // x-release-please-version +export const VERSION = '4.52.0'; // x-release-please-version