對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
裝置型號和執行個體結構定義
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
裝置型號
裝置型號是由本節的欄位定義。
裝置型號欄位只能包含字母、數字和下列資訊
符號:句號 (.)、連字號 (-)、底線 (_)、空格 ( ) 和加號
(+)。欄位的第一個字元必須是英文字母或數字。
{
"project_id": "my-devices-project",
"device_model_id": "my-devices-project-prototype-light-v1",
"manifest": {
"manufacturer": "Assistant SDK developer",
"product_name": "Assistant SDK light",
"device_description": "Assistant SDK light device"
},
"device_type": "action.devices.types.LIGHT",
"traits": ["action.devices.traits.OnOff"]
}
敬上
{
"project_id": string,
"device_model_id": string,
"manifest": {
"manufacturer": string,
"product_name": string,
"device_description": string
},
"device_type": string,
"traits": [ string ]
}
project_id
: (字串) 必填。Google Cloud Platform 專案 ID
以便與這個裝置型號建立關聯。
一項專案可以包含多個裝置型號。
device_model_id
: (字串) 必填。全域不重複 ID
製作這個模型使用 project_id
做為
前置字串,可避免所有專案範圍中發生衝突。二手車
指標和註冊期間。
manifest
: (object(Manifest)) 必要項目。描述
以及裝置型號和製造商這項資訊可能會顯示在即將推出的 SDK 中
控制台、指標資訊主頁和其他相關的視覺介面
manifest.manufacturer
: (字串) 必填。裝置名稱
製造商
manifest.product_name
: (字串) 必填。面向消費者
這個裝置型號的產品名稱。
manifest.device_description
: (字串) 選填。說明
。
device_type
: (字串) 必填。裝置硬體類型。選取
從下列項目開始:
action.devices.types.CAMERA
action.devices.types.DISHWASHER
action.devices.types.DRYER
action.devices.types.LIGHT
action.devices.types.OUTLET
action.devices.types.PHONE
action.devices.types.REFRIGERATOR
action.devices.types.SCENE
action.devices.types.SOUNDBAR
action.devices.types.SPEAKER
action.devices.types.SWITCH
action.devices.types.THERMOSTAT
action.devices.types.TV
action.devices.types.VACUUM
action.devices.types.WASHER
traits
: (Array<String>) 選用。裝置的特徵清單
支援。特徵包括指令、屬性和狀態
裝置。您不需要定義動作套件
使用
內建特徵
裝置執行個體
這裡的欄位定義了裝置執行個體。
裝置執行個體欄位開頭必須是英文字母或數字。裝置 ID
只能使用英文字母、數字和下列符號:句號 (.)、
連字號 (-)、底線 (_) 和加號 (+)。裝置暱稱只能
包含數字、英文字母和空格 ( ) 符號,
{
"id": "my_led_1",
"model_id": "my-devices-project-prototype-light-v1",
"nickname": "My Assistant Light",
"client_type": "SDK_LIBRARY"
}
敬上
{
"id": string,
"model_id": string,
"nickname": string,
"client_type": string
}
id
: (字串) 必填。測試裝置的 ID。必須為
透過相同 Google 註冊的所有裝置
開發人員專案。
model_id
: (字串) 必填。裝置型號的 ID;必須
與 device_model_id
相同
相關聯的應用程式。必須已註冊這個裝置型號
像是剛才說過,即便 VM 正在運作
您還是能變更 VM 可用性政策
nickname
: (字串) 選填。裝置的暱稱。這個名稱
會在視覺介面中用來指稱裝置
Google 助理設定。
client_type
: (字串) 必填。用戶端裝置類型。必須為
下列任一項:SDK_SERVICE
或 SDK_LIBRARY
。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eDevice models are defined with a unique ID, manufacturer details, device type, and supported traits, enabling the Google Assistant to understand and interact with the device.\u003c/p\u003e\n"],["\u003cp\u003eDevice instances represent individual devices, linking to a specific model with a unique ID, an optional nickname, and client type (SDK service or library).\u003c/p\u003e\n"],["\u003cp\u003eDevice model and instance IDs can contain letters, numbers, and specific symbols, ensuring proper formatting for identification within the Google ecosystem.\u003c/p\u003e\n"],["\u003cp\u003eA device model's \u003ccode\u003etraits\u003c/code\u003e field determines its functionalities and capabilities, allowing developers to define its behavior and interaction with the Google Assistant.\u003c/p\u003e\n"],["\u003cp\u003eDevice instances are registered using their unique ID and associated with a pre-registered device model, enabling them to be recognized and controlled by the Google Assistant.\u003c/p\u003e\n"]]],["Device models are defined by fields such as `project_id`, `device_model_id`, `manifest`, `device_type`, and `traits`. Fields can contain letters, numbers, and specific symbols. `Manifest` describes the device's manufacturer, product name, and description. Device instances have fields like `id`, `model_id`, `nickname`, and `client_type`, which specify unique identifiers, associated device models, nicknames, and client types. The device `id` and `model_id` are required.\n"],null,["# Device Model and Instance Schemas\n\nDevice model\n------------\n\nThe device model is defined by the fields in this section.\n\n\nDevice model fields can only contain letters, numbers, and the following\nsymbols: period (.), hyphen (-), underscore (_), space ( ) and plus\n(+). The first character of a field must be a letter or number.\nExample \n\n```carbon\n{\n \"project_id\": \"my-devices-project\",\n \"device_model_id\": \"my-devices-project-prototype-light-v1\",\n \"manifest\": {\n \"manufacturer\": \"Assistant SDK developer\",\n \"product_name\": \"Assistant SDK light\",\n \"device_description\": \"Assistant SDK light device\"\n },\n \"device_type\": \"action.devices.types.LIGHT\",\n \"traits\": [\"action.devices.traits.OnOff\"]\n}\n```\nSchema \n\n```carbon\n{\n \"project_id\": string,\n \"device_model_id\": string,\n \"manifest\": {\n \"manufacturer\": string,\n \"product_name\": string,\n \"device_description\": string\n },\n \"device_type\": string,\n \"traits\": [ string ]\n}\n```\n\n- **`project_id`:** (String) Required. Google Cloud Platform project [ID](https://support.google.com/cloud/answer/6158840) of the Actions Console project to associate with this device model. A project can contain multiple device models.\n- **`device_model_id`:** (String) Required. Globally-unique identifier for this device model; use the `project_id` as a prefix to help avoid collisions over the range of all projects. Used in metrics and during device registration.\n- **`manifest`:** (object(Manifest)) Required. Metadata that describes the device model and manufacturer. This may be shown in the (upcoming) SDK console, metrics dashboards, and other related visual interfaces.\n - **`manifest.manufacturer`:** (String) Required. Name of the device manufacturer.\n - **`manifest.product_name`:** (String) Required. Consumer-facing product name for this device model.\n - **`manifest.device_description`:** (String) Optional. Description of this device model.\n- **`device_type`:** (String) Required. The type of device hardware. Select from the following:\n - `action.devices.types.CAMERA`\n - `action.devices.types.DISHWASHER`\n - `action.devices.types.DRYER`\n - `action.devices.types.LIGHT`\n - `action.devices.types.OUTLET`\n - `action.devices.types.PHONE`\n - `action.devices.types.REFRIGERATOR`\n - `action.devices.types.SCENE`\n - `action.devices.types.SOUNDBAR`\n - `action.devices.types.SPEAKER`\n - `action.devices.types.SWITCH`\n - `action.devices.types.THERMOSTAT`\n - `action.devices.types.TV`\n - `action.devices.types.VACUUM`\n - `action.devices.types.WASHER`\n- **`traits`:** (Array\\\u003cString\\\u003e) Optional. List of traits the device supports. Traits include the commands, attributes, and states for the device. You do not need to define an [Action package](/assistant/conversational/action-package/reference/rest/Shared.Types/ActionPackage) to use [built-in traits](/assistant/sdk/reference/traits).\n\nDevice instance\n---------------\n\nThe device instance is defined by the fields in this section.\n\n\nDevice instance fields must start with a letter or number. The device ID\ncan only contain letters, numbers, and the following symbols: period (.),\nhyphen (-), underscore (_), and plus (+). The device nickname can only\ncontain numbers, letters, and the space ( ) symbol.\nExample \n\n```carbon\n {\n \"id\": \"my_led_1\",\n \"model_id\": \"my-devices-project-prototype-light-v1\",\n \"nickname\": \"My Assistant Light\",\n \"client_type\": \"SDK_LIBRARY\"\n }\n```\nSchema \n\n```carbon\n {\n \"id\": string,\n \"model_id\": string,\n \"nickname\": string,\n \"client_type\": string\n }\n```\n\n- **`id`:** (String) Required. Identifier for the test device. Must be unique within all of the devices registered under the same Google Developer project.\n- **`model_id`:** (String) Required. Identifier of the device model; must be the same as the [`device_model_id`](#device_model_json) associated with this test device. The device model must have been registered previously.\n- **`nickname`:** (String) Optional. Nickname for the device. This name will be used to refer to the device in visual interfaces like the Assistant settings.\n- **`client_type`:** (String) Required. The type of client device. Must be either of the following: `SDK_SERVICE` or `SDK_LIBRARY`."]]