Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix tongyi embedding endpoint return None output (#10857)

Jyongbd05df5cc521
diff --git a/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
index c9245bd82dd..a5ce9ead6ee 100644
--- a/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
+++ b/api/core/model_runtime/model_providers/tongyi/rerank/rerank.py
@@ -65,6 +65,8 @@ class GTERerankModel(RerankModel):
)
rerank_documents = []
+ if not response.output:
+ return RerankResult(model=model, docs=rerank_documents)
for _, result in enumerate(response.output.results):
# format document
rerank_document = RerankDocument(