Skip to content

Commit

Permalink
pass in authoptions correctly from initialization down to connection sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelcatgg committed Dec 8, 2023
1 parent 00c7ff1 commit c8b33b7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions langchain/src/vectorstores/googlevertexai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
*/
index: string;

/**
* Explicitly set Google Auth credentials if you cannot get them from google auth application-default login
* This is useful for serverless or autoscaling environments like Fargate
*/
authOptions: GoogleAuthOptions;

/**
* The id for the "deployed index", which is an identifier in the
* index endpoint that references the index (but is not the index id)
Expand Down Expand Up @@ -376,6 +382,7 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
this.location = args.location ?? this.location;
this.indexEndpoint = args.indexEndpoint ?? this.indexEndpoint;
this.index = args.index ?? this.index;
this.authOptions = args.authOptions ?? this.authOptions;

this.callerParams = args.callerParams ?? this.callerParams;
this.callerOptions = args.callerOptions ?? this.callerOptions;
Expand All @@ -386,6 +393,7 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
location: this.location,
apiVersion: this.apiVersion,
indexEndpoint: this.indexEndpoint,
authOptions: this.authOptions,
};
this.indexEndpointClient = new IndexEndpointConnection(
indexClientParams,
Expand All @@ -397,6 +405,7 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
location: this.location,
apiVersion: this.apiVersion,
index: this.index,
authOptions: this.authOptions,
};
this.removeDatapointClient = new RemoveDatapointConnection(
removeClientParams,
Expand All @@ -408,6 +417,7 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
location: this.location,
apiVersion: this.apiVersion,
index: this.index,
authOptions: this.authOptions,
};
this.upsertDatapointClient = new UpsertDatapointConnection(
upsertClientParams,
Expand Down Expand Up @@ -613,6 +623,7 @@ export class MatchingEngine extends VectorStore implements MatchingEngineArgs {
apiVersion: this.apiVersion,
location: this.location,
deployedIndexId,
authOptions: this.authOptions,
};
const connection = new FindNeighborsConnection(
findNeighborsParams,
Expand Down

0 comments on commit c8b33b7

Please sign in to comment.