Skip to content

Commit

Permalink
Merge branch 'main' into fix/ts-specific-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 committed Jul 3, 2024
2 parents 264738f + 8de11e5 commit d01ba14
Show file tree
Hide file tree
Showing 33 changed files with 1,873 additions and 266 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,6 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

.DS_Store
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ npm install portkey-ai

## Features

The Portkey SDK is built on top of the OpenAI SDK, allowing you to seamlessly integrate Portkey's advanced features while retaining full compatibility with OpenAI methods. With Portkey, you can enhance your interactions with OpenAI or any other OpenAI-like provider by leveraging robust monitoring, reliability, prompt management, and more features - without modifying much of your existing code.

### AI Gateway
<table>
<tr>
Expand Down
210 changes: 204 additions & 6 deletions package-lock.json

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

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "portkey-ai",
"version": "1.1.5",
"version": "1.3.1",
"description": "Node client library for the Portkey API",
"types": "dist/src/index.d.ts",
"main": "dist/src/index.js",
Expand Down Expand Up @@ -41,6 +41,7 @@
},
"dependencies": {
"agentkeepalive": "^4.5.0",
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"openai": "4.36.0"
}
}
17 changes: 17 additions & 0 deletions src/_types/generalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,23 @@ export interface ApiClientInterface {
metadata?: Record<string, unknown> | null | undefined;
Authorization?: string | null | undefined;
cacheForceRefresh?: boolean | null | undefined;
debug?: boolean | null | undefined;
customHost?: string | null | undefined;
openaiProject?: string | null | undefined;
openaiOrganization?: string | null | undefined;
awsSecretAccessKey?: string | null | undefined;
awsAccessKeyId?: string | null | undefined;
awsSessionToken?: string | null | undefined;
awsRegion?: string | null | undefined;
vertexProjectId?: string | null | undefined;
vertexRegion?: string | null | undefined;
workersAiAccountId?: string | null | undefined;
azureResourceName?: string | null | undefined;
azureDeploymentId?: string | null | undefined;
azureApiVersion?: string | null | undefined;
forwardHeaders?: Array<string> | null | undefined;
cacheNamespace?: string | null | undefined;
requestTimeout?: number | null | undefined;
}

export interface APIResponseType {
Expand Down
2 changes: 2 additions & 0 deletions src/apiResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import type { Portkey } from "./index";
export class ApiResource {
protected client: Portkey;
protected post: Portkey["_post"]
protected put: Portkey["_put"]

constructor(client: Portkey) {
this.client = client
this.post = client._post.bind(client)
this.put = client._put.bind(client)
}
}
Loading

0 comments on commit d01ba14

Please sign in to comment.