Skip to content

Commit

Permalink
[ENH]: update JS CloudClient to accept tenant parameter (#2726)
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb authored Aug 26, 2024
1 parent 3b096c0 commit bc12ba7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/js/src/CloudClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ import { AuthOptions } from "./auth";
interface CloudClientParams {
apiKey?: string;
database?: string;
tenant?: string;
cloudHost?: string;
cloudPort?: string;
}

class CloudClient extends ChromaClient {
constructor({ apiKey, database, cloudHost, cloudPort }: CloudClientParams) {
constructor({
apiKey,
database,
tenant,
cloudHost,
cloudPort,
}: CloudClientParams) {
// If no API key is provided, try to load it from the environment variable
if (!apiKey) {
apiKey = process.env.CHROMA_API_KEY;
Expand All @@ -35,7 +42,8 @@ class CloudClient extends ChromaClient {
return new ChromaClient({
path: path,
auth: auth,
database: database,
database,
tenant,
});

super();
Expand Down

0 comments on commit bc12ba7

Please sign in to comment.