From 0a9a946e8473353cec1100020e960fe661833ba7 Mon Sep 17 00:00:00 2001 From: iceyao Date: Tue, 15 Oct 2024 00:10:13 +0800 Subject: [PATCH] Adapt to the embedding input type parameter --- .../model_providers/minimax/text_embedding/text_embedding.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py index 74d2a221d1..d031bfa04d 100644 --- a/api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py @@ -61,7 +61,8 @@ class MinimaxTextEmbeddingModel(TextEmbeddingModel): url = f"{self.api_base}?GroupId={group_id}" headers = {"Authorization": "Bearer " + api_key, "Content-Type": "application/json"} - data = {"model": "embo-01", "texts": texts, "type": "db"} + embedding_type = "db" if input_type == EmbeddingInputType.DOCUMENT else "query" + data = {"model": "embo-01", "texts": texts, "type": embedding_type} try: response = post(url, headers=headers, data=dumps(data))