From 959a04844414ad8e11c6ca13c44f5daf359f99ba Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Sat, 14 Dec 2024 13:28:24 +0530 Subject: [PATCH 1/8] feat: user invite resend --- src/apis/admin.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/apis/admin.ts b/src/apis/admin.ts index 1b05aa7..6a74681 100644 --- a/src/apis/admin.ts +++ b/src/apis/admin.ts @@ -376,6 +376,26 @@ export class Invites extends ApiResource { ); return response; } + + resend( + _body: UserInviteGetParams, + params?: ApiClientInterface, + opts?: RequestOptions + ): APIPromise { + const body = _body; + const inviteId = body.inviteId; + if (params) { + this.client.customHeaders = { + ...this.client.customHeaders, + ...createHeaders({ ...params }), + }; + } + + const response = this.post(`/admin/users/invites/${inviteId}/resend`, { + ...opts, + }); + return response; + } } export class Workspaces extends ApiResource { From 47f2745c77c93aa648aac6295315a4fa56e85b90 Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Mon, 16 Dec 2024 17:49:31 +0530 Subject: [PATCH 2/8] feat: setting strictOpenAiCompliance default as false --- src/baseClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/baseClient.ts b/src/baseClient.ts index dd67916..eeb3a14 100644 --- a/src/baseClient.ts +++ b/src/baseClient.ts @@ -166,7 +166,7 @@ export abstract class ApiClient { forwardHeaders, cacheNamespace, requestTimeout, - strictOpenAiCompliance, + strictOpenAiCompliance = false, anthropicBeta, anthropicVersion, mistralFimCompletion, From 0b7ad3eaba7280663a0997628309052442217958 Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Thu, 26 Dec 2024 19:08:28 +0530 Subject: [PATCH 3/8] 1.5.6 --- src/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.ts b/src/version.ts index 2f91e26..4ecc124 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.5.5'; +export const VERSION = '1.5.6'; From 7b46a470d35ebed7a2bdee51aff55d6535ff93ed Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Thu, 26 Dec 2024 19:11:13 +0530 Subject: [PATCH 4/8] 1.5.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1eca8fd..33bff1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "portkey-ai", - "version": "1.5.5", + "version": "1.5.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "portkey-ai", - "version": "1.5.5", + "version": "1.5.6", "license": "MIT", "dependencies": { "agentkeepalive": "^4.5.0", diff --git a/package.json b/package.json index 0979868..f42fff9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "portkey-ai", - "version": "1.5.5", + "version": "1.5.6", "description": "Node client library for the Portkey API", "types": "dist/src/index.d.ts", "main": "dist/src/index.js", From be4168cefec5dcef6377d9e1fc1166c73f48494e Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Tue, 31 Dec 2024 12:14:25 +0530 Subject: [PATCH 5/8] feat: added error message and cause --- src/baseClient.ts | 4 +++- src/error.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/baseClient.ts b/src/baseClient.ts index eeb3a14..a9e007c 100644 --- a/src/baseClient.ts +++ b/src/baseClient.ts @@ -264,7 +264,9 @@ export abstract class ApiClient { // Parse the response and check for errors. if (response instanceof Error) { if (response.name === 'AbortError') { - throw new APIConnectionTimeoutError(); + throw new APIConnectionTimeoutError({ + message: `${response.message} \n STACK: ${response.stack}`, + }); } throw new APIConnectionError({ cause: response }); } diff --git a/src/error.ts b/src/error.ts index 0963a82..b9dec74 100644 --- a/src/error.ts +++ b/src/error.ts @@ -97,7 +97,11 @@ export class APIConnectionError extends APIError { const LOCALHOST_CONNECTION_ERROR = `Could not instantiate the Portkey client. You can either add a valid 'apiKey' parameter (from https://app.portkey.ai/api-keys) or check the 'baseURL' parameter in the Portkey client, - for your AI Gateway's instance's URL.`; + for your AI Gateway's instance's URL. \ + + CAUSE: ${cause} \ + + MESSAGE: ${message}`; super( undefined, undefined, From a9dedb87ac290edca089034d545b258656a7017d Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Tue, 31 Dec 2024 13:28:42 +0530 Subject: [PATCH 6/8] fix: request message content type --- src/apis/chatCompletions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apis/chatCompletions.ts b/src/apis/chatCompletions.ts index e50a888..7a71705 100644 --- a/src/apis/chatCompletions.ts +++ b/src/apis/chatCompletions.ts @@ -84,7 +84,7 @@ interface Usage { interface Message { role: string; - content: string; + content: string | Array; refusal?: string; function_call?: any; tool_calls?: Array; From e0cf8f6c42e3d088eb67fa11083772cb78235922 Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Tue, 31 Dec 2024 13:40:57 +0530 Subject: [PATCH 7/8] 1.5.7 --- src/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.ts b/src/version.ts index 4ecc124..5bd8920 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '1.5.6'; +export const VERSION = '1.5.7'; From 161d63be5e103d86ab9597ae6e9d40e5bc955ba7 Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Tue, 31 Dec 2024 13:41:51 +0530 Subject: [PATCH 8/8] 1.5.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 33bff1b..e5b9f40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "portkey-ai", - "version": "1.5.6", + "version": "1.5.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "portkey-ai", - "version": "1.5.6", + "version": "1.5.7", "license": "MIT", "dependencies": { "agentkeepalive": "^4.5.0", diff --git a/package.json b/package.json index f42fff9..a7fef04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "portkey-ai", - "version": "1.5.6", + "version": "1.5.7", "description": "Node client library for the Portkey API", "types": "dist/src/index.d.ts", "main": "dist/src/index.js",