RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
fix mutiple retrieval component content (#1997)
H9065fb105072
diff --git a/agent/component/base.py b/agent/component/base.pyindex 103325016b..88c85c3fcc 100644--- a/agent/component/base.py+++ b/agent/component/base.py@@ -448,6 +448,8 @@ class ComponentBase(ABC):if self.component_name.lower() == "generate" and self.get_component_name(u) == "retrieval":o = self._canvas.get_component(u)["obj"].output(allow_partial=False)[1]if o is not None:+ if not "".join(o["content"]):+ continueupstream_outs.append(o)continueif u not in self._canvas.get_component(self._id)["upstream"]: continuediff --git a/agent/component/generate.py b/agent/component/generate.pyindex c3f50f4de2..252526522b 100644--- a/agent/component/generate.py+++ b/agent/component/generate.py@@ -130,8 +130,8 @@ class Generate(ComponentBase):def stream_output(self, chat_mdl, prompt, retrieval_res):res = None- if "empty_response" in retrieval_res.columns and "\n- ".join(retrieval_res["content"]):- res = {"content": "\n- ".join(retrieval_res["content"]), "reference": []}+ if "empty_response" in retrieval_res.columns and not "\n- ".join(retrieval_res["content"]):+ res = {"content": "\n- ".join(retrieval_res["empty_response"]), "reference": []}yield resself.set_output(res)returndiff --git a/agent/component/retrieval.py b/agent/component/retrieval.pyindex 84893d1852..d49ecaa8b1 100644--- a/agent/component/retrieval.py+++ b/agent/component/retrieval.py@@ -75,8 +75,8 @@ class Retrieval(ComponentBase, ABC):aggs=False, rerank_mdl=rerank_mdl)if not kbinfos["chunks"]:- df = Retrieval.be_output(self._param.empty_response)- df["empty_response"] = True+ df = Retrieval.be_output("")+ df["empty_response"] = self._param.empty_responsereturn dfdf = pd.DataFrame(kbinfos["chunks"])