构建概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如需构建对话操作,您需要创建并部署以下组件:
- Actions 项目 - 所有对话型 Action、Web 服务和 Web 应用的逻辑容器。它还定义了项目设置和资源,用于说明如何将项目部署到 Actions on Google。
- 调用模型 - 定义用户如何发现和启动项目中的操作。您可以使用意图和类型来构建调用模型。
- 对话模型 - 定义用户可以对您的 Action 说什么,以及您的 Action 如何响应用户。您可以使用 intent、类型、场景和提示来构建对话模型。
- 网络钩子 - 操作可以触发网络钩子,以将其他逻辑委托给您的履单服务,例如生成提示、验证数据等。
- Interactive Canvas - 您可以提供由 HTML、CSS 和 JavaScript 提供支持的全屏互动式 Web 应用,而不是发送简单的文字回复或富卡片和图片。
以下各部分介绍了您将用于构建操作的工具。
操作
Actions API 是一组用于为 Google 助理构建 Action 的开发者工具。它包含以下功能:
Actions 项目的开放式基于文件的表示形式 - 使用意图、类型、场景和提示构建调用和对话模型。您可以使用自己喜欢的文本编辑器修改 Actions 项目,将其签入源代码控制系统,构建自动化流程,等等。
命令行界面 (CLI) - gactions
工具提供了一个 CLI,用于引导和自动化操作开发。借助该工具,您可以初始化标准 Action 项目文件、将更新推送到 Actions 控制台、部署 Action 项目等。借助此工具,您可以执行许多常见的工作流程,例如导入现有项目或使用您喜爱的源代码控制系统开始处理功能分支。
Actions API - Actions API 与 gactions
工具使用的 API 相同。Actions API 提供了一系列 REST 端点来管理您的操作,包括用于测试和构建操作的端点。借助该 API,您可以使用 JSON 请求执行许多常见的工作流程。使用 Actions API 时,您应考虑某些限制和最佳实践。
Webhook 和 Node.js 执行库 - 您的 Action 可以通过 webhook 和基于 JSON 的消息传递格式将业务逻辑委托给 Web 服务。我们提供了一个 Node.js fulfillment 库,该库为对话网络钩子提供了惯用接口。借助此库,您可以轻松实现许多常见用户流程。例如,某些功能包括从用户查询中提取参数,以及为 Google 助理生成多模态体验(仅语音和语音与视觉效果)。
Actions Builder
Actions Builder 是一款功能强大且易于使用的基于网络的 IDE,已集成到 Actions 控制台中。由于 Actions Builder 与 Actions API 采用相同的技术构建而成,因此您可以根据需要单独使用或与 Actions API 搭配使用。
Actions Builder 界面分为以下区域:
- 通过顶部菜单,您可以访问 Actions 控制台的不同区域,还可以在 Develop(开发)标签页中访问 Actions Builder。
- 通过左侧菜单,您可以访问用于构建操作的所有组件,例如 intent 和场景。
- 借助构建区域,您可以构建正在处理的组件。
- 您可以在“详细信息”区域中配置有关您正在处理的组件的更多详细信息。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-24。
[null,null,["最后更新时间 (UTC):2025-07-24。"],[[["\u003cp\u003eConversational Actions are built using an Actions project, an invocation model, a conversation model, webhooks, and optionally Interactive Canvas.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the Actions API, which includes an open file-based project representation, a command-line interface, a REST API, and webhook support with a Node.js library.\u003c/p\u003e\n"],["\u003cp\u003eActions Builder provides a web-based IDE within the Actions console, offering a user-friendly interface for building and managing conversational actions, integrated with the Actions API.\u003c/p\u003e\n"]]],[],null,["# Build overview\n\nTo build Conversational Actions, you create and deploy the following components:\n\n- **[Actions project](/assistant/conversational/build/projects)** - The logical container for all of your Conversational Actions, web services, and web apps. It also defines project settings and resources that describe how to deploy your project to Actions on Google.\n- **[Invocation model](/assistant/conversational/build/invocation)** - Defines how users discover and start the Actions inside your project. You build your invocation model with [intents](../intents) and [types](../types).\n- **[Conversation model](/assistant/conversational/build/conversation)** - Defines what users can say to your Actions and how your Actions respond to users. You build your conversational model with [intents](../intents), [types](../types), [scenes](../scenes), and [prompts](../prompts).\n- **[Webhooks](../webhooks)** - Actions can trigger webhooks to delegate additional logic to your fulfillment services, like generating prompts, validating data, and more.\n- **[Interactive Canvas](/assistant/interactivecanvas)** - Instead of sending simple text responses or rich cards and images, you can deliver a full-screen, interactive web app powered by HTML, CSS, and JavaScript.\n\nThe following sections describe the tools that you'll use to build Actions.\n\n### Actions\n\nThe Actions API is a set of developer tools for building Actions for the\nGoogle Assistant. It consists of the following features:\n\n- **An open, file-based representation of an Actions project** - Build your\n invocation and conversation models with\n [intents](/assistant/conversational/intents),\n [types](/assistant/conversational/types),\n [scenes](/assistant/conversational/scenes), and\n [prompts](/assistant/conversational/prompts). You can edit your Actions\n projects with your favorite text editor, check them into source control, build\n automated processes, and more.\n\n- **A command-line interface (CLI)** - The\n [`gactions` tool](/assistant/actionssdk/gactions) provides a CLI to bootstrap and\n automate development of your Actions. It lets you initialize standard Action\n project files, push updates to the Actions console, deploy Action projects,\n and more. The tool lets you perform many common workflows, such as importing\n existing projects or starting work on a feature branch using your favorite\n source control system.\n\n- **The Actions API** - The Actions API is the same API used by\n the `gactions` tool. The Actions API provides a list of REST endpoints to\n manage your Actions, including for testing and building. The API lets you use\n JSON requests to perform many common workflows. When\n [using the Actions API](/assistant/actions/api) there are\n certain limits and best practices that you should consider.\n\n- **Webhooks and a Node.js fulfillment library** - Your Actions can delegate\n business logic to your web services with webhooks and a JSON based messaging\n format. We provide a Node.js fulfillment library that provides idiomatic interfaces for the\n [Conversation Webhook](/assistant/conversational/webhooks). This library makes it\n easy to implement many common user flows. For example, some features include\n extracting parameters from a user query and generating a multimodal experience\n (voice only and voice and visuals) for Google Assistant.\n\n### Actions Builder\n\nActions Builder gives you a powerful and easy-to-use, web-based IDE that's\nintegrated into the Actions console. Since Actions Builder is built on the\nsame technologies as the Actions API, you can use it on its own or together with\nthe Actions API depending on your needs. \n\nThe Actions Builder UI is split into the following areas:\n\n1. The top menu provides access to the different areas of the Actions console, and you can access Actions Builder on the **Develop** tab.\n2. The left menu lets you access all the components to build Actions, like intents and scenes.\n3. The build area lets you build the component you're working on.\n4. The details area lets you configure more details about the component you're working on."]]