ResendTools 使 Agent 能够使用 Resend 发送电子邮件。

先决条件

以下示例需要 resend 库和来自 Resend 的 API 密钥。

pip install -U resend
export RESEND_API_KEY=***

示例

以下 Agent 将使用 Resend 发送电子邮件

cookbook/tools/resend_tools.py
from agno.agent import Agent
from agno.tools.resend import ResendTools

from_email = "<enter_from_email>"
to_email = "<enter_to_email>"

agent = Agent(tools=[ResendTools(from_email=from_email)], show_tool_calls=True)
agent.print_response(f"Send an email to {to_email} greeting them with hello world")

Toolkit 参数

参数类型默认说明
api_keystr-用于身份验证的 API 密钥。
from_emailstr-在电子邮件通信中用作发件人的电子邮件地址。

Toolkit 函数

函数说明
send_email使用 Resend API 发送电子邮件。

开发者资源