Loads the documents from the provided file paths. It checks if the file
is a directory and ignores it. If a file is a file, it checks if there
is a corresponding loader function for the file extension in the loaders
mapping. If there is, it loads the documents. If there is no
corresponding loader function and unknown
is set to Warn
, it logs a
warning message. If unknown
is set to Error
, it throws an error.
A promise that resolves to an array of loaded documents.
Optional
splitter: BaseDocumentTransformer<DocumentInterface<Record<string, any>>[], DocumentInterface<Record<string, any>>[]>A Promise that resolves with an array of Document instances, each split according to the provided TextSplitter.
A document loader that loads documents from multiple files. It extends the
BaseDocumentLoader
class and implements theload()
method.Example