Class DocumentLoader

java.lang.Object
dev.langchain4j.data.document.DocumentLoader

public class DocumentLoader extends Object
Utility class for loading documents.
  • Method Details

    • load

      public static Document load(DocumentSource source, DocumentParser parser)
      Loads a document from the given source using the given parser.

      Forwards the source Metadata to the parsed Document.

      Parameters:
      source - The source from which the document will be loaded.
      parser - The parser that will be used to parse the document.
      Returns:
      The loaded document.
      Throws:
      BlankDocumentException - when the parsed Document is blank/empty.