跳转到内容

Zapier Actions Tool

使用 Zapier adapter 可以将 Zapier actions 列出并作为 CrewAI 工具调用。这使 agents 能够跨数千个应用触发自动化。

该 adapter 已包含在 crewai-tools 中,无需额外安装。

  • ZAPIER_API_KEY(必需):Zapier API key。可在 Zapier Actions 仪表板 https://actions.zapier.com/ 中获取(先创建账户,再生成 API key)。构造 adapter 时也可以直接传入 zapier_api_key
from crewai import Agent, Task, Crew
from crewai_tools.adapters.zapier_adapter import ZapierActionsAdapter
adapter = ZapierActionsAdapter(api_key="your_zapier_api_key")
tools = adapter.tools()
agent = Agent(
role="Automator",
goal="Execute Zapier actions",
backstory="Automation specialist",
tools=tools,
verbose=True,
)
task = Task(
description="Create a new Google Sheet and add a row using Zapier actions",
expected_output="Confirmation with created resource IDs",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
  • 该 adapter 会列出你 key 可用的 actions,并动态创建 BaseTool 包装器。
  • 在任务说明或工具调用中处理各 action 需要的特定字段。
  • 速率限制取决于你的 Zapier 套餐;请参阅 Zapier Actions 文档。
  • 该 adapter 会获取可用 actions,并动态生成 BaseTool 包装器。