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: web reader tool retrieve content empty (#957)

takatost5cba2e70875e
diff --git a/api/core/tool/web_reader_tool.py b/api/core/tool/web_reader_tool.py
index 474305ef715..be76839239f 100644
--- a/api/core/tool/web_reader_tool.py
+++ b/api/core/tool/web_reader_tool.py
@@ -88,6 +88,9 @@ class WebReaderTool(BaseTool):
texts = character_splitter.split_text(page_contents)
docs = [Document(page_content=t) for t in texts]
+ if len(docs) == 0:
+ return "No content found."
+
docs = docs[1:]
# only use first 5 docs