diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b568f9c35..af6c62f48 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.10.3" + ".": "5.11.0" } diff --git a/.stats.yml b/.stats.yml index 2dc4f680a..e7fb0bdf9 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-b2a451656ca64d30d174391ebfd94806b4de3ab76dc55b92843cfb7f1a54ecb6.yml -openapi_spec_hash: 27d9691b400f28c17ef063a1374048b0 -config_hash: e822d0c9082c8b312264403949243179 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-721e6ccaa72205ee14c71f8163129920464fb814b95d3df9567a9476bbd9b7fb.yml +openapi_spec_hash: 2115413a21df8b5bf9e4552a74df4312 +config_hash: 9606bb315a193bfd8da0459040143242 diff --git a/CHANGELOG.md b/CHANGELOG.md index a032aec2f..65a65b081 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 5.11.0 (2025-07-30) + +Full Changelog: [v5.10.3...v5.11.0](https://github.com/openai/openai-node/compare/v5.10.3...v5.11.0) + +### Features + +* **api:** manual updates ([442dc25](https://github.com/openai/openai-node/commit/442dc25d7b31a374daf440f32f5694c3b6c20a81)) + ## 5.10.3 (2025-07-30) Full Changelog: [v5.10.2...v5.10.3](https://github.com/openai/openai-node/compare/v5.10.2...v5.10.3) diff --git a/jsr.json b/jsr.json index 6caa6f324..b37729662 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "5.10.3", + "version": "5.11.0", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index c105bfb99..437369312 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "5.10.3", + "version": "5.11.0", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/resources/chat/completions/completions.ts b/src/resources/chat/completions/completions.ts index 88d4249b4..494e8a59c 100644 --- a/src/resources/chat/completions/completions.ts +++ b/src/resources/chat/completions/completions.ts @@ -1089,6 +1089,12 @@ export interface ChatCompletionStoreMessage extends ChatCompletionMessage { * The identifier of the chat message. */ id: string; + + /** + * If a content parts array was provided, this is an array of `text` and + * `image_url` parts. Otherwise, null. + */ + content_parts?: Array | null; } /** @@ -1397,6 +1403,13 @@ export interface ChatCompletionCreateParamsBase { */ presence_penalty?: number | null; + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache + * hit rates. Replaces the `user` field. + * [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + */ + prompt_cache_key?: string; + /** * **o-series models only** * @@ -1424,6 +1437,15 @@ export interface ChatCompletionCreateParamsBase { | Shared.ResponseFormatJSONSchema | Shared.ResponseFormatJSONObject; + /** + * A stable identifier used to help detect users of your application that may be + * violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in + * order to avoid sending us any identifying information. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + safety_identifier?: string; + /** * This feature is in Beta. If specified, our system will make a best effort to * sample deterministically, such that repeated requests with the same `seed` and @@ -1533,9 +1555,12 @@ export interface ChatCompletionCreateParamsBase { top_p?: number | null; /** - * A stable identifier for your end-users. Used to boost cache hit rates by better - * bucketing similar requests and to help OpenAI detect and prevent abuse. - * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * @deprecated This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit + * rates by better bucketing similar requests and to help OpenAI detect and prevent + * abuse. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). */ user?: string; diff --git a/src/resources/responses/responses.ts b/src/resources/responses/responses.ts index ba1447432..86b0adafa 100644 --- a/src/resources/responses/responses.ts +++ b/src/resources/responses/responses.ts @@ -479,6 +479,13 @@ export interface Response { */ prompt?: ResponsePrompt | null; + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache + * hit rates. Replaces the `user` field. + * [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + */ + prompt_cache_key?: string; + /** * **o-series models only** * @@ -487,6 +494,15 @@ export interface Response { */ reasoning?: Shared.Reasoning | null; + /** + * A stable identifier used to help detect users of your application that may be + * violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in + * order to avoid sending us any identifying information. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + safety_identifier?: string; + /** * Specifies the latency tier to use for processing the request. This parameter is * relevant for customers subscribed to the scale tier service: @@ -540,9 +556,12 @@ export interface Response { usage?: ResponseUsage; /** - * A stable identifier for your end-users. Used to boost cache hit rates by better - * bucketing similar requests and to help OpenAI detect and prevent abuse. - * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * @deprecated This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit + * rates by better bucketing similar requests and to help OpenAI detect and prevent + * abuse. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). */ user?: string; } @@ -4836,6 +4855,13 @@ export interface ResponseCreateParamsBase { */ prompt?: ResponsePrompt | null; + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache + * hit rates. Replaces the `user` field. + * [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + */ + prompt_cache_key?: string; + /** * **o-series models only** * @@ -4844,6 +4870,15 @@ export interface ResponseCreateParamsBase { */ reasoning?: Shared.Reasoning | null; + /** + * A stable identifier used to help detect users of your application that may be + * violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in + * order to avoid sending us any identifying information. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + safety_identifier?: string; + /** * Specifies the latency tier to use for processing the request. This parameter is * relevant for customers subscribed to the scale tier service: @@ -4942,9 +4977,12 @@ export interface ResponseCreateParamsBase { truncation?: 'auto' | 'disabled' | null; /** - * A stable identifier for your end-users. Used to boost cache hit rates by better - * bucketing similar requests and to help OpenAI detect and prevent abuse. - * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * @deprecated This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit + * rates by better bucketing similar requests and to help OpenAI detect and prevent + * abuse. + * [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). */ user?: string; } diff --git a/src/version.ts b/src/version.ts index fe8db97ec..5c2d9a751 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.10.3'; // x-release-please-version +export const VERSION = '5.11.0'; // x-release-please-version diff --git a/tests/api-resources/chat/completions/completions.test.ts b/tests/api-resources/chat/completions/completions.test.ts index b593ab4eb..6869136a5 100644 --- a/tests/api-resources/chat/completions/completions.test.ts +++ b/tests/api-resources/chat/completions/completions.test.ts @@ -40,8 +40,10 @@ describe('resource completions', () => { parallel_tool_calls: true, prediction: { content: 'string', type: 'content' }, presence_penalty: -2, + prompt_cache_key: 'prompt-cache-key-1234', reasoning_effort: 'low', response_format: { type: 'text' }, + safety_identifier: 'safety-identifier-1234', seed: -9007199254740991, service_tier: 'auto', stop: '\n',