Kể từ ngày 13 tháng 6 năm 2023, Hành động trò chuyện không còn được dùng nữa. Để biết thêm thông tin, hãy xem phần Hành động trò chuyện ngừng hoạt động.
Trợ lý Google phải liên kết được một truy vấn với một lệnh để gửi đến thiết bị của bạn. Để làm được điều này, bạn cần khai báo những loại khả năng mà thiết bị của bạn hỗ trợ. Những khả năng này được gọi là đặc điểm. Bạn khai báo các trait này trong mẫu thiết bị của mình.
Google đã tạo ra nhiều đặc điểm phổ biến trên nhiều thiết bị. Các trait này không chỉ gắn liền với một loại thiết bị nào nên bạn có thể sử dụng tuỳ ý.
Thêm trait
Trước đây, bạn đã xác định một mô hình, giờ hãy cập nhật mô hình đó bằng cách thêm một trait. Trong trường hợp này, hãy thêm trait Bật/Tắt để điều khiển đèn LED gắn trên thiết bị.
[null,null,["Cập nhật lần gần đây nhất: 2023-12-02 UTC."],[[["The Google Assistant Library for Python is deprecated and developers should utilize the Google Assistant Service instead."],["Device capabilities, known as traits, are defined within the device model to enable the Google Assistant to link user queries with device commands."],["Google provides pre-built traits for common device functionalities that can be incorporated into your device model."],["Adding a trait to your device model involves using the Actions Console to select and save the desired trait, such as the OnOff trait for controlling an LED."]]],["Device traits define a device's abilities for the Google Assistant. To add a trait, access the Actions Console, select the \"Device registration\" tab, and edit the desired model. Within the model, add the desired trait by clicking the pencil icon in the \"Supported traits\" box and selecting it, like the \"OnOff\" trait for LED control, then save. The Google Assistant Library for Python is deprecated, use the Google Assistant Service instead.\n"]]