diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a21d67d78..d140407b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.80.0" + ".": "4.80.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9126bf6a2..e4d4d73b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 4.80.1 (2025-01-24) + +Full Changelog: [v4.80.0...v4.80.1](https://github.com/openai/openai-node/compare/v4.80.0...v4.80.1) + +### Bug Fixes + +* **azure:** include retry count header ([3e0ba40](https://github.com/openai/openai-node/commit/3e0ba409e57ce276fb1f95cd11c801e4ccaad572)) + + +### Documentation + +* fix typo, "zodFunctionTool" -> "zodFunction" ([#1128](https://github.com/openai/openai-node/issues/1128)) ([b7ab6bb](https://github.com/openai/openai-node/commit/b7ab6bb304973ade94830f37eb646e800226d5ef)) +* **helpers:** fix type annotation ([fc019df](https://github.com/openai/openai-node/commit/fc019df1d9cc276e8f8e689742853a09aa94991a)) +* **readme:** fix realtime errors docs link ([#1286](https://github.com/openai/openai-node/issues/1286)) ([d1d50c8](https://github.com/openai/openai-node/commit/d1d50c897c18cefea964e8057fe1acfd766ae2bf)) + ## 4.80.0 (2025-01-22) Full Changelog: [v4.79.4...v4.80.0](https://github.com/openai/openai-node/compare/v4.79.4...v4.80.0) diff --git a/README.md b/README.md index 3bd386e99..012511412 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ A full example can be found [here](https://github.com/openai/openai-node/blob/ma ### Realtime error handling -When an error is encountered, either on the client side or returned from the server through the [`error` event](https://platform.openai.com/docs/guides/realtime/realtime-api-beta#handling-errors), the `error` event listener will be fired. However, if you haven't registered an `error` event listener then an `unhandled Promise rejection` error will be thrown. +When an error is encountered, either on the client side or returned from the server through the [`error` event](https://platform.openai.com/docs/guides/realtime-model-capabilities#error-handling), the `error` event listener will be fired. However, if you haven't registered an `error` event listener then an `unhandled Promise rejection` error will be thrown. It is **highly recommended** that you register an `error` event listener and handle errors approriately as typically the underlying connection is still usable. diff --git a/helpers.md b/helpers.md index aa3775a54..16bc1f277 100644 --- a/helpers.md +++ b/helpers.md @@ -226,7 +226,7 @@ on in the documentation page [Message](https://platform.openai.com/docs/api-refe ```ts .on('textCreated', (content: Text) => ...) -.on('textDelta', (delta: RunStepDelta, snapshot: Text) => ...) +.on('textDelta', (delta: TextDelta, snapshot: Text) => ...) .on('textDone', (content: Text, snapshot: Message) => ...) ``` diff --git a/jsr.json b/jsr.json index d79b07c2f..e2ecad87f 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@openai/openai", - "version": "4.80.0", + "version": "4.80.1", "exports": { ".": "./index.ts", "./helpers/zod": "./helpers/zod.ts", diff --git a/package.json b/package.json index fd85ffdd0..497c7fae9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openai", - "version": "4.80.0", + "version": "4.80.1", "description": "The official TypeScript library for the OpenAI API", "author": "OpenAI ", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index cf6aa89e3..944def00f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -577,7 +577,10 @@ export class AzureOpenAI extends OpenAI { this._deployment = deployment; } - override buildRequest(options: Core.FinalRequestOptions): { + override buildRequest( + options: Core.FinalRequestOptions, + props: { retryCount?: number } = {}, + ): { req: RequestInit; url: string; timeout: number; @@ -591,7 +594,7 @@ export class AzureOpenAI extends OpenAI { options.path = `/deployments/${model}${options.path}`; } } - return super.buildRequest(options); + return super.buildRequest(options, props); } private async _getAzureADToken(): Promise { diff --git a/src/version.ts b/src/version.ts index c9b6787c2..7d762daed 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.80.0'; // x-release-please-version +export const VERSION = '4.80.1'; // x-release-please-version diff --git a/tests/lib/azure.test.ts b/tests/lib/azure.test.ts index 064a0098c..0e3c2c5a3 100644 --- a/tests/lib/azure.test.ts +++ b/tests/lib/azure.test.ts @@ -51,6 +51,18 @@ describe('instantiate azure client', () => { }); expect(req.headers as Headers).not.toHaveProperty('x-my-default-header'); }); + + test('includes retry count', () => { + const { req } = client.buildRequest( + { + path: '/foo', + method: 'post', + headers: { 'X-My-Default-Header': null }, + }, + { retryCount: 1 }, + ); + expect((req.headers as Headers)['x-stainless-retry-count']).toEqual('1'); + }); }); describe('defaultQuery', () => {