fix(docreader): remove default 100-page limit for DOCX parsing
The default DOCREADER_DOCX_MAX_PAGES=100 silently truncates large documents, causing users to see at most ~1000 chunks regardless of document length. Change the default to 0 (no limit) so all pages are processed. Operators who need a cap can still set the env var. Fixes #719
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ def load_config() -> DocReaderConfig:
|
||||
* 1024
|
||||
)
|
||||
grpc_port = _get_int(["DOCREADER_GRPC_PORT", "PORT"], 50051)
|
||||
docx_max_pages = _get_int(["DOCREADER_DOCX_MAX_PAGES"], 100)
|
||||
docx_max_pages = _get_int(["DOCREADER_DOCX_MAX_PAGES"], 0)
|
||||
|
||||
external_http_proxy = _get_str(
|
||||
["DOCREADER_EXTERNAL_HTTP_PROXY", "EXTERNAL_HTTP_PROXY"], ""
|
||||
|
||||
@@ -97,6 +97,8 @@ class DocxParser(BaseParser):
|
||||
"""
|
||||
super().__init__(**kwargs)
|
||||
self.max_pages = CONFIG.docx_max_pages if max_pages is None else max_pages
|
||||
if self.max_pages <= 0:
|
||||
self.max_pages = 100000 # no limit (matches Docx.__call__ default)
|
||||
logger.info(f"DocxParser initialized with max_pages={self.max_pages}")
|
||||
|
||||
def parse_into_text(self, content: bytes) -> DocumentModel:
|
||||
|
||||
Reference in New Issue
Block a user