先决条件
以下示例需要resend 库和来自 Resend 的 API 密钥。
示例
以下 Agent 将使用 Resend 发送电子邮件cookbook/tools/resend_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
resend 库和来自 Resend 的 API 密钥。
pip install -U resend
export RESEND_API_KEY=***
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")
| 参数 | 类型 | 默认 | 说明 |
|---|---|---|---|
api_key | str | - | 用于身份验证的 API 密钥。 |
from_email | str | - | 在电子邮件通信中用作发件人的电子邮件地址。 |
| 函数 | 说明 |
|---|---|
send_email | 使用 Resend API 发送电子邮件。 |