Class DoclingDocumentParser

java.lang.Object
dev.langchain4j.data.document.parser.docling.DoclingDocumentParser
All Implemented Interfaces:
DocumentParser

public class DoclingDocumentParser extends Object implements DocumentParser
A DocumentParser backed by a Docling Serve instance.

The operation performed by Docling (convert, hierarchical chunking, hybrid chunking, ...) is controlled by the DocumentRequest template supplied to the DoclingDocumentParser.Builder. The template carries everything except the document source: the parser injects the source of the InputStream being parsed into a fresh copy of the template for each call, then routes the request to the matching Docling endpoint. How the resulting response is turned into a Document is controlled by the document extractor (for conversion requests) and the chunk extractor (for chunk requests); text-only variants are also available.

How Docling is actually called is controlled by the request executor. By default the parser calls the asynchronous convert/chunk endpoints and exposes both a blocking parse(InputStream) and a non-blocking parseAsync(InputStream).