-
Notifications
You must be signed in to change notification settings - Fork 1
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.76.3 #222
Conversation
4fd9893
to
49b8850
Compare
openai debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..47a7d26b6 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.2"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..27946ddea 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git jsr.json jsr.json
index 2c6820969..101edee15 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"exports": "./index.ts",
"publish": {
"exclude": [
diff --git package.json package.json
index fae301ee7..53b82f070 100644
--- package.json
+++ package.json
@@ -1,6 +1,6 @@
{
"name": "openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"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 0c8e69ffc..e1a93f272 100644
--- src/core.ts
+++ src/core.ts
@@ -558,19 +558,13 @@ export abstract class APIClient {
const timeout = setTimeout(() => controller.abort(), ms);
return (
- this.getRequestClient()
- // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
- .fetch.call(undefined, url, { signal: controller.signal as any, ...options })
- .finally(() => {
- clearTimeout(timeout);
- })
+ // 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(() => {
+ clearTimeout(timeout);
+ })
);
}
- protected getRequestClient(): RequestClient {
- return { fetch: this.fetch };
- }
-
private shouldRetry(response: Response): boolean {
// Note this is not a standard header.
const shouldRetryHeader = response.headers.get('x-should-retry');
@@ -1019,8 +1013,8 @@ export const safeJSON = (text: string) => {
}
};
-// https://stackoverflow.com/a/19709846
-const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
const isAbsoluteURL = (url: string): boolean => {
return startsWithSchemeRegexp.test(url);
};
diff --git src/error.ts src/error.ts
index 72b4f7bfd..f3dc57610 100644
--- src/error.ts
+++ src/error.ts
@@ -4,10 +4,17 @@ import { castToError, Headers } from './core';
export class OpenAIError extends Error {}
-export class APIError extends OpenAIError {
- readonly status: number | undefined;
- readonly headers: Headers | undefined;
- readonly error: Object | undefined;
+export class APIError<
+ TStatus extends number | undefined = number | undefined,
+ THeaders extends Headers | undefined = Headers | undefined,
+ TError extends Object | undefined = Object | undefined,
+> extends OpenAIError {
+ /** HTTP status for the response that caused the error */
+ readonly status: TStatus;
+ /** HTTP headers for the response that caused the error */
+ readonly headers: THeaders;
+ /** JSON body of the response that caused the error */
+ readonly error: TError;
readonly code: string | null | undefined;
readonly param: string | null | undefined;
@@ -15,19 +22,14 @@ export class APIError extends OpenAIError {
readonly request_id: string | null | undefined;
- constructor(
- status: number | undefined,
- error: Object | undefined,
- message: string | undefined,
- headers: Headers | undefined,
- ) {
+ constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
super(`${APIError.makeMessage(status, error, message)}`);
this.status = status;
this.headers = headers;
this.request_id = headers?.['x-request-id'];
+ this.error = error;
const data = error as Record<string, any>;
- this.error = data;
this.code = data?.['code'];
this.param = data?.['param'];
this.type = data?.['type'];
@@ -60,7 +62,7 @@ export class APIError extends OpenAIError {
message: string | undefined,
headers: Headers | undefined,
): APIError {
- if (!status) {
+ if (!status || !headers) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError {
}
}
-export class APIUserAbortError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> {
constructor({ message }: { message?: string } = {}) {
super(undefined, undefined, message || 'Request was aborted.', undefined);
}
}
-export class APIConnectionError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIConnectionError extends APIError<undefined, undefined, undefined> {
constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
super(undefined, undefined, message || 'Connection error.', undefined);
// in some environments the 'cause' property is already declared
@@ -127,35 +125,21 @@ export class APIConnectionTimeoutError extends APIConnectionError {
}
}
-export class BadRequestError extends APIError {
- override readonly status: 400 = 400;
-}
+export class BadRequestError extends APIError<400, Headers> {}
-export class AuthenticationError extends APIError {
- override readonly status: 401 = 401;
-}
+export class AuthenticationError extends APIError<401, Headers> {}
-export class PermissionDeniedError extends APIError {
- override readonly status: 403 = 403;
-}
+export class PermissionDeniedError extends APIError<403, Headers> {}
-export class NotFoundError extends APIError {
- override readonly status: 404 = 404;
-}
+export class NotFoundError extends APIError<404, Headers> {}
-export class ConflictError extends APIError {
- override readonly status: 409 = 409;
-}
+export class ConflictError extends APIError<409, Headers> {}
-export class UnprocessableEntityError extends APIError {
- override readonly status: 422 = 422;
-}
+export class UnprocessableEntityError extends APIError<422, Headers> {}
-export class RateLimitError extends APIError {
- override readonly status: 429 = 429;
-}
+export class RateLimitError extends APIError<429, Headers> {}
-export class InternalServerError extends APIError {}
+export class InternalServerError extends APIError<number, Headers> {}
export class LengthFinishReasonError extends OpenAIError {
constructor() {
diff --git src/version.ts src/version.ts
index b4cc35ca9..7117b1feb 100644
--- src/version.ts
+++ src/version.ts
@@ -1 +1 @@
-export const VERSION = '4.76.0'; // x-release-please-version
+export const VERSION = '4.76.2'; // x-release-please-version
DescriptionThis pull request updates the package version from Possible IssuesNone identified. Security HotspotsNone identified. ChangesChanges
|
anthropic debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..47a7d26b6 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.2"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..27946ddea 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git jsr.json jsr.json
index 2c6820969..101edee15 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"exports": "./index.ts",
"publish": {
"exclude": [
diff --git package.json package.json
index fae301ee7..53b82f070 100644
--- package.json
+++ package.json
@@ -1,6 +1,6 @@
{
"name": "openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"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 0c8e69ffc..e1a93f272 100644
--- src/core.ts
+++ src/core.ts
@@ -558,19 +558,13 @@ export abstract class APIClient {
const timeout = setTimeout(() => controller.abort(), ms);
return (
- this.getRequestClient()
- // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
- .fetch.call(undefined, url, { signal: controller.signal as any, ...options })
- .finally(() => {
- clearTimeout(timeout);
- })
+ // 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(() => {
+ clearTimeout(timeout);
+ })
);
}
- protected getRequestClient(): RequestClient {
- return { fetch: this.fetch };
- }
-
private shouldRetry(response: Response): boolean {
// Note this is not a standard header.
const shouldRetryHeader = response.headers.get('x-should-retry');
@@ -1019,8 +1013,8 @@ export const safeJSON = (text: string) => {
}
};
-// https://stackoverflow.com/a/19709846
-const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
const isAbsoluteURL = (url: string): boolean => {
return startsWithSchemeRegexp.test(url);
};
diff --git src/error.ts src/error.ts
index 72b4f7bfd..f3dc57610 100644
--- src/error.ts
+++ src/error.ts
@@ -4,10 +4,17 @@ import { castToError, Headers } from './core';
export class OpenAIError extends Error {}
-export class APIError extends OpenAIError {
- readonly status: number | undefined;
- readonly headers: Headers | undefined;
- readonly error: Object | undefined;
+export class APIError<
+ TStatus extends number | undefined = number | undefined,
+ THeaders extends Headers | undefined = Headers | undefined,
+ TError extends Object | undefined = Object | undefined,
+> extends OpenAIError {
+ /** HTTP status for the response that caused the error */
+ readonly status: TStatus;
+ /** HTTP headers for the response that caused the error */
+ readonly headers: THeaders;
+ /** JSON body of the response that caused the error */
+ readonly error: TError;
readonly code: string | null | undefined;
readonly param: string | null | undefined;
@@ -15,19 +22,14 @@ export class APIError extends OpenAIError {
readonly request_id: string | null | undefined;
- constructor(
- status: number | undefined,
- error: Object | undefined,
- message: string | undefined,
- headers: Headers | undefined,
- ) {
+ constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
super(`${APIError.makeMessage(status, error, message)}`);
this.status = status;
this.headers = headers;
this.request_id = headers?.['x-request-id'];
+ this.error = error;
const data = error as Record<string, any>;
- this.error = data;
this.code = data?.['code'];
this.param = data?.['param'];
this.type = data?.['type'];
@@ -60,7 +62,7 @@ export class APIError extends OpenAIError {
message: string | undefined,
headers: Headers | undefined,
): APIError {
- if (!status) {
+ if (!status || !headers) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError {
}
}
-export class APIUserAbortError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> {
constructor({ message }: { message?: string } = {}) {
super(undefined, undefined, message || 'Request was aborted.', undefined);
}
}
-export class APIConnectionError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIConnectionError extends APIError<undefined, undefined, undefined> {
constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
super(undefined, undefined, message || 'Connection error.', undefined);
// in some environments the 'cause' property is already declared
@@ -127,35 +125,21 @@ export class APIConnectionTimeoutError extends APIConnectionError {
}
}
-export class BadRequestError extends APIError {
- override readonly status: 400 = 400;
-}
+export class BadRequestError extends APIError<400, Headers> {}
-export class AuthenticationError extends APIError {
- override readonly status: 401 = 401;
-}
+export class AuthenticationError extends APIError<401, Headers> {}
-export class PermissionDeniedError extends APIError {
- override readonly status: 403 = 403;
-}
+export class PermissionDeniedError extends APIError<403, Headers> {}
-export class NotFoundError extends APIError {
- override readonly status: 404 = 404;
-}
+export class NotFoundError extends APIError<404, Headers> {}
-export class ConflictError extends APIError {
- override readonly status: 409 = 409;
-}
+export class ConflictError extends APIError<409, Headers> {}
-export class UnprocessableEntityError extends APIError {
- override readonly status: 422 = 422;
-}
+export class UnprocessableEntityError extends APIError<422, Headers> {}
-export class RateLimitError extends APIError {
- override readonly status: 429 = 429;
-}
+export class RateLimitError extends APIError<429, Headers> {}
-export class InternalServerError extends APIError {}
+export class InternalServerError extends APIError<number, Headers> {}
export class LengthFinishReasonError extends OpenAIError {
constructor() {
diff --git src/version.ts src/version.ts
index b4cc35ca9..7117b1feb 100644
--- src/version.ts
+++ src/version.ts
@@ -1 +1 @@
-export const VERSION = '4.76.0'; // x-release-please-version
+export const VERSION = '4.76.2'; // x-release-please-versi,on
DescriptionThis pull request updates the OpenAI Node.js library from version 4.76.0 to 4.76.2. It includes minor changes, bug fixes, and internal improvements. The main changes are version updates, changelog additions, and some code refactoring for improved security and performance. ChangesChanges
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: Refactor core.ts
Dev->>Git: Improve error.ts type definitions
Dev->>Git: Commit changes
Git->>NPM: Publish new version 4.76.2
NPM-->>Dev: Confirm publication
Security Hotspots
|
bedrock debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..47a7d26b6 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.2"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..27946ddea 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git jsr.json jsr.json
index 2c6820969..101edee15 100644
--- jsr.json
+++ jsr.json
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"exports": "./index.ts",
"publish": {
"exclude": [
diff --git package.json package.json
index fae301ee7..53b82f070 100644
--- package.json
+++ package.json
@@ -1,6 +1,6 @@
{
"name": "openai",
- "version": "4.76.0",
+ "version": "4.76.2",
"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 0c8e69ffc..e1a93f272 100644
--- src/core.ts
+++ src/core.ts
@@ -558,19 +558,13 @@ export abstract class APIClient {
const timeout = setTimeout(() => controller.abort(), ms);
return (
- this.getRequestClient()
- // use undefined this binding; fetch errors if bound to something else in browser/cloudflare
- .fetch.call(undefined, url, { signal: controller.signal as any, ...options })
- .finally(() => {
- clearTimeout(timeout);
- })
+ // 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(() => {
+ clearTimeout(timeout);
+ })
);
}
- protected getRequestClient(): RequestClient {
- return { fetch: this.fetch };
- }
-
private shouldRetry(response: Response): boolean {
// Note this is not a standard header.
const shouldRetryHeader = response.headers.get('x-should-retry');
@@ -1019,8 +1013,8 @@ export const safeJSON = (text: string) => {
}
};
-// https://stackoverflow.com/a/19709846
-const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+// https://url.spec.whatwg.org/#url-scheme-string
+const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
const isAbsoluteURL = (url: string): boolean => {
return startsWithSchemeRegexp.test(url);
};
diff --git src/error.ts src/error.ts
index 72b4f7bfd..f3dc57610 100644
--- src/error.ts
+++ src/error.ts
@@ -4,10 +4,17 @@ import { castToError, Headers } from './core';
export class OpenAIError extends Error {}
-export class APIError extends OpenAIError {
- readonly status: number | undefined;
- readonly headers: Headers | undefined;
- readonly error: Object | undefined;
+export class APIError<
+ TStatus extends number | undefined = number | undefined,
+ THeaders extends Headers | undefined = Headers | undefined,
+ TError extends Object | undefined = Object | undefined,
+> extends OpenAIError {
+ /** HTTP status for the response that caused the error */
+ readonly status: TStatus;
+ /** HTTP headers for the response that caused the error */
+ readonly headers: THeaders;
+ /** JSON body of the response that caused the error */
+ readonly error: TError;
readonly code: string | null | undefined;
readonly param: string | null | undefined;
@@ -15,19 +22,14 @@ export class APIError extends OpenAIError {
readonly request_id: string | null | undefined;
- constructor(
- status: number | undefined,
- error: Object | undefined,
- message: string | undefined,
- headers: Headers | undefined,
- ) {
+ constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) {
super(`${APIError.makeMessage(status, error, message)}`);
this.status = status;
this.headers = headers;
this.request_id = headers?.['x-request-id'];
+ this.error = error;
const data = error as Record<string, any>;
- this.error = data;
this.code = data?.['code'];
this.param = data?.['param'];
this.type = data?.['type'];
@@ -60,7 +62,7 @@ export class APIError extends OpenAIError {
message: string | undefined,
headers: Headers | undefined,
): APIError {
- if (!status) {
+ if (!status || !headers) {
return new APIConnectionError({ message, cause: castToError(errorResponse) });
}
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError {
}
}
-export class APIUserAbortError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> {
constructor({ message }: { message?: string } = {}) {
super(undefined, undefined, message || 'Request was aborted.', undefined);
}
}
-export class APIConnectionError extends APIError {
- override readonly status: undefined = undefined;
-
+export class APIConnectionError extends APIError<undefined, undefined, undefined> {
constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) {
super(undefined, undefined, message || 'Connection error.', undefined);
// in some environments the 'cause' property is already declared
@@ -127,35 +125,21 @@ export class APIConnectionTimeoutError extends APIConnectionError {
}
}
-export class BadRequestError extends APIError {
- override readonly status: 400 = 400;
-}
+export class BadRequestError extends APIError<400, Headers> {}
-export class AuthenticationError extends APIError {
- override readonly status: 401 = 401;
-}
+export class AuthenticationError extends APIError<401, Headers> {}
-export class PermissionDeniedError extends APIError {
- override readonly status: 403 = 403;
-}
+export class PermissionDeniedError extends APIError<403, Headers> {}
-export class NotFoundError extends APIError {
- override readonly status: 404 = 404;
-}
+export class NotFoundError extends APIError<404, Headers> {}
-export class ConflictError extends APIError {
- override readonly status: 409 = 409;
-}
+export class ConflictError extends APIError<409, Headers> {}
-export class UnprocessableEntityError extends APIError {
- override readonly status: 422 = 422;
-}
+export class UnprocessableEntityError extends APIError<422, Headers> {}
-export class RateLimitError extends APIError {
- override readonly status: 429 = 429;
-}
+export class RateLimitError extends APIError<429, Headers> {}
-export class InternalServerError extends APIError {}
+export class InternalServerError extends APIError<number, Headers> {}
export class LengthFinishReasonError extends OpenAIError {
constructor() {
diff --git src/version.ts src/version.ts
index b4cc35ca9..7117b1feb 100644
--- src/version.ts
+++ src/version.ts
@@ -1 +1 @@
-export const VERSION = '4.76.0'; // x-release-please-version
+export const VERSION = '4.76.2'; // x-release-please-version
DescriptionThis PR updates the OpenAI Node.js library from version 4.76.0 to 4.76.2. It includes minor chores, internal updates, and type improvements. The changes are primarily focused on maintenance and small enhancements rather than introducing new features. ChangesChanges
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: Refactor error handling in src/error.ts
Dev->>Git: Update isAbsoluteURL in src/core.ts
Dev->>Git: Remove getRequestClient method
Dev->>Git: Commit changes
Git->>NPM: Publish new version 4.76.2
NPM-->>Dev: Confirm publication
Possible IssuesNo major issues are apparent in this PR. The changes are mostly related to version updates and minor improvements. Security HotspotsThere are no significant security hotspots in this PR. The changes do not introduce any new vulnerabilities or security risks. |
49b8850
to
3f7a14a
Compare
anthropic debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..52c31fe71 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.3"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..4b6f57fe4 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,36 @@
# Changelog
+## 4.76.3 (2024-12-13)
+
+Full Changelog: [v4.76.2...v4.76.3](https://github.com/openai/openai-node/compare/v4.76.2...v4.76.3)
+
+### Chores
+
+* **internal:** better ecosystem test debugging ([86fc0a8](https://github.com/openai/openai-node/commit/86fc0a81ede2780d3fcebaabff3d9fa9a36cc9c0))
+
+
+### Documentation
+
+* **README:** fix helpers section links ([#1224](https://github.com/openai/openai-node/issues/1224)) ([efbe30a](https://github.com/openai/openai-node/commit/efbe30a156cec1836d3db28f663066b33be57ba2))
+
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git README.md README.md
index ac9c84a42..b03bcd870 100644
--- README.md
+++ README.md
@@ -200,7 +200,7 @@ main();
\`\`\`
Streaming with `openai.beta.chat.completions.stream({…})` exposes
-[various helpers for your convenience](helpers.md#events) including event handlers and promises.
+[various helpers for your convenience](helpers.md#chat-events) including event handlers and promises.
Alternatively, you can use `openai.chat.completions.create({ stream: true, … })`
which only returns an async iterable of the chunks in the stream and thus uses less memory
@@ -285,12 +285,12 @@ main();
// Final content: "It's looking cold and rainy - you might want to wear a jacket!" -Like with Note that Read more about various examples such as with integrating with zod, File uploadsdiff --git ecosystem-tests/cli.ts ecosystem-tests/cli.ts +// @ts-ignore
-// https://stackoverflow.com/a/19709846 export class OpenAIError extends Error {} -export class APIError extends OpenAIError {
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError { -export class APIUserAbortError extends APIError {
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> { -export class APIConnectionError extends APIError {
+export class APIConnectionError extends APIError<undefined, undefined, undefined> { -export class BadRequestError extends APIError {
-export class AuthenticationError extends APIError {
-export class PermissionDeniedError extends APIError {
-export class NotFoundError extends APIError {
-export class ConflictError extends APIError {
-export class UnprocessableEntityError extends APIError {
-export class RateLimitError extends APIError {
-export class InternalServerError extends APIError {} export class LengthFinishReasonError extends OpenAIError {
Possible IssuesThe addition of the segfault handler in |
bedrock debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..52c31fe71 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.3"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..4b6f57fe4 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,36 @@
# Changelog
+## 4.76.3 (2024-12-13)
+
+Full Changelog: [v4.76.2...v4.76.3](https://github.com/openai/openai-node/compare/v4.76.2...v4.76.3)
+
+### Chores
+
+* **internal:** better ecosystem test debugging ([86fc0a8](https://github.com/openai/openai-node/commit/86fc0a81ede2780d3fcebaabff3d9fa9a36cc9c0))
+
+
+### Documentation
+
+* **README:** fix helpers section links ([#1224](https://github.com/openai/openai-node/issues/1224)) ([efbe30a](https://github.com/openai/openai-node/commit/efbe30a156cec1836d3db28f663066b33be57ba2))
+
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git README.md README.md
index ac9c84a42..b03bcd870 100644
--- README.md
+++ README.md
@@ -200,7 +200,7 @@ main();
\`\`\`
Streaming with `openai.beta.chat.completions.stream({…})` exposes
-[various helpers for your convenience](helpers.md#events) including event handlers and promises.
+[various helpers for your convenience](helpers.md#chat-events) including event handlers and promises.
Alternatively, you can use `openai.chat.completions.create({ stream: true, … })`
which only returns an async iterable of the chunks in the stream and thus uses less memory
@@ -285,12 +285,12 @@ main();
// Final content: "It's looking cold and rainy - you might want to wear a jacket!" -Like with Note that Read more about various examples such as with integrating with zod, File uploadsdiff --git ecosystem-tests/cli.ts ecosystem-tests/cli.ts +// @ts-ignore
-// https://stackoverflow.com/a/19709846 export class OpenAIError extends Error {} -export class APIError extends OpenAIError {
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError { -export class APIUserAbortError extends APIError {
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> { -export class APIConnectionError extends APIError {
+export class APIConnectionError extends APIError<undefined, undefined, undefined> { -export class BadRequestError extends APIError {
-export class AuthenticationError extends APIError {
-export class PermissionDeniedError extends APIError {
-export class NotFoundError extends APIError {
-export class ConflictError extends APIError {
-export class UnprocessableEntityError extends APIError {
-export class RateLimitError extends APIError {
-export class InternalServerError extends APIError {} export class LengthFinishReasonError extends OpenAIError {
|
openai debug - [puLL-Merge] - openai/[email protected] Diffdiff --git .release-please-manifest.json .release-please-manifest.json
index 1cc8c9627..52c31fe71 100644
--- .release-please-manifest.json
+++ .release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "4.76.0"
+ ".": "4.76.3"
}
diff --git CHANGELOG.md CHANGELOG.md
index e68b45e8a..4b6f57fe4 100644
--- CHANGELOG.md
+++ CHANGELOG.md
@@ -1,5 +1,36 @@
# Changelog
+## 4.76.3 (2024-12-13)
+
+Full Changelog: [v4.76.2...v4.76.3](https://github.com/openai/openai-node/compare/v4.76.2...v4.76.3)
+
+### Chores
+
+* **internal:** better ecosystem test debugging ([86fc0a8](https://github.com/openai/openai-node/commit/86fc0a81ede2780d3fcebaabff3d9fa9a36cc9c0))
+
+
+### Documentation
+
+* **README:** fix helpers section links ([#1224](https://github.com/openai/openai-node/issues/1224)) ([efbe30a](https://github.com/openai/openai-node/commit/efbe30a156cec1836d3db28f663066b33be57ba2))
+
+## 4.76.2 (2024-12-12)
+
+Full Changelog: [v4.76.1...v4.76.2](https://github.com/openai/openai-node/compare/v4.76.1...v4.76.2)
+
+### Chores
+
+* **internal:** update isAbsoluteURL ([#1223](https://github.com/openai/openai-node/issues/1223)) ([e908ed7](https://github.com/openai/openai-node/commit/e908ed759996fb7706baf46d094fc77419423971))
+* **types:** nicer error class types + jsdocs ([#1219](https://github.com/openai/openai-node/issues/1219)) ([576d24c](https://github.com/openai/openai-node/commit/576d24cc4b3d766dfe28a6031bdc24ac1b711655))
+
+## 4.76.1 (2024-12-10)
+
+Full Changelog: [v4.76.0...v4.76.1](https://github.com/openai/openai-node/compare/v4.76.0...v4.76.1)
+
+### Chores
+
+* **internal:** bump cross-spawn to v7.0.6 ([#1217](https://github.com/openai/openai-node/issues/1217)) ([c07ad29](https://github.com/openai/openai-node/commit/c07ad298d58e5aeaf816ee3de65fd59bf3fc8b66))
+* **internal:** remove unnecessary getRequestClient function ([#1215](https://github.com/openai/openai-node/issues/1215)) ([bef3925](https://github.com/openai/openai-node/commit/bef392526cd339f45c574bc476649c77be36c612))
+
## 4.76.0 (2024-12-05)
Full Changelog: [v4.75.0...v4.76.0](https://github.com/openai/openai-node/compare/v4.75.0...v4.76.0)
diff --git README.md README.md
index ac9c84a42..b03bcd870 100644
--- README.md
+++ README.md
@@ -200,7 +200,7 @@ main();
\`\`\`
Streaming with `openai.beta.chat.completions.stream({…})` exposes
-[various helpers for your convenience](helpers.md#events) including event handlers and promises.
+[various helpers for your convenience](helpers.md#chat-events) including event handlers and promises.
Alternatively, you can use `openai.chat.completions.create({ stream: true, … })`
which only returns an async iterable of the chunks in the stream and thus uses less memory
@@ -285,12 +285,12 @@ main();
// Final content: "It's looking cold and rainy - you might want to wear a jacket!" -Like with Note that Read more about various examples such as with integrating with zod, File uploadsdiff --git ecosystem-tests/cli.ts ecosystem-tests/cli.ts +// @ts-ignore
-// https://stackoverflow.com/a/19709846 export class OpenAIError extends Error {} -export class APIError extends OpenAIError {
@@ -102,17 +104,13 @@ export class APIError extends OpenAIError { -export class APIUserAbortError extends APIError {
+export class APIUserAbortError extends APIError<undefined, undefined, undefined> { -export class APIConnectionError extends APIError {
+export class APIConnectionError extends APIError<undefined, undefined, undefined> { -export class BadRequestError extends APIError {
-export class AuthenticationError extends APIError {
-export class PermissionDeniedError extends APIError {
-export class NotFoundError extends APIError {
-export class ConflictError extends APIError {
-export class UnprocessableEntityError extends APIError {
-export class RateLimitError extends APIError {
-export class InternalServerError extends APIError {} export class LengthFinishReasonError extends OpenAIError {
Filename: CHANGELOG.md
Filename: README.md
- [various helpers for your convenience](helpers.md#events)
+ [various helpers for your convenience](helpers.md#chat-events)
- [helpers and events](helpers.md#events).
+ [helpers and events](helpers.md#chat-events).
- [next.js](helpers.md#integrate-wtih-next-js)
+ [next.js](helpers.md#integrate-with-nextjs) Filename: ecosystem-tests/cli.ts
+ // @ts-ignore
+ var SegfaultHandler = require('segfault-handler');
+ SegfaultHandler.registerHandler('crash.log'); Filename: jsr.json
- "version": "4.76.0"
+ "version": "4.76.3" Filename: package.json
- "version": "4.76.0"
+ "version": "4.76.3"
+ "segfault-handler": "^1.3.0", Filename: src/core.ts
- this.getRequestClient().fetch.call(undefined, url, { signal: controller.signal as any, ...options })
+ this.fetch.call(undefined, url, { signal: controller.signal as any, ...options })
- protected getRequestClient(): RequestClient {
- return { fetch: this.fetch };
- }
- // https://stackoverflow.com/a/19709846
- const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i');
+ // https://url.spec.whatwg.org/#url-scheme-string
+ const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; Filename: src/error.ts
Filename: src/version.ts
- export const VERSION = '4.76.0'; // x-release-please-version
+ export const VERSION = '4.76.3'; // x-release-please-version sequenceDiagram
participant Developer
participant GitHub Repo
participant SDK Library
Developer->>GitHub Repo: Creates pull request
GitHub Repo->>Developer: Reviews changes
activate GitHub Repo
GitHub Repo->>SDK Library: Updates version to 4.76.3
GitHub Repo->>SDK Library: Updates CHANGELOG.md
GitHub Repo->>SDK Library: Fixes documentation links
GitHub Repo-->>Developer: Updates ecosystem tests with segfault handler
deactivate GitHub Repo
Security Hotspots
|
This PR contains the following updates:
4.76.0
->4.76.3
Release Notes
openai/openai-node (openai)
v4.76.3
Compare Source
Full Changelog: v4.76.2...v4.76.3
Chores
Documentation
v4.76.2
Compare Source
Full Changelog: v4.76.1...v4.76.2
Chores
v4.76.1
Compare Source
Full Changelog: v4.76.0...v4.76.1
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.
This PR was generated by Mend Renovate. View the repository job log.