首页 帮助中心 新版 AI 智能体 Introduction to Make AI Agents (New) 步骤 2:创建 AI 智能体工具

步骤 2. 创建 AI agent(智能体)的 tools(工具)

本页面反映的是 旧版 Make AI Agents。有关最新信息,请参阅 Make AI Agents (New)

Make 中的 AI agent(智能体)需要 tools(工具)来完成工作 – 这些 tools(工具)是 modules(模块)、scenario(场景)和 MCP tools(工具)。Agents(智能体)使用您提供的信息来推理如何以及何时使用这些 tools(工具)。

为了告知 AI agent(智能体)上下文,Make 会向 AI 服务提供商发送以下信息: * System prompt(系统提示词) * 每个 tool(工具)的名称和描述 * 用作 tool(工具)的 scenario(场景)的 inputs(输入)或 outputs(输出) 的名称和描述

除了提供上下文外,所有用作 AI agent(智能体)tools(工具)的 scenario(场景)必须处于 active(激活) 状态,并且调度设置为 on demand(按需) 或由 Custom webhook(自定义 Webhook) 触发。

在接下来的部分中,我们将为 agent(智能体)创建一个 tool(工具)来列出商店库存,另一个 tool(工具)用于在库存不足时订购更多存货。

以下部分旨在展示 AI agent(智能体)的推理能力。提供的示例 scenario(场景)已简化以简化其设置。

](https://help.make.com/step-2-create-the-ai-agents-tools#tool-1-scenario-to-list-shop-inventory)Tool 1:列出商店库存的 scenario(场景)">[Tool 1:列出商店库存的 scenario(场景)

我们将为 agent(智能体)提供一个 scenario(场景)来列出商店库存。由于我们想要从 scenario(场景)向 agent(智能体)发送数据,我们必须使用 scenario outputs(场景输出)Scenarios > Return output module(模块)。

创建 scenario(场景)的步骤:

  • 点击组织仪表盘(organization dashboard)或 scenario(场景)列表中的 Create a new scenario 按钮。
  • 如果您没有准备好测试数据,请设置您的商店数据:
  • 1. 将 Data store > Search record module(模块)添加到您的 scenario(场景)。 2. 在 Data store 字段中,选择 Add 以创建新的 data store(数据存储)。 3. 在 Data store name 字段中,填写库存数据存储的名称。 4. 在 Data structure 框中,点击 Add 以定义 data store(数据存储)的结构。 5. !Document image 6. 点击 Save 确认数据结构,并点击 Save 创建 data store(数据存储)。 7. 前往 data store(数据存储)列表并打开新的 data store(数据存储)。 8. 点击 Add 按钮向 data store(数据存储)添加数据: !Document image
  • 更新 scenario(场景)的名称。AI agent(智能体)使用 scenario(场景)名称来决定是否应该运行该 scenario(场景)。填写:"List shop inventory"。
  • 添加 Tools > Text aggregator module(模块)
  • 1. 在 Source module 字段中,保留 data store(数据存储)module(模块)。 2. 启用 module(模块)设置底部的 Advanced settings 切换开关。 3. 在 Row separator 字段中,选择 New row。 4. 在 Text 字段中,映射 data store(数据存储)中的 name 和 quantity 字段: !Document image
  • 添加 Scenarios > Return output module(模块)。
  • 1. 点击 Add scenario outputs 以设置 return data module(模块)的 scenario(场景)outputs(输出)。 2. 在 Scenario outputs 标签页中,定义 scenario(场景)output(输出)结构并填写 output(输出)中每项的描述: !Document image 3. 在 module(模块)设置中,将 text 变量映射到 inventory 字段。 4. 点击 Save 确认 module(模块)设置。
  • 设置 scenario(场景)调度:
  • 1. 将 scenario(场景)调度设置为 On demand。Agent(智能体)将在需要时为您运行 scenario(场景)。 2. 点击 Save 确认 scenario(场景)调度。 3. 激活 scenario(场景)。 4. 保存您的 scenario(场景)。
  • 为 agent(智能体)添加 scenario(场景)描述:
  • 1. 前往 scenario(场景)的 Diagram(图表)标签页。 2. 点击 Options > Edit description。 3. 为 scenario(场景)添加描述。AI agent(智能体)使用 scenario(场景)名称和描述来决定是否应该运行该 scenario(场景)。填写:"Lists the shop inventory."。 4. 点击 Save

    您已创建了用于让 agent(智能体)列出商店库存的 scenario(场景)。我们将在以下部分中使该 scenario(场景)对您的 agent(智能体)可用。

    ](https://help.make.com/step-2-create-the-ai-agents-tools#tool-2-scenario-to-order-more-stock)Tool 2:订购更多库存的 scenario(场景)">[Tool 2:订购更多库存的 scenario(场景)

    我们将为 agent(智能体)提供另一个 tool(工具):一个用于为商店库存订购更多物品的 scenario(场景)。该 scenario(场景)将通过 scenario(场景)inputs(输入)接收来自 agent(智能体)的订单信息。

    出于测试目的,该 scenario(场景)只会将消息发送到选定的聊天频道。

    创建 scenario(场景)的步骤:

  • 点击组织仪表盘(organization dashboard)或 scenario(场景)列表中的 Create a new scenario 按钮。
  • Scenario inputs and outputsScenario inputs 标签页中,设置 scenario(场景)inputs(输入)结构和描述:
  • !Document image !Document image
  • 添加 Slack > Create a message module(模块)。
  • 设置 Create a message module(模块):
  • 1. 在 Connection 选择框中,选择您的 Connection(连接)。如果您没有 Connection(连接),点击 Add 按钮创建它。 2. 选择您希望接收由 agent(智能体)创建的新订单消息的 Channel(频道)。 3. 在 module(模块)设置中,在 Text 字段中使用 scenario(场景)input(输入)。例如: !Document image
  • 更新 scenario(场景)的名称。AI agent(智能体)使用 scenario(场景)名称来决定是否应该运行该 scenario(场景)。填写:"Create buy stock order."。
  • 设置 scenario(场景)调度:
  • 1. 将 scenario(场景)调度设置为 On demand。Agent(智能体)将在需要时为您运行 scenario(场景)。 2. 点击 Save 确认 scenario(场景)调度。 3. 激活 scenario(场景)。 4. 保存您的 scenario(场景)。
  • 为 agent(智能体)添加 scenario(场景)描述:
  • 1. 前往 scenario(场景)的 Diagram(图表)标签页。 2. 点击 Options > Edit description。 3. 为 scenario(场景)添加描述。AI agent(智能体)使用 scenario(场景)名称和描述来决定是否应该运行该 scenario(场景)。填写:"Creates orders to refill the shop inventory."。 4. 点击 Save

    您已创建了用于让 agent(智能体)创建订单以补充商店库存的 scenario(场景)。我们将在以下部分中使该 scenario(场景)对您的 agent(智能体)可用。

    学以致用,立即上手

    读完文档后,不如亲自动手 — 免费注册 Make.com 账户,跟着教程搭建你的第一个工作流

    ✓ 永久免费版 ✓ 无需信用卡 ✓ 60 秒注册
    🚀 免费注册 Make 账户