mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-09 21:04:49 +08:00
fix: fall back from empty Docling native chunks (#15601)
## Summary - keep the native Docling chunking path when it returns usable chunks - fall back to the standard Docling response parser when a chunked request gets HTTP 200 but returns no usable chunks - add a regression test for older Docling servers that accept the chunking request but return a standard conversion payload ## Why Older external Docling servers can accept a request containing `do_chunking: true` and still return the standard conversion response shape. The current code treats any HTTP 200 from the chunked request as a native chunk response, finds no chunk entries, and returns zero sections without trying the standard response parser. Fixes #15569. ## Validation - `python -m pytest test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.py -q` - `python -m py_compile deepdoc\\parser\\docling_parser.py test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.py` - `python -m ruff check deepdoc\\parser\\docling_parser.py test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.py` - `git diff --check`
This commit is contained in:
@@ -477,7 +477,10 @@ class DoclingParser(RAGFlowPdfParser):
|
||||
|
||||
if callback:
|
||||
callback(0.95, f"[Docling] Native chunks received: {len(sections)}")
|
||||
return sections, tables
|
||||
if sections:
|
||||
return sections, tables
|
||||
|
||||
self.logger.warning("[Docling] Native chunking returned no usable chunks; trying standard response parsing.")
|
||||
|
||||
# --- FALLBACK: Standard RAGFlow parsing for older docling servers ---
|
||||
docs = self._extract_remote_document_entries(response_json)
|
||||
|
||||
Reference in New Issue
Block a user