mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 02:46:52 +08:00
fix: summary no docs (#1073)
This commit is contained in:
@@ -88,11 +88,9 @@ class WebReaderTool(BaseTool):
|
|||||||
texts = character_splitter.split_text(page_contents)
|
texts = character_splitter.split_text(page_contents)
|
||||||
docs = [Document(page_content=t) for t in texts]
|
docs = [Document(page_content=t) for t in texts]
|
||||||
|
|
||||||
if len(docs) == 0:
|
if len(docs) == 0 or docs[0].page_content.endswith('TEXT:'):
|
||||||
return "No content found."
|
return "No content found."
|
||||||
|
|
||||||
docs = docs[1:]
|
|
||||||
|
|
||||||
# only use first 5 docs
|
# only use first 5 docs
|
||||||
if len(docs) > 5:
|
if len(docs) > 5:
|
||||||
docs = docs[:5]
|
docs = docs[:5]
|
||||||
|
|||||||
Reference in New Issue
Block a user