Skip to content

Commit

Permalink
Merge branch 'main' into feat/oai4.77.0
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 authored Jan 2, 2025
2 parents ce34e1a + bf7709d commit e98e978
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "portkey-ai",
"version": "1.5.5",
"version": "1.5.7",
"description": "Node client library for the Portkey API",
"types": "dist/src/index.d.ts",
"main": "dist/src/index.js",
Expand Down
20 changes: 20 additions & 0 deletions src/apis/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,26 @@ export class Invites extends ApiResource {
);
return response;
}

resend(
_body: UserInviteGetParams,
params?: ApiClientInterface,
opts?: RequestOptions
): APIPromise<any> {
const body = _body;
const inviteId = body.inviteId;
if (params) {
this.client.customHeaders = {
...this.client.customHeaders,
...createHeaders({ ...params }),
};
}

const response = this.post<any>(`/admin/users/invites/${inviteId}/resend`, {
...opts,
});
return response;
}
}

export class Workspaces extends ApiResource {
Expand Down
2 changes: 1 addition & 1 deletion src/apis/chatCompletions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface Usage {

interface Message {
role: string;
content: string;
content: string | Array<any>;
refusal?: string;
function_call?: any;
tool_calls?: Array<ChatCompletionMessageToolCall>;
Expand Down
6 changes: 4 additions & 2 deletions src/baseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export abstract class ApiClient {
forwardHeaders,
cacheNamespace,
requestTimeout,
strictOpenAiCompliance,
strictOpenAiCompliance = false,
anthropicBeta,
anthropicVersion,
mistralFimCompletion,
Expand Down Expand Up @@ -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 });
}
Expand Down
6 changes: 5 additions & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '1.5.5';
export const VERSION = '1.5.7';

0 comments on commit e98e978

Please sign in to comment.