對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
裝置動作總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
透過 Google 助理 SDK,您可以將 Google 助理嵌入自己的專案,讓專案的功能與 Google Home 類似。不過,您的專案可能具備 Google Home 沒有的獨特硬體功能,例如可自訂亮度與色彩設定的獨特 LED 螢幕。
裝置動作是一組工具和 API,可讓您在開發的專案中擴充 Google 助理的功能,充分發揮硬體效能。
內建裝置動作
Google 為日常用品 (包括燈具、家電和攝影機) 建立各種常見的內建裝置動作。透過這些動作,您可以運用 Google 助理的自然語言處理功能來控制專案。舉例來說,開啟燈具專案的方式如下:
- Ok Google,幫我開燈。
- 「Ok Google,幫我開燈。」
- Ok Google,打開客廳的燈。
您可以建立自己的專案,回應許多智慧住宅特徵
的指令,例如:
- Ok Google,將亮度設為 50%。
- Ok Google,將溫度設為 37 度。
自訂裝置動作
您也可以為自己的專屬硬體建立自訂裝置動作。針對這些動作,您需要定義文法和指令:
- Ok Google,讓燈閃爍 5 次。
- Ok Google,向左移動。
進一步瞭解如何使用 Google 助理服務整合這些動作。
運作方式
裝置已安裝 Google 助理 SDK,以及存取 Google 助理服務的憑證。裝置會傳送語音要求 (「開啟」),並要求服務開啟裝置內建的 LED。裝置也會傳送模型和裝置例項 ID,讓服務判斷如何根據要求內容提供最佳回應。
這項服務會使用自動語音辨識 (ASR) 技術判斷使用者說了哪些字詞,並運用自然語言處理 (NLP) 技術分析及瞭解這些字詞的意義,然後透過裝置比對功能提供要求背景資訊。這個內容非常重要,因為它會定義裝置支援的動作,以及這些動作的完成方式。
接著,服務會傳回文字,並以語音回覆使用者 (「好的」),
同時傳回裝置專屬指令。裝置知道如何處理這項指令:開啟 LED!

開始使用
將 Google 助理嵌入專案,然後使用裝置動作新增獨特功能,讓想法得以具體呈現。您可以使用 Google 助理服務開發專案。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[[["The Google Assistant SDK enables you to integrate the Google Assistant into your projects, similar to a Google Home, and leverage Device Actions to utilize unique hardware features."],["Device Actions provide tools and APIs to extend the Assistant's capabilities, allowing your project to respond to voice commands for functionalities like lights, appliances, and cameras using built-in or custom actions."],["Built-in Device Actions cover common smart home features, while Custom Device Actions let you define unique voice commands and functionalities tailored to your specific hardware."],["The Google Assistant service utilizes Automatic Speech Recognition, Natural Language Processing, and device context to understand user requests and trigger corresponding actions on your device."],["You can get started by embedding the Google Assistant into your project and adding custom functionalities with Device Actions using the provided resources and guides."]]],[]]