From 5ddac3c7535e2df4b562fe1237b639e112bf5eef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 13:48:32 +0000 Subject: [PATCH 1/2] chore(api): accurately represent shape for verbosity on Chat Completions --- .stats.yml | 6 +- src/resources/chat/completions/completions.ts | 13 +--- src/resources/graders/grader-models.ts | 5 +- src/resources/responses/responses.ts | 70 +++++-------------- .../chat/completions/completions.test.ts | 1 - 5 files changed, 23 insertions(+), 72 deletions(-) diff --git a/.stats.yml b/.stats.yml index 66c46e773..81c991168 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-24be531010b354303d741fc9247c1f84f75978f9f7de68aca92cb4f240a04722.yml -openapi_spec_hash: 3e46f439f6a863beadc71577eb4efa15 -config_hash: ed87b9139ac595a04a2162d754df2fed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-7ef7a457c3bf05364e66e48c9ca34f31bfef1f6c9b7c15b1812346105e0abb16.yml +openapi_spec_hash: a2b1f5d8fbb62175c93b0ebea9f10063 +config_hash: 76afa3236f36854a8705f1281b1990b8 diff --git a/src/resources/chat/completions/completions.ts b/src/resources/chat/completions/completions.ts index 5a11a0424..a71e574e9 100644 --- a/src/resources/chat/completions/completions.ts +++ b/src/resources/chat/completions/completions.ts @@ -1704,7 +1704,7 @@ export interface ChatCompletionCreateParamsBase { * our [model distillation](https://platform.openai.com/docs/guides/distillation) * or [evals](https://platform.openai.com/docs/guides/evals) products. * - * Supports text and image inputs. Note: image inputs over 10MB will be dropped. + * Supports text and image inputs. Note: image inputs over 8MB will be dropped. */ store?: boolean | null; @@ -1733,8 +1733,6 @@ export interface ChatCompletionCreateParamsBase { */ temperature?: number | null; - text?: ChatCompletionCreateParams.Text; - /** * Controls which (if any) tool is called by the model. `none` means the model will * not call any tool and instead generates a message. `auto` means the model can @@ -1825,15 +1823,6 @@ export namespace ChatCompletionCreateParams { parameters?: Shared.FunctionParameters; } - export interface Text { - /** - * Constrains the verbosity of the model's response. Lower values will result in - * more concise responses, while higher values will result in more verbose - * responses. Currently supported values are `low`, `medium`, and `high`. - */ - verbosity?: 'low' | 'medium' | 'high' | null; - } - /** * This tool searches the web for relevant results to use in a response. Learn more * about the diff --git a/src/resources/graders/grader-models.ts b/src/resources/graders/grader-models.ts index 7bf9b442c..36908007d 100644 --- a/src/resources/graders/grader-models.ts +++ b/src/resources/graders/grader-models.ts @@ -291,10 +291,11 @@ export interface StringCheckGrader { */ export interface TextSimilarityGrader { /** - * The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`, `meteor`, - * `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. + * The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`, + * `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`. */ evaluation_metric: + | 'cosine' | 'fuzzy_match' | 'bleu' | 'gleu' diff --git a/src/resources/responses/responses.ts b/src/resources/responses/responses.ts index 16114f608..c921f253d 100644 --- a/src/resources/responses/responses.ts +++ b/src/resources/responses/responses.ts @@ -563,7 +563,14 @@ export interface Response { */ status?: ResponseStatus; - text?: Response.Text; + /** + * 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?: ResponseTextConfig; /** * The truncation strategy to use for the model response. @@ -603,32 +610,6 @@ export namespace Response { */ reason?: 'max_output_tokens' | 'content_filter'; } - - 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; - - /** - * Constrains the verbosity of the model's response. Lower values will result in - * more concise responses, while higher values will result in more verbose - * responses. Currently supported values are `low`, `medium`, and `high`. - */ - verbosity?: 'low' | 'medium' | 'high' | null; - } } /** @@ -5194,7 +5175,14 @@ export interface ResponseCreateParamsBase { */ temperature?: number | null; - text?: ResponseCreateParams.Text; + /** + * 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?: ResponseTextConfig; /** * How the model should select which tool (or tools) to use when generating a @@ -5276,32 +5264,6 @@ export namespace ResponseCreateParams { include_obfuscation?: boolean; } - 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; - - /** - * Constrains the verbosity of the model's response. Lower values will result in - * more concise responses, while higher values will result in more verbose - * responses. Currently supported values are `low`, `medium`, and `high`. - */ - verbosity?: 'low' | 'medium' | 'high' | null; - } - export type ResponseCreateParamsNonStreaming = ResponsesAPI.ResponseCreateParamsNonStreaming; export type ResponseCreateParamsStreaming = ResponsesAPI.ResponseCreateParamsStreaming; } diff --git a/tests/api-resources/chat/completions/completions.test.ts b/tests/api-resources/chat/completions/completions.test.ts index b34cec7fa..3a2fc3670 100644 --- a/tests/api-resources/chat/completions/completions.test.ts +++ b/tests/api-resources/chat/completions/completions.test.ts @@ -51,7 +51,6 @@ describe('resource completions', () => { stream: false, stream_options: { include_obfuscation: true, include_usage: true }, temperature: 1, - text: { verbosity: 'low' }, tool_choice: 'none', tools: [ { From b168cad18a5d745b03f447cdd971474592f8801f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 15:09:40 +0000 Subject: [PATCH 2/2] release: 5.13.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ jsr.json | 2 +- package.json | 2 +- src/version.ts | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 312bc15d8..6c4ea4d5a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.13.0" + ".": "5.13.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 49013cca7..0c162dfe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.13.1 (2025-08-19) + +Full Changelog: [v5.13.0...v5.13.1](https://github.com/openai/openai-node/compare/v5.13.0...v5.13.1) + +### Chores + +* **api:** accurately represent shape for verbosity on Chat Completions ([5ddac3c](https://github.com/openai/openai-node/commit/5ddac3c7535e2df4b562fe1237b639e112bf5eef)) + ## 5.13.0 (2025-08-18) Full Changelog: [v5.12.3...v5.13.0](https://github.com/openai/openai-node/compare/v5.12.3...v5.13.0) diff --git a/jsr.json b/jsr.json index 0880555f8..60f61a017 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "5.13.0", + "version": "5.13.1", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index 33638387f..8f670f1c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "5.13.0", + "version": "5.13.1", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index ca240c16b..d20dbf9a2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.13.0'; // x-release-please-version +export const VERSION = '5.13.1'; // x-release-please-version