Skip to content

Commit

Permalink
fix: summary no docs (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost authored Aug 31, 2023
1 parent 2191312 commit 78e26f8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions api/core/tool/web_reader_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,9 @@ def _run(self, url: str, summary: bool = False, cursor: int = 0) -> str:
texts = character_splitter.split_text(page_contents)
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."

docs = docs[1:]

# only use first 5 docs
if len(docs) > 5:
docs = docs[:5]
Expand Down

0 comments on commit 78e26f8

Please sign in to comment.