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.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: xinference reranker return_documents (#6888)
Weaxscc4785f094d1
diff --git a/api/core/model_runtime/model_providers/xinference/rerank/rerank.py b/api/core/model_runtime/model_providers/xinference/rerank/rerank.pyindex 649898f47a1..b361806bcda 100644--- a/api/core/model_runtime/model_providers/xinference/rerank/rerank.py+++ b/api/core/model_runtime/model_providers/xinference/rerank/rerank.py@@ -57,6 +57,7 @@ class XinferenceRerankModel(RerankModel):documents=docs,query=query,top_n=top_n,+ return_documents=True)except RuntimeError as e:raise InvokeServerUnavailableError(str(e))@@ -66,7 +67,7 @@ class XinferenceRerankModel(RerankModel):for idx, result in enumerate(response['results']):# format documentindex = result['index']- page_content = result['document']+ page_content = result['document'] if isinstance(result['document'], str) else result['document']['text']rerank_document = RerankDocument(index=index,text=page_content,diff --git a/api/tests/integration_tests/model_runtime/__mock/xinference.py b/api/tests/integration_tests/model_runtime/__mock/xinference.pyindex ddb18fe919b..7cb0a1318e9 100644--- a/api/tests/integration_tests/model_runtime/__mock/xinference.py+++ b/api/tests/integration_tests/model_runtime/__mock/xinference.py@@ -106,7 +106,7 @@ class MockXinferenceClass:def _check_cluster_authenticated(self):self._cluster_authed = True- def rerank(self: RESTfulRerankModelHandle, documents: list[str], query: str, top_n: int) -> dict:+ def rerank(self: RESTfulRerankModelHandle, documents: list[str], query: str, top_n: int, return_documents: bool) -> dict:# check if self._model_uid is a valid uuidif not re.match(r'[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}', self._model_uid) and \self._model_uid != 'rerank':