Refactor GoogleVertexAIEmbedding.ts for handling modelName in GoogleVertexAIEmbeddingsParams

This commit is contained in:
Yongtae
2023-09-04 11:02:35 +09:00
parent 95740a8464
commit a373422abf
@@ -81,9 +81,8 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
if (projectID) authOptions.projectId = projectID if (projectID) authOptions.projectId = projectID
} }
const obj: GoogleVertexAIEmbeddingsParams = { const obj: GoogleVertexAIEmbeddingsParams = {}
model: modelName if (modelName) obj.model = modelName
}
if (Object.keys(authOptions).length !== 0) obj.authOptions = authOptions if (Object.keys(authOptions).length !== 0) obj.authOptions = authOptions
const model = new GoogleVertexAIEmbeddings(obj) const model = new GoogleVertexAIEmbeddings(obj)