Class DoclingDocumentParser.Builder

java.lang.Object
dev.langchain4j.data.document.parser.docling.DoclingDocumentParser.Builder
Enclosing class:
DoclingDocumentParser

public static final class DoclingDocumentParser.Builder extends Object
  • Method Details

    • doclingClient

      public DoclingDocumentParser.Builder doclingClient(ai.docling.serve.api.DoclingServeApi doclingClient)
    • options

      public DoclingDocumentParser.Builder options(ai.docling.serve.api.convert.request.options.ConvertDocumentOptions options)
    • documentTextExtractor

      public DoclingDocumentParser.Builder documentTextExtractor(Function<ai.docling.serve.api.convert.response.InBodyConvertDocumentResponse, String> documentTextExtractor)
      Sets a custom function to extract text content from the Docling conversion response.

      The function receives the full InBodyConvertDocumentResponse, giving access to the converted document (in various formats: markdown, HTML, text, doctags, JSON), conversion errors, processing time, and status information.

      If not set, defaults to extracting markdown content: response -> response.getDocument().getMarkdownContent().

      Parameters:
      documentTextExtractor - the function to extract document text from the response
      Returns:
      this builder
    • build

      public DoclingDocumentParser build()