Skip to main content
这将帮助你开始使用 the Gmail toolkit. This toolkit interacts with the Gmail API to read messages, draft and send messages, and more. 所有 GmailToolkit 功能和配置的详细文档请前往 API reference.

设置

To use this toolkit, you will need to set up your credentials explained in the Gmail API docs. Once you’ve downloaded the credentials.json file, you can start using the Gmail API.

安装

This toolkit lives in the langchain-google-community package. We’ll need the gmail extra:
To enable automated tracing of individual tools, set your LangSmith API key:

Instantiation

By default the toolkit reads the local credentials.json file. You can also manually provide a Credentials object.

Customizing authentication

Behind the scenes, a googleapi resource is created using the following methods. you can manually build a googleapi resource for more auth control.

Tools

View available tools:

Use within an agent

Below we show how to incorporate the toolkit in提供自然语言接口 agent. We will need a LLM or chat model:

API 参考

所有 GmailToolkit 功能和配置的详细文档请前往 API reference.