mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
lint fix
This commit is contained in:
@@ -49,7 +49,6 @@ class GoogleVertexAuth implements INodeCredential {
|
|||||||
optional: true
|
optional: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
label: 'Project ID',
|
label: 'Project ID',
|
||||||
name: 'projectID',
|
name: 'projectID',
|
||||||
|
|||||||
+8
-9
@@ -43,19 +43,18 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
|
|||||||
if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential)
|
if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential)
|
||||||
throw new Error('Please specify your Google Application Credential')
|
throw new Error('Please specify your Google Application Credential')
|
||||||
|
|
||||||
const inputs = [
|
const inputs = [googleApplicationCredentialFilePath, googleApplicationCredential, skipExtraCredentialFile]
|
||||||
googleApplicationCredentialFilePath,
|
|
||||||
googleApplicationCredential,
|
|
||||||
skipExtraCredentialFile
|
|
||||||
];
|
|
||||||
|
|
||||||
if (inputs.filter(Boolean).length > 1) {
|
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 = {}
|
const authOptions: GoogleAuthOptions = {}
|
||||||
if (!skipExtraCredentialFile){
|
if (!skipExtraCredentialFile) {
|
||||||
if (googleApplicationCredentialFilePath && !googleApplicationCredential) authOptions.keyFile = googleApplicationCredentialFilePath
|
if (googleApplicationCredentialFilePath && !googleApplicationCredential)
|
||||||
|
authOptions.keyFile = googleApplicationCredentialFilePath
|
||||||
else if (!googleApplicationCredentialFilePath && googleApplicationCredential)
|
else if (!googleApplicationCredentialFilePath && googleApplicationCredential)
|
||||||
authOptions.credentials = JSON.parse(googleApplicationCredential)
|
authOptions.credentials = JSON.parse(googleApplicationCredential)
|
||||||
|
|
||||||
|
|||||||
@@ -85,22 +85,20 @@ class GoogleVertexAI_LLMs implements INode {
|
|||||||
const googleApplicationCredential = getCredentialParam('googleApplicationCredential', credentialData, nodeData)
|
const googleApplicationCredential = getCredentialParam('googleApplicationCredential', credentialData, nodeData)
|
||||||
const projectID = getCredentialParam('projectID', credentialData, nodeData)
|
const projectID = getCredentialParam('projectID', credentialData, nodeData)
|
||||||
|
|
||||||
|
|
||||||
if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential)
|
if (!skipExtraCredentialFile && !googleApplicationCredentialFilePath && !googleApplicationCredential)
|
||||||
throw new Error('Please specify your Google Application Credential')
|
throw new Error('Please specify your Google Application Credential')
|
||||||
const inputs = [
|
const inputs = [googleApplicationCredentialFilePath, googleApplicationCredential, skipExtraCredentialFile]
|
||||||
googleApplicationCredentialFilePath,
|
|
||||||
googleApplicationCredential,
|
|
||||||
skipExtraCredentialFile
|
|
||||||
];
|
|
||||||
|
|
||||||
if (inputs.filter(Boolean).length > 1) {
|
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 = {}
|
const authOptions: GoogleAuthOptions = {}
|
||||||
if (!skipExtraCredentialFile){
|
if (!skipExtraCredentialFile) {
|
||||||
if (googleApplicationCredentialFilePath && !googleApplicationCredential) authOptions.keyFile = googleApplicationCredentialFilePath
|
if (googleApplicationCredentialFilePath && !googleApplicationCredential)
|
||||||
|
authOptions.keyFile = googleApplicationCredentialFilePath
|
||||||
else if (!googleApplicationCredentialFilePath && googleApplicationCredential)
|
else if (!googleApplicationCredentialFilePath && googleApplicationCredential)
|
||||||
authOptions.credentials = JSON.parse(googleApplicationCredential)
|
authOptions.credentials = JSON.parse(googleApplicationCredential)
|
||||||
|
|
||||||
@@ -114,7 +112,7 @@ class GoogleVertexAI_LLMs implements INode {
|
|||||||
|
|
||||||
const obj: Partial<GoogleVertexAITextInput> = {
|
const obj: Partial<GoogleVertexAITextInput> = {
|
||||||
temperature: parseFloat(temperature),
|
temperature: parseFloat(temperature),
|
||||||
model: modelName,
|
model: modelName
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authOptions) obj.authOptions = authOptions
|
if (authOptions) obj.authOptions = authOptions
|
||||||
|
|||||||
Reference in New Issue
Block a user