mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix: summary no docs (#1073)
This commit is contained in:
parent
2191312bb9
commit
78e26f8b75
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user