langchain_community.chat_loaders.gmail.GMailLoader

class langchain_community.chat_loaders.gmail.GMailLoader(creds: Any, n: int = 100, raise_error: bool = False)[source]

[Deprecated] 从`GMail`加载数据。

有许多种方法可以从GMail加载数据。 目前,这个加载程序在如何加载数据方面有一些固定的看法。 它首先查找您发送过的所有消息。 然后查找您回复以前邮件的消息。 然后获取该先前的电子邮件,并创建一个训练示例,该示例包括该电子邮件,然后是您的电子邮件。

请注意,这里存在明显的限制。例如, 所有创建的示例仅查看上一个电子邮件以获取上下文。

使用方法:

  • 设置Google开发者帐户:

    转到Google开发者控制台,创建一个项目, 并为该项目启用Gmail API。 这将为您提供一个后续需要的credentials.json文件。

Notes

Deprecated since version 0.0.32.

Methods

__init__(creds[, n, raise_error])

lazy_load()

延迟加载聊天会话。

load()

将聊天会话急切加载到内存中。

Parameters
  • creds (Any) –

  • n (int) –

  • raise_error (bool) –

Return type

None

__init__(creds: Any, n: int = 100, raise_error: bool = False) None[source]
Parameters
  • creds (Any) –

  • n (int) –

  • raise_error (bool) –

Return type

None

lazy_load() Iterator[ChatSession][source]

延迟加载聊天会话。

Return type

Iterator[ChatSession]

load() List[ChatSession]

将聊天会话急切加载到内存中。

Return type

List[ChatSession]

Examples using GMailLoader