diff --git a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts index fdf7ea978..7d086e0cd 100644 --- a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts +++ b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts @@ -33,11 +33,34 @@ class GoogleVertexAIEmbedding_Embeddings implements INode { description: 'Google Vertex AI credential. If you are using a GCP service like Cloud Run, or if you have installed default credentials on your local machine, you do not need to set this credential.' } - this.inputs = [] + this.inputs = [ + { + label: 'Model Name', + name: 'modelName', + type: 'options', + options: [ + { + label: 'textembedding-gecko@001', + name: 'textembedding-gecko@001' + }, + { + label: 'textembedding-gecko@latest', + name: 'textembedding-gecko@latest' + }, + { + label: 'textembedding-gecko-multilingual@latest', + name: 'textembedding-gecko-multilingual@latest' + } + ], + default: 'textembedding-gecko@001', + optional: true + } + ] } async init(nodeData: INodeData, _: string, options: ICommonObject): Promise { const credentialData = await getCredentialData(nodeData.credential ?? '', options) + const modelName = nodeData.inputs?.modelName as string const googleApplicationCredentialFilePath = getCredentialParam('googleApplicationCredentialFilePath', credentialData, nodeData) const googleApplicationCredential = getCredentialParam('googleApplicationCredential', credentialData, nodeData) const projectID = getCredentialParam('projectID', credentialData, nodeData) @@ -59,6 +82,7 @@ class GoogleVertexAIEmbedding_Embeddings implements INode { if (projectID) authOptions.projectId = projectID } const obj: GoogleVertexAIEmbeddingsParams = {} + if (modelName) obj.model = modelName if (Object.keys(authOptions).length !== 0) obj.authOptions = authOptions const model = new GoogleVertexAIEmbeddings(obj)