langchain.document_loaders.toml.TomlLoader¶
- class langchain.document_loaders.toml.TomlLoader(source: Union[str, Path])[source]¶
Bases:
BaseLoaderA TOML document loader that inherits from the BaseLoader class.
This class can be initialized with either a single source file or a source directory containing TOML files.
Initialize the TomlLoader with a source file or directory.
Methods
__init__(source)Initialize the TomlLoader with a source file or directory.
Lazily load the TOML documents from the source file or directory.
load()Load and return all documents.
load_and_split([text_splitter])Load Documents and split into chunks.
- lazy_load() Iterator[Document][source]¶
Lazily load the TOML documents from the source file or directory.
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]¶
Load Documents and split into chunks. Chunks are returned as Documents.
- Parameters
text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.