Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass in authoptions correctly from initialization down to connection sdk #3598

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions libs/langchain-community/src/vectorstores/googlevertexai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,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 @@ -377,6 +383,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 @@ -387,6 +394,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 @@ -398,6 +406,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 @@ -409,6 +418,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 @@ -614,6 +624,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