浏览代码

Adapt input type parameter with MiniMax embedding model (#9342)

ice yao 6 月之前
父节点
当前提交
5908fd6552
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      api/core/model_runtime/model_providers/minimax/text_embedding/text_embedding.py

+ 2 - 1
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}"
         url = f"{self.api_base}?GroupId={group_id}"
         headers = {"Authorization": "Bearer " + api_key, "Content-Type": "application/json"}
         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:
         try:
             response = post(url, headers=headers, data=dumps(data))
             response = post(url, headers=headers, data=dumps(data))