feat: optimize web reader summary in 3.5 (#933)

This commit is contained in:
takatost 2023-08-21 11:58:01 +08:00 committed by GitHub
parent 4ff1870a4b
commit 4c49ecedb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,8 @@ class WebReaderTool(BaseTool):
texts = character_splitter.split_text(page_contents)
docs = [Document(page_content=t) for t in texts]
docs = docs[1:]
# only use first 5 docs
if len(docs) > 5:
docs = docs[:5]