langchain_community.document_loaders.toml.TomlLoader

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

加载`TOML`文件。

可以加载单个源文件或单个目录中的多个文件。

使用源文件或目录初始化TomlLoader。

Methods

__init__(source)

使用源文件或目录初始化TomlLoader。

alazy_load()

一个用于文档的惰性加载器。

aload()

将数据加载到文档对象中。

lazy_load()

从源文件或目录中延迟加载TOML文档。

load()

将数据加载到文档对象中。

load_and_split([text_splitter])

加载文档并分割成块。块作为文档返回。

Parameters

source (Union[str, Path]) –

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

使用源文件或目录初始化TomlLoader。

Parameters

source (Union[str, Path]) –

async alazy_load() AsyncIterator[Document]

一个用于文档的惰性加载器。

Return type

AsyncIterator[Document]

async aload() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

lazy_load() Iterator[Document][source]

从源文件或目录中延迟加载TOML文档。

Return type

Iterator[Document]

load() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

加载文档并分割成块。块作为文档返回。

不要覆盖此方法。应该被视为已弃用!

参数:
text_splitter: 用于分割文档的TextSplitter实例。

默认为RecursiveCharacterTextSplitter。

返回:

文档列表。

Parameters

text_splitter (Optional[TextSplitter]) –

Return type

List[Document]

Examples using TomlLoader