對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
建構總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如要建構對話動作,請建立及部署下列元件:
- 動作專案 - 所有對話動作、網路服務和網路應用程式的邏輯容器。此外,也會定義專案設定和資源,說明如何將專案部署至 Google 助理。
- 叫用模式 - 定義使用者如何探索及啟動專案中的動作。您可以使用意圖和型別建構叫用模型。
- 對話模型 - 定義使用者可對動作說出的內容,以及動作如何回應使用者。您可以使用意圖、類型、場景和提示,建構對話模型。
- Webhook - 動作可以觸發 webhook,將額外的邏輯委派給你的履行服務,例如產生提示、驗證資料等。
- 互動式畫布 - 你可以提供全螢幕的互動式網頁應用程式,而非傳送簡單的文字回覆或互動式資訊卡和圖片,這類應用程式採用 HTML、CSS 和 JavaScript 技術。
以下各節說明您將用來建構動作的工具。
動作
Actions API 是一組開發人員工具,可讓您為 Google 助理建構動作。包含的功能如下:
以檔案為基礎的開放式 Actions 專案表示法 - 使用意圖、型別、場景和提示,建構叫用和對話模型。你可以使用喜愛的文字編輯器編輯 Actions 專案、將專案簽入原始碼控制項、建構自動化程序等。
指令列介面 (CLI) - gactions
工具提供 CLI,可啟動及自動化開發動作。您可以使用這個工具初始化標準動作專案檔案、將更新推送至 Actions 控制台、部署動作專案等。這項工具可讓您執行許多常見的工作流程,例如匯入現有專案,或使用您偏好的來源控管系統,開始處理功能分支。
Actions API - Actions API 與 gactions
工具使用的 API 相同。Actions API 提供 REST 端點清單,可管理動作,包括測試和建構。您可以使用 JSON 要求,透過 API 執行多種常見工作流程。使用 Actions API 時,請留意某些限制和最佳做法。
Webhook 和 Node.js 執行要求程式庫 - 您的動作可透過 Webhook 和以 JSON 為基礎的訊息格式,將業務邏輯委派給 Web 服務。我們提供 Node.js 執行要求程式庫,為對話 Webhook 提供慣用介面。這個程式庫可讓您輕鬆實作許多常見的使用者流程。舉例來說,部分功能包括從使用者查詢中擷取參數,以及為 Google 助理產生多模態體驗 (僅限語音和語音與視覺)。
動作建構工具
Actions Builder 整合至 Actions 控制台,提供強大易用的網頁式 IDE。Actions Builder 與 Actions API 採用相同的技術,因此您可以視需求單獨使用,或與 Actions API 搭配使用。
Actions Builder 使用者介面可分為下列區域:
- 頂端選單可存取 Actions 控制台的不同區域,您可以在「開發」分頁中存取 Actions Builder。
- 左側選單可讓您存取所有用來建構動作的元件,例如意圖和場景。
- 您可以在建構區域中建構正在處理的元件。
- 您可以在詳細資料區域中,設定正在處理的元件詳細資料。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-24 (世界標準時間)。
[null,null,["上次更新時間: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."]]