Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix: empty or contains only empty strings. (#2347)

Wang7fad48f42c45
diff --git a/agent/component/retrieval.py b/agent/component/retrieval.py
index dbd087ee89..b6013506ac 100644
--- a/agent/component/retrieval.py
+++ b/agent/component/retrieval.py
@@ -76,7 +76,8 @@ class Retrieval(ComponentBase, ABC):
if not kbinfos["chunks"]:
df = Retrieval.be_output("")
- df["empty_response"] = self._param.empty_response
+ if self._param.empty_response and self._param.empty_response.strip():
+ df["empty_response"] = self._param.empty_response
return df
df = pd.DataFrame(kbinfos["chunks"])