fix: summary no docs (#1073)
This commit is contained in:
parent
2191312bb9
commit
78e26f8b75
1 changed files with 1 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue