langchain_community.document_loaders.toml.TomlLoader¶

class langchain_community.document_loaders.toml.TomlLoader(source: Union[str, Path])[source]¶

Load TOML files.

It can load a single source file or several files in a single directory.

Initialize the TomlLoader with a source file or directory.

Methods

__init__(source)

Initialize the TomlLoader with a source file or directory.

lazy_load()

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.

__init__(source: Union[str, Path])[source]¶

Initialize the TomlLoader with a source file or directory.

lazy_load() Iterator[Document][source]¶

Lazily load the TOML documents from the source file or directory.

load() List[Document][source]¶

Load and return all documents.

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.

Examples using TomlLoader¶