Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency openai to v4.77.4 #229

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 15, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
openai 4.77.0 -> 4.77.4 age adoption passing confidence

Release Notes

openai/openai-node (openai)

v4.77.4

Compare Source

Full Changelog: v4.77.3...v4.77.4

Documentation

v4.77.3

Compare Source

Full Changelog: v4.77.2...v4.77.3

Chores

Configuration

📅 Schedule: Branch creation - "* 0-4 * * 3" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link

openai debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e98ace9d7 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.3"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..1f928b366 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,40 @@
 # Changelog
 
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..c926688f0 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
diff --git jsr.json jsr.json
index d76a2040e..57eb55bf8 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.3",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..2ad833206 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.3",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..81ee8f0d6 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.3'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description
This pull request updates the OpenAI Node.js SDK to version `4.77.3`. The primary motivation for this change is to address minor bugs, update the OpenAPI spec URL, and make some documentation improvements. Additionally, it includes a minor code improvement to normalize HTTP methods within the `fetch` requests.

### Possible Issues
None identified.

### Security Hotspots
None identified.

<details>
<summary><i>Changes</i></summary>

### Changes
- **.release-please-manifest.json**: Updated version from `4.77.0` to `4.77.3`.
- **.stats.yml**: Updated `openapi_spec_url` to a new URL.
- **CHANGELOG.md**: Added entries for versions `4.77.1`, `4.77.2`, and `4.77.3`.
- **CONTRIBUTING.md**: Minor formatting improvements for command examples.
- **LICENSE**: Updated the copyright year.
- **README.md**: Added an important notice about the upcoming alpha version that migrates from `node-fetch` to the built-in fetch.
- **jsr.json**: Updated the version to `4.77.3`.
- **package.json**: Updated the version to `4.77.3`.
- **src/core.ts**: 
  - Added normalization to uppercase custom HTTP methods to comply with `nodejs/undici` requirements.
  - Refactored `fetch` call to use optimized `fetchOptions`.
- **src/version.ts**: Updated the version to `4.77.3`.
- **tests/index.test.ts**: Added a new test to check that HTTP methods are correctly normalized to uppercase.



This update mainly focuses on housekeeping and minor enhancements, ensuring that the package stays up to date and aligns with the latest specifications and best practices. The new test ensures that the recent changes work as expected, providing additional assurance of the code's reliability.```mermaid
sequenceDiagram
    participant Developer
    participant GithubRepo
    Developer->>GithubRepo: Create PR to update version and make documentation changes
    Note right of GithubRepo: Files changed, versions updated...
    Developer->>GithubRepo: Review `fetch` modifications in src/core.ts
    GithubRepo-->>Developer: Automatic CI/CD tests run
    Note left of Developer: `fetch` request options normalized, test added
    Developer->>GithubRepo: Merges PR after successful review and tests
    Note right of GithubRepo: New version 4.77.3 released

Copy link

anthropic debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e98ace9d7 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.3"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..1f928b366 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,40 @@
 # Changelog
 
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..c926688f0 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
diff --git jsr.json jsr.json
index d76a2040e..57eb55bf8 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.3",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..2ad833206 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.3",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..81ee8f0d6 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.3'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description
This PR updates the OpenAI Node.js client library from version 4.77.0 to 4.77.3. It includes several minor changes, bug fixes, and documentation updates.

<details>
<summary><i>Changes</i></summary>

### Changes

1. `.release-please-manifest.json`:
   - Updated version from 4.77.0 to 4.77.3

2. `.stats.yml`:
   - Updated OpenAPI spec URL

3. `CHANGELOG.md`:
   - Added entries for versions 4.77.3, 4.77.2, and 4.77.1
   - New features include API spec updates, license year update, and bug fixes

4. `CONTRIBUTING.md`:
   - Minor updates to documentation and command examples

5. `LICENSE`:
   - Updated copyright year from 2024 to 2025

6. `README.md`:
   - Added an important notice about a new alpha version migration from `node-fetch` to builtin fetch

7. `jsr.json` and `package.json`:
   - Updated version to 4.77.3

8. `src/core.ts`:
   - Added method normalization for custom HTTP methods like 'patch'

9. `src/version.ts`:
   - Updated version to 4.77.3

10. `tests/index.test.ts`:
    - Added a new test for normalized method

```mermaid
sequenceDiagram
    participant Dev as Developer
    participant Repo as GitHub Repository
    participant NPM as NPM Registry
    participant User as Library User

    Dev->>Repo: Update version numbers and changelog
    Dev->>Repo: Add alpha version notice to README
    Dev->>Repo: Implement method normalization
    Dev->>Repo: Update copyright year
    Dev->>Repo: Add new test for method normalization
    Repo->>NPM: Publish new version 4.77.3
    User->>NPM: Install or update to version 4.77.3
    User->>User: Use updated library with normalized methods

Possible Issues

No major non-security issues identified.

Security Hotspots

No significant security hotspots identified in this change.

This sequence diagram illustrates the flow of changes from the developer updating the repository, through publishing to NPM, to the end-user installing and using the updated library.

Copy link

bedrock debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e98ace9d7 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.3"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..1f928b366 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,40 @@
 # Changelog
 
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..c926688f0 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
diff --git jsr.json jsr.json
index d76a2040e..57eb55bf8 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.3",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..2ad833206 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.3",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..81ee8f0d6 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.3'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description
This PR updates the OpenAI Node.js library from version 4.77.0 to 4.77.3. It includes several minor changes, bug fixes, and documentation updates.

<details>
<summary><i>Changes</i></summary>

### Changes

1. `.release-please-manifest.json`:
   - Updated version from 4.77.0 to 4.77.3

2. `.stats.yml`:
   - Updated OpenAPI spec URL

3. `CHANGELOG.md`:
   - Added entries for versions 4.77.3, 4.77.2, and 4.77.1
   - Includes bug fixes, chores, and documentation updates

4. `CONTRIBUTING.md`:
   - Minor updates to documentation and command examples

5. `LICENSE`:
   - Updated copyright year from 2024 to 2025

6. `README.md`:
   - Added an important notice about a new alpha version migrating from `node-fetch` to builtin fetch

7. `jsr.json` and `package.json`:
   - Updated version to 4.77.3

8. `src/core.ts`:
   - Added method normalization for custom HTTP methods like 'patch'

9. `src/version.ts`:
   - Updated version to 4.77.3

10. `tests/index.test.ts`:
    - Added a new test case for normalized method

```mermaid
sequenceDiagram
    participant Dev as Developer
    participant Git as Git Repository
    participant NPM as NPM Registry

    Dev->>Git: Update version numbers
    Dev->>Git: Update CHANGELOG.md
    Dev->>Git: Modify core.ts (method normalization)
    Dev->>Git: Update documentation
    Dev->>Git: Add new test case
    Git->>NPM: Publish new version 4.77.3
    NPM-->>Dev: Confirm publication

Possible Issues

None identified.

Security Hotspots

None identified.

This sequence diagram illustrates the process of updating the library version, making necessary code changes, updating documentation, and publishing the new version to NPM.

@renovate renovate bot force-pushed the renovate/openai-4.x-lockfile branch from a39c1be to 9e1dc6c Compare January 15, 2025 16:46
@renovate renovate bot changed the title fix(deps): update dependency openai to v4.77.3 fix(deps): update dependency openai to v4.77.4 Jan 15, 2025
Copy link

openai debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e66c326a9 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.4"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..7a811f188 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,48 @@
 # Changelog
 
+## 4.77.4 (2025-01-08)
+
+Full Changelog: [v4.77.3...v4.77.4](https://github.com/openai/openai-node/compare/v4.77.3...v4.77.4)
+
+### Documentation
+
+* **readme:** fix misplaced period ([#1252](https://github.com/openai/openai-node/issues/1252)) ([c2fe465](https://github.com/openai/openai-node/commit/c2fe46522d59d1611ba8bb2b7e070f9be7264df0))
+
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..3039857a1 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
@@ -625,7 +631,7 @@ await client.models.list({
This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
    -2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
    +2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
diff --git jsr.json jsr.json
index d76a2040e..da442da31 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.4",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..453859b6b 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.4",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..7f6adc9bc 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.4'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description
This pull request introduces several updates across documentation, configuration files, a small functional change regarding fetch options in the core API client, version bumping, and additional test coverage. The primary motivation is to enhance the functionality and correctness of the SDK, update documentation, and ensure compatibility with ongoing changes.

### Possible Issues
None detected.

### Security Hotspots
None detected.

<details>
<summary><i>Changes</i></summary>

### Changes
#### Configuration Files
- **.release-please-manifest.json**
  - Version updated from `4.77.0` to `4.77.4`.

- **.stats.yml**
  - Updated `openapi_spec_url` to a new specification file.

#### Documentation
- **CHANGELOG.md**
  - Added changelog entries for version `4.77.4` to version `4.77.1`.

- **CONTRIBUTING.md**
  - Updated URLs and example commands to improve readability and correctness.

- **LICENSE**
  - Updated copyright year from 2024 to 2025.

- **README.md**
  - Added an important notice about the new alpha version migration from `node-fetch` to the built-in fetch.
  - Corrected minor formatting issues.

#### Source Code
- **package.json**
  - Version updated from `4.77.0` to `4.77.4`.

- **src/core.ts**
  - Introduced `fetchOptions` variable to ensure custom methods like `PATCH` are uppercased as required by several underlying systems.

- **src/version.ts**
  - Updated the version constant from `4.77.0` to `4.77.4`.

#### Tests
- **tests/index.test.ts**
  - Added a new test to ensure that custom HTTP methods like `PATCH` are correctly normalized to uppercase.

```mermaid
sequenceDiagram
    participant Developer
    participant GitHub
    participant CI
    Developer->>GitHub: Creates Pull Request
    GitHub->>CI: Triggers CI Pipeline
    CI->>CoreAPIClient: Runs Tests
    CI-->>Developer: Test Results & Feedback
    Developer->>GitHub: Updates PR based on feedback
    GitHub->>CI: Re-triggers CI Pipeline if changed
    CI-->>GitHub: Reports Status

Copy link

anthropic debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e66c326a9 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.4"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..7a811f188 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,48 @@
 # Changelog
 
+## 4.77.4 (2025-01-08)
+
+Full Changelog: [v4.77.3...v4.77.4](https://github.com/openai/openai-node/compare/v4.77.3...v4.77.4)
+
+### Documentation
+
+* **readme:** fix misplaced period ([#1252](https://github.com/openai/openai-node/issues/1252)) ([c2fe465](https://github.com/openai/openai-node/commit/c2fe46522d59d1611ba8bb2b7e070f9be7264df0))
+
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..3039857a1 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
@@ -625,7 +631,7 @@ await client.models.list({
This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
    -2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
    +2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
diff --git jsr.json jsr.json
index d76a2040e..da442da31 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.4",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..453859b6b 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.4",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..7f6adc9bc 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.4'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description

This pull request updates the OpenAI Node.js library from version 4.77.0 to 4.77.4. It includes several minor changes, bug fixes, documentation updates, and internal improvements.

<details>
<summary><i>Changes</i></summary>

### Changes

1. `.release-please-manifest.json`:
   - Updated version number from 4.77.0 to 4.77.4

2. `.stats.yml`:
   - Updated OpenAPI spec URL

3. `CHANGELOG.md`:
   - Added entries for versions 4.77.1 to 4.77.4
   - Includes bug fixes, documentation updates, and internal changes

4. `CONTRIBUTING.md`:
   - Minor updates to documentation and command examples

5. `LICENSE`:
   - Updated copyright year to 2025

6. `README.md`:
   - Added an important notice about an upcoming alpha version
   - Fixed a minor punctuation issue

7. `jsr.json` and `package.json`:
   - Updated version number to 4.77.4

8. `src/core.ts`:
   - Added method normalization for custom HTTP methods

9. `src/version.ts`:
   - Updated version number to 4.77.4

10. `tests/index.test.ts`:
    - Added a new test for normalized HTTP methods

```mermaid
sequenceDiagram
    participant Dev as Developer
    participant Repo as GitHub Repository
    participant CI as CI/CD Pipeline

    Dev->>Repo: Update version numbers
    Dev->>Repo: Update CHANGELOG.md
    Dev->>Repo: Modify core.ts (method normalization)
    Dev->>Repo: Update README.md
    Dev->>Repo: Add new test case
    Dev->>Repo: Create Pull Request
    Repo->>CI: Trigger CI checks
    CI->>Repo: Run tests
    CI->>Repo: Validate changes
    Repo->>Dev: PR ready for review

Possible Issues

No major issues identified.

Security Hotspots

No significant security hotspots identified.

Copy link

bedrock debug - [puLL-Merge] - openai/[email protected]

Diff
diff --git .release-please-manifest.json .release-please-manifest.json
index 6b843f931..e66c326a9 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
 {
-  ".": "4.77.0"
+  ".": "4.77.4"
 }
diff --git .stats.yml .stats.yml
index 7b5235e3c..d223c8f1f 100644
--- .stats.yml
+++ .stats.yml
@@ -1,2 +1,2 @@
 configured_endpoints: 68
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-0d64ca9e45f51b4279f87b205eeb3a3576df98407698ce053f2e2302c1c08df1.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-02200a58ed631064b6419711da99fefd6e97bdbbeb577a80a1a6e0c8dbcb18f5.yml
diff --git CHANGELOG.md CHANGELOG.md
index d33ce4c1a..7a811f188 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,48 @@
 # Changelog
 
+## 4.77.4 (2025-01-08)
+
+Full Changelog: [v4.77.3...v4.77.4](https://github.com/openai/openai-node/compare/v4.77.3...v4.77.4)
+
+### Documentation
+
+* **readme:** fix misplaced period ([#1252](https://github.com/openai/openai-node/issues/1252)) ([c2fe465](https://github.com/openai/openai-node/commit/c2fe46522d59d1611ba8bb2b7e070f9be7264df0))
+
+## 4.77.3 (2025-01-03)
+
+Full Changelog: [v4.77.2...v4.77.3](https://github.com/openai/openai-node/compare/v4.77.2...v4.77.3)
+
+### Chores
+
+* **api:** bump spec version ([#1248](https://github.com/openai/openai-node/issues/1248)) ([37b3df9](https://github.com/openai/openai-node/commit/37b3df9ac6af76fea6eace8307aab9f0565e5660))
+
+## 4.77.2 (2025-01-02)
+
+Full Changelog: [v4.77.1...v4.77.2](https://github.com/openai/openai-node/compare/v4.77.1...v4.77.2)
+
+### Chores
+
+* bump license year ([#1246](https://github.com/openai/openai-node/issues/1246)) ([13197c1](https://github.com/openai/openai-node/commit/13197c1698f492529bd00b62d95f83c039ef0ac7))
+
+## 4.77.1 (2024-12-21)
+
+Full Changelog: [v4.77.0...v4.77.1](https://github.com/openai/openai-node/compare/v4.77.0...v4.77.1)
+
+### Bug Fixes
+
+* **client:** normalize method ([#1235](https://github.com/openai/openai-node/issues/1235)) ([4a213da](https://github.com/openai/openai-node/commit/4a213dad6f2104dc02a75724acc62134d25db472))
+
+
+### Chores
+
+* **internal:** spec update ([#1231](https://github.com/openai/openai-node/issues/1231)) ([a97ea73](https://github.com/openai/openai-node/commit/a97ea73cafcb56e94be7ff691c4022da575cf60e))
+
+
+### Documentation
+
+* minor formatting changes ([#1236](https://github.com/openai/openai-node/issues/1236)) ([6387968](https://github.com/openai/openai-node/commit/63879681ccaca3dc1e17b27464e2f830b8f63b4f))
+* **readme:** add alpha callout ([f2eff37](https://github.com/openai/openai-node/commit/f2eff3780e1216f7f420f7b86d47f4e21986b10e))
+
 ## 4.77.0 (2024-12-17)
 
 Full Changelog: [v4.76.3...v4.77.0](https://github.com/openai/openai-node/compare/v4.76.3...v4.77.0)
diff --git CONTRIBUTING.md CONTRIBUTING.md
index e8bbc1b07..dde09d52d 100644
--- CONTRIBUTING.md
+++ CONTRIBUTING.md
@@ -1,6 +1,6 @@
 ## Setting up the environment
 
-This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable).
+This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install).
 Other package managers may work but are not officially supported for development.
 
 To set up the repository, run:
@@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can
 …
 \`\`\`
 
-```
-chmod +x examples/<your-example>.ts
+```sh
+$ chmod +x examples/<your-example>.ts
 # run the example against your api
-yarn tsn -T examples/<your-example>.ts
+$ yarn tsn -T examples/<your-example>.ts

Using the repository from source

diff --git LICENSE LICENSE
index 621a6becf..f011417af 100644
--- LICENSE
+++ LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

  • Copyright 2024 OpenAI
  • Copyright 2025 OpenAI

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    diff --git README.md README.md
    index b03bcd870..3039857a1 100644
    --- README.md
    +++ README.md
    @@ -1,3 +1,9 @@
    +> [!IMPORTANT]
    +> We're actively working on a new alpha version that migrates from node-fetch to builtin fetch.
    +>
    +> Please try it out and let us know if you run into any issues!
    +> https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774

OpenAI TypeScript and JavaScript API Library

NPM version npm bundle size JSR Version
@@ -625,7 +631,7 @@ await client.models.list({
This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
    -2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
    +2. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
diff --git jsr.json jsr.json
index d76a2040e..da442da31 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",

  • "version": "4.77.0",
  • "version": "4.77.4",
    "exports": "./index.ts",
    "publish": {
    "exclude": [
    diff --git package.json package.json
    index 54633aa5d..453859b6b 100644
    --- package.json
    +++ package.json
    @@ -1,6 +1,6 @@
    {
    "name": "openai",
  • "version": "4.77.0",
  • "version": "4.77.4",
    "description": "The official TypeScript library for the OpenAI API",
    "author": "OpenAI [email protected]",
    "types": "dist/index.d.ts",
    diff --git src/core.ts src/core.ts
    index 68f1e676a..972cceaec 100644
    --- src/core.ts
    +++ src/core.ts
    @@ -557,9 +557,19 @@ export abstract class APIClient {

    const timeout = setTimeout(() => controller.abort(), ms);

  • const fetchOptions = {

  •  signal: controller.signal as any,
    
  •  ...options,
    
  • };

  • if (fetchOptions.method) {

  •  // Custom methods like 'patch' need to be uppercased
    
  •  // See https://github.com/nodejs/undici/issues/2294
    
  •  fetchOptions.method = fetchOptions.method.toUpperCase();
    
  • }

  • return (
    // use undefined this binding; fetch errors if bound to something else in browser/cloudflare

  •  this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => {
    
  •  this.fetch.call(undefined, url, fetchOptions).finally(() => {
       clearTimeout(timeout);
     })
    

    );
    diff --git src/version.ts src/version.ts
    index fdf4e5224..7f6adc9bc 100644
    --- src/version.ts
    +++ src/version.ts
    @@ -1 +1 @@
    -export const VERSION = '4.77.0'; // x-release-please-version
    +export const VERSION = '4.77.4'; // x-release-please-version
    diff --git tests/index.test.ts tests/index.test.ts
    index bf113e7bb..a6f0040a4 100644
    --- tests/index.test.ts
    +++ tests/index.test.ts
    @@ -122,6 +122,19 @@ describe('instantiate client', () => {
    expect(spy).toHaveBeenCalledTimes(1);
    });

  • test('normalized method', async () => {

  • let capturedRequest: RequestInit | undefined;

  • const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => {

  •  capturedRequest = init;
    
  •  return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } });
    
  • };

  • const client = new OpenAI({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch });

  • await client.patch('/foo');

  • expect(capturedRequest?.method).toEqual('PATCH');

  • });

  • describe('baseUrl', () => {
    test('trailing slash', () => {
    const client = new OpenAI({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' });


</details>

### Description
This PR updates the OpenAI Node.js client library from version 4.77.0 to 4.77.4. It includes several minor changes, bug fixes, documentation updates, and internal improvements.

<details>
<summary><i>Changes</i></summary>

### Changes

1. `.release-please-manifest.json`:
   - Updated version from 4.77.0 to 4.77.4

2. `.stats.yml`:
   - Updated OpenAPI spec URL

3. `CHANGELOG.md`:
   - Added entries for versions 4.77.1 to 4.77.4
   - Includes bug fixes, documentation updates, and internal changes

4. `CONTRIBUTING.md`:
   - Minor formatting changes in code examples

5. `LICENSE`:
   - Updated copyright year from 2024 to 2025

6. `README.md`:
   - Added an important notice about a new alpha version
   - Fixed a minor punctuation issue

7. `jsr.json` and `package.json`:
   - Updated version from 4.77.0 to 4.77.4

8. `src/core.ts`:
   - Added method normalization for custom HTTP methods

9. `src/version.ts`:
   - Updated version from 4.77.0 to 4.77.4

10. `tests/index.test.ts`:
    - Added a new test for normalized method handling

```mermaid
sequenceDiagram
    participant Dev as Developer
    participant Repo as GitHub Repository
    participant NPM as NPM Registry
    participant Users as Library Users

    Dev->>Repo: Update version numbers and changelog
    Dev->>Repo: Add alpha version notice to README
    Dev->>Repo: Implement method normalization
    Dev->>Repo: Update copyright year
    Dev->>Repo: Add new test for method normalization
    Repo->>NPM: Publish new version 4.77.4
    Users->>NPM: Update to latest version
    Users->>Users: Benefit from bug fixes and improvements

Possible Issues

No major non-security issues identified.

Security Hotspots

No significant security hotspots identified in this change.

@thypon thypon merged commit 6c28442 into main Jan 15, 2025
8 checks passed
@thypon thypon deleted the renovate/openai-4.x-lockfile branch January 15, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant