mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-24 17:00:48 +03:00
move project id and remove location
This commit is contained in:
@@ -17,6 +17,14 @@ class GoogleVertexAuth implements INodeCredential {
|
||||
description: 'Path to your google application credential json file',
|
||||
placeholder: 'your-path/application_default_credentials.json',
|
||||
type: 'string'
|
||||
},
|
||||
{
|
||||
label: 'Project ID',
|
||||
name: 'projectID',
|
||||
description: 'Project ID of GCP. If not provided, it will be read from the credential file',
|
||||
type: 'string',
|
||||
optional: true,
|
||||
additionalParams: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+2
-21
@@ -30,32 +30,14 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
|
||||
type: 'credential',
|
||||
credentialNames: ['googleVertexAuth']
|
||||
}
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Project ID',
|
||||
name: 'projectID',
|
||||
description: 'project id of GCP',
|
||||
type: 'string',
|
||||
additionalParams: true,
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'location',
|
||||
name: 'location',
|
||||
description: 'location of API',
|
||||
type: 'string',
|
||||
additionalParams: true,
|
||||
optional: true
|
||||
}
|
||||
]
|
||||
this.inputs = []
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const projectID = nodeData.inputs?.projectID as string
|
||||
const location = nodeData.inputs?.location as string
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const googleApplicationCredentialFilePath = getCredentialParam('googleApplicationCredentialFilePath', credentialData, nodeData)
|
||||
if (!googleApplicationCredentialFilePath) throw new Error('Please specify your Google Application Credential file path')
|
||||
const projectID = getCredentialParam('projectID', credentialData, nodeData)
|
||||
|
||||
const authOptions: GoogleAuthOptions = {
|
||||
keyFile: googleApplicationCredentialFilePath
|
||||
@@ -66,7 +48,6 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
|
||||
const obj: GoogleVertexAIEmbeddingsParams = {
|
||||
authOptions
|
||||
}
|
||||
if (location) obj.location = location
|
||||
|
||||
const model = new GoogleVertexAIEmbeddings(obj)
|
||||
return model
|
||||
|
||||
Reference in New Issue
Block a user