This commit is contained in:
Yongtae
2023-08-02 22:28:49 +09:00
parent 6f80f87c55
commit 63d920158c
@@ -1,6 +1,6 @@
import { GoogleVertexAIEmbeddings, GoogleVertexAIEmbeddingsParams} from "langchain/embeddings/googlevertexai";
import { GoogleVertexAIEmbeddings, GoogleVertexAIEmbeddingsParams } from 'langchain/embeddings/googlevertexai'
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses} from '../../../src/utils'
import { getBaseClasses } from '../../../src/utils'
class GoogleVertexAIEmbedding_Embeddings implements INode {
label: string
@@ -14,7 +14,6 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
credential: INodeParams
inputs: INodeParams[]
constructor() {
this.label = 'GoogleVertexAI Embeddings'
this.name = 'googlevertexaiEmbeddings'
@@ -35,22 +34,20 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
name: 'textembedding-gecko'
}
],
default: 'textembedding-gecko',
default: 'textembedding-gecko'
}
]
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
const model = nodeData.inputs?.modelName as string
const obj: GoogleVertexAIEmbeddingsParams = {
model
}
const embedding = new GoogleVertexAIEmbeddings(obj);
const embedding = new GoogleVertexAIEmbeddings(obj)
return embedding
}
}
module.exports = { nodeClass: GoogleVertexAIEmbedding_Embeddings }
module.exports = { nodeClass: GoogleVertexAIEmbedding_Embeddings }