fix(documents): preserve complete PDF pages across reads
This commit is contained in:
1 parent
42276f4884
commit
5f6e8a6baa
3 files changed
+77
-3
No files matched your search
@@ -446,6 +446,11 @@ class ReadFileTool(_FsTool):
|
||||
return f"(PDF has no extractable text: {fp})"
|
||||
|
||||
result = extraction.text
|
||||
if extraction.truncated:
|
||||
result += (
|
||||
f"\n\n(Page {extraction.end_page + 1} was truncated; "
|
||||
"the remaining text on this page is not shown.)"
|
||||
)
|
||||
if extraction.end_page < extraction.total_pages - 1:
|
||||
next_start = extraction.end_page + 2
|
||||
next_end = min(extraction.end_page + 1 + self._MAX_PDF_PAGES, extraction.total_pages)
|
||||
|
||||
Reference in new issue
Block a user