From a373422abf93fdb2ca92d52f5c9e4dc42f008fde Mon Sep 17 00:00:00 2001 From: Yongtae Date: Mon, 4 Sep 2023 11:02:35 +0900 Subject: [PATCH] Refactor GoogleVertexAIEmbedding.ts for handling modelName in GoogleVertexAIEmbeddingsParams --- .../GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts index 3cbd600a..7d086e0c 100644 --- a/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts +++ b/packages/components/nodes/embeddings/GoogleVertexAIEmbedding/GoogleVertexAIEmbedding.ts @@ -81,9 +81,8 @@ class GoogleVertexAIEmbedding_Embeddings implements INode { if (projectID) authOptions.projectId = projectID } - const obj: GoogleVertexAIEmbeddingsParams = { - model: modelName - } + const obj: GoogleVertexAIEmbeddingsParams = {} + if (modelName) obj.model = modelName if (Object.keys(authOptions).length !== 0) obj.authOptions = authOptions const model = new GoogleVertexAIEmbeddings(obj)