langchain_community.document_loaders.gcs_directory.GCSDirectoryLoader

class langchain_community.document_loaders.gcs_directory.GCSDirectoryLoader(project_name: str, bucket: str, prefix: str = '', loader_func: Optional[Callable[[str], BaseLoader]] = None, continue_on_failure: bool = False)[source]

[Deprecated] 从GCS目录加载。

Notes

Deprecated since version 0.0.32.

初始化使用存储桶和键名。

参数:

project_name:GCS存储桶所属项目的ID。 bucket:GCS存储桶的名称。 prefix:GCS存储桶的前缀。 loader_func:一个加载器函数,根据file_path参数实例化一个加载器。如果未提供任何内容,GCSFileLoader将使用其默认加载器。 continue_on_failure:对GCS目录中的每个文件使用try-except块。如果设置为`True`,则无法处理文件不会导致错误。

Methods

__init__(project_name, bucket[, prefix, ...])

初始化使用存储桶和键名。

alazy_load()

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

aload()

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

lazy_load()

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

load()

加载文档。

load_and_split([text_splitter])

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

Parameters
  • project_name (str) –

  • bucket (str) –

  • prefix (str) –

  • loader_func (Optional[Callable[[str], BaseLoader]]) –

  • continue_on_failure (bool) –

__init__(project_name: str, bucket: str, prefix: str = '', loader_func: Optional[Callable[[str], BaseLoader]] = None, continue_on_failure: bool = False)[source]

初始化使用存储桶和键名。

参数:

project_name:GCS存储桶所属项目的ID。 bucket:GCS存储桶的名称。 prefix:GCS存储桶的前缀。 loader_func:一个加载器函数,根据file_path参数实例化一个加载器。如果未提供任何内容,GCSFileLoader将使用其默认加载器。 continue_on_failure:对GCS目录中的每个文件使用try-except块。如果设置为`True`,则无法处理文件不会导致错误。

Parameters
  • project_name (str) –

  • bucket (str) –

  • prefix (str) –

  • loader_func (Optional[Callable[[str], BaseLoader]]) –

  • continue_on_failure (bool) –

async alazy_load() AsyncIterator[Document]

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

Return type

AsyncIterator[Document]

async aload() List[Document]

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

Return type

List[Document]

lazy_load() Iterator[Document]

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

Return type

Iterator[Document]

load() List[Document][source]

加载文档。

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 GCSDirectoryLoader