Files
ragflow/deepdoc/parser
Xiaolong Ma 62028e9c78 Feature: support self-hosted PaddleOCR-VL deployments (#19011)
PaddleOCR could only reach the hosted AI Studio service, whose
asynchronous job API (submit -> poll -> fetch) is unreachable in an
air-gapped install. A self-hosted PaddleOCR-VL exposes a PaddleX
pipeline that answers a single request synchronously instead; the two
protocols share nothing but the result schema.

Pick the protocol from the configured address rather than adding a
second provider, so existing configurations keep working and only the
URL decides: just paddleocr.aistudio-app.com serves the job API, and any
other host gets the synchronous /layout-parsing call. The address is
compared by hostname, so an AI Studio deployment on a sibling subdomain
is routed to the synchronous pipeline while a lookalike domain is not
mistaken for the hosted service. Self-hosted deployments usually run
unauthenticated, so the access token is now required only for the hosted
service.

Fix two defects this exposed on the way:

- A block whose content is nothing but a markdown image became an empty
section carrying a position tag, because emptiness was tested before the
images were stripped. Scanned pages that the layout model labels as one
image block hit this on every page.
- HTTP, JSON and errorCode failures on the synchronous path never
reached the callback, so a wrong path or a rejected token left the
document at zero chunks with no visible cause.

Closes #18757
2026-08-31 12:26:00 +08:00
..
2026-04-03 19:26:45 +08:00