mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
Adapt to the embedding input type parameter
This commit is contained in:
parent
6d2c6caa23
commit
0a9a946e84
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user