Class UrlDocumentLoader
java.lang.Object
dev.langchain4j.data.document.loader.UrlDocumentLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic dev.langchain4j.data.document.Document
Loads a document from the specified URL.static dev.langchain4j.data.document.Document
Loads a document from the specified URL.
-
Constructor Details
-
UrlDocumentLoader
public UrlDocumentLoader()
-
-
Method Details
-
load
public static dev.langchain4j.data.document.Document load(URL url, dev.langchain4j.data.document.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 dev.langchain4j.data.document.Document load(String url, dev.langchain4j.data.document.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.
-