Class UrlDocumentLoader

java.lang.Object
dev.langchain4j.data.document.loader.UrlDocumentLoader

public class UrlDocumentLoader extends Object
  • Constructor Details

    • UrlDocumentLoader

      public UrlDocumentLoader()
  • Method Details

    • load

      public static Document load(URL url, DocumentParser documentParser)
      Loads a document from the specified URL.
      Parameters:
      url - The URL of the file.
      documentParser - The parser to be used for parsing text from the URL.
      Returns:
      document
    • load

      public static Document load(String url, DocumentParser documentParser)
      Loads a document from the specified URL.
      Parameters:
      url - The URL of the file.
      documentParser - The parser to be used for parsing text from the URL.
      Returns:
      document
      Throws:
      RuntimeException - If specified URL is malformed.