diff --git a/packages/components/credentials/GoogleAuth.credential.ts b/packages/components/credentials/GoogleAuth.credential.ts index bd83a908..bd9decd0 100644 --- a/packages/components/credentials/GoogleAuth.credential.ts +++ b/packages/components/credentials/GoogleAuth.credential.ts @@ -49,7 +49,6 @@ class GoogleVertexAuth implements INodeCredential { optional: true }, - { label: 'Project ID', name: 'projectID', diff --git a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts index 99ee78b5..a443e9f0 100644 --- a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts +++ b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts @@ -43,19 +43,18 @@ class GoogleVertexAIEmbedding_Embeddings implements INode { if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential) throw new Error('Please specify your Google Application Credential') - const inputs = [ - googleApplicationCredentialFilePath, - googleApplicationCredential, - skipExtraCredentialFile - ]; - + const inputs = [googleApplicationCredentialFilePath, googleApplicationCredential, skipExtraCredentialFile] + if (inputs.filter(Boolean).length > 1) { - throw new Error('Error: More than one component has been inputted. Please use only one of the following: Google Application Credential File Path, Google Credential JSON Object, or Skip Extra Credential File.') + throw new Error( + 'Error: More than one component has been inputted. Please use only one of the following: Google Application Credential File Path, Google Credential JSON Object, or Skip Extra Credential File.' + ) } const authOptions: GoogleAuthOptions = {} - if (!skipExtraCredentialFile){ - if (googleApplicationCredentialFilePath && !googleApplicationCredential) authOptions.keyFile = googleApplicationCredentialFilePath + if (!skipExtraCredentialFile) { + if (googleApplicationCredentialFilePath && !googleApplicationCredential) + authOptions.keyFile = googleApplicationCredentialFilePath else if (!googleApplicationCredentialFilePath && googleApplicationCredential) authOptions.credentials = JSON.parse(googleApplicationCredential) diff --git a/packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts b/packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts index ef04883b..cb8ae61c 100644 --- a/packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts +++ b/packages/components/nodes/llms/GoogleVertexAI/GoogleVertexAI.ts @@ -85,22 +85,20 @@ class GoogleVertexAI_LLMs implements INode { const googleApplicationCredential = getCredentialParam('googleApplicationCredential', credentialData, nodeData) const projectID = getCredentialParam('projectID', credentialData, nodeData) - if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential) throw new Error('Please specify your Google Application Credential') - const inputs = [ - googleApplicationCredentialFilePath, - googleApplicationCredential, - skipExtraCredentialFile - ]; - + const inputs = [googleApplicationCredentialFilePath, googleApplicationCredential, skipExtraCredentialFile] + if (inputs.filter(Boolean).length > 1) { - throw new Error('Error: More than one component has been inputted. Please use only one of the following: Google Application Credential File Path, Google Credential JSON Object, or Skip Extra Credential File.') + throw new Error( + 'Error: More than one component has been inputted. Please use only one of the following: Google Application Credential File Path, Google Credential JSON Object, or Skip Extra Credential File.' + ) } const authOptions: GoogleAuthOptions = {} - if (!skipExtraCredentialFile){ - if (googleApplicationCredentialFilePath && !googleApplicationCredential) authOptions.keyFile = googleApplicationCredentialFilePath + if (!skipExtraCredentialFile) { + if (googleApplicationCredentialFilePath && !googleApplicationCredential) + authOptions.keyFile = googleApplicationCredentialFilePath else if (!googleApplicationCredentialFilePath && googleApplicationCredential) authOptions.credentials = JSON.parse(googleApplicationCredential) @@ -114,7 +112,7 @@ class GoogleVertexAI_LLMs implements INode { const obj: Partial = { temperature: parseFloat(temperature), - model: modelName, + model: modelName } if (authOptions) obj.authOptions = authOptions