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.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Dự án Google Cloud Platform cấp cho dự án của bạn quyền truy cập vào API Trợ lý Google.
Dự án này theo dõi việc sử dụng hạn mức và cung cấp cho bạn các chỉ số có giá trị về
các yêu cầu được đưa ra từ phần cứng của bạn.
Để cho phép truy cập vào API Trợ lý Google, hãy làm như sau:
Trong Bảng điều khiển Cloud Platform, hãy chuyển đến trang Dự án. Chọn một chính sách hiện có
dự án hoặc tạo một dự án mới.
Bạn có thể cần đặt tên sản phẩm cho màn hình xin phép của sản phẩm. Bật
thẻ màn hình xin phép OAuth, đặt tên cho sản phẩm rồi nhấp vào
Lưu.
Nhấp vào Khác rồi đặt tên cho mã ứng dụng khách.
Nhấp vào Tạo. Một hộp thoại sẽ xuất hiện, hiển thị cho bạn mã ứng dụng khách và
bí mật. (Bạn không cần phải nhớ hoặc lưu thông tin này, chỉ cần đóng hộp thoại.)
Nhấp vào ⬇ (ở ngoài cùng bên phải màn hình) để tải mã ứng dụng khách xuống
tệp JSON bí mật ứng dụng khách (client_secret_<client-id>.json).
Tệp client_secret_<client-id>.json phải nằm trên thiết bị để
uỷ quyền mẫu SDK Trợ lý Google thực hiện truy vấn cho Trợ lý Google.
Đừng đổi tên tệp này.
Chỉ dành cho Raspberry Pi:
Đảm bảo tệp này nằm trong /home/pi. Nếu bạn muốn tải tệp lên
với thiết bị, hãy làm như sau:
Mở một cửa sổ dòng lệnh mới. Chạy lệnh sau trong cửa sổ dòng lệnh mới này:
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThe Google Assistant SDK is intended for non-commercial and experimental purposes only, prohibiting commercial device integration.\u003c/p\u003e\n"],["\u003cp\u003eA Google Cloud Platform project is necessary for accessing the Google Assistant API, enabling quota tracking and metric analysis.\u003c/p\u003e\n"],["\u003cp\u003eEnabling the Google Assistant API requires creating or selecting a project within the Google Cloud Platform Console and enabling the API for the project.\u003c/p\u003e\n"],["\u003cp\u003eAn OAuth Client ID is needed and can be generated by creating a client ID, potentially setting a product name, providing a client ID name, and downloading the client secret JSON file.\u003c/p\u003e\n"],["\u003cp\u003eThe client secret JSON file, essential for authorization, must be placed on the device, specifically in \u003ccode\u003e/home/pi\u003c/code\u003e for Raspberry Pi, potentially requiring secure copy transfer from a local machine.\u003c/p\u003e\n"]]],[],null,["# Configure a Google Cloud Platform project\n\n| **Warning:** You can't launch commercial devices that integrate with the Google Assistant SDK. It's available for experimental and non-commercial uses only.\n\n\u003cbr /\u003e\n\nA Google Cloud Platform project gives your project access to the Google Assistant API.\nThe project tracks quota usage and gives you valuable metrics for the\nrequests made from your hardware.\n\nTo enable access to the Google Assistant API, do the following:\n\n1. In the Cloud Platform Console, go to the Projects page. Select an existing\n project or create a new project.\n\n [Go\n to the Projects Page](https://console.cloud.google.com/project)\n2. Enable the Google Assistant API on the project you selected (see the [Terms\n of Service](/assistant/sdk/terms-of-service)).\n\n [Enable\n the API](https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview)\n\n Click **Enable**.\n3. Create an OAuth Client ID with the following steps:\n\n 1. Create the client ID. \n\n [Create\n an OAuth Client ID](https://console.developers.google.com/apis/credentials/oauthclient)\n\n 2. You may need to set a product name for the product consent screen. On\n the **OAuth consent screen** tab, give the product a name and click\n **Save**.\n\n 3. Click **Other** and give the client ID a name.\n\n 4. Click **Create**. A dialog box appears that shows you a client ID and\n secret. (No need to remember or save this, just close the dialog.)\n\n 5. Click **⬇** (at the far right of screen) for the client ID to download\n the client secret JSON file (`client_secret_\u003cclient-id\u003e.json`).\n\n4. The `client_secret_\u003cclient-id\u003e.json` file must be located on the device to\n authorize the Google Assistant SDK sample to make Google Assistant queries.\n Do not rename this file.\n\n *For the Raspberry Pi only:*\n\n Make sure this file is located in `/home/pi`. If you want to upload the file\n to the device, do the following:\n 1. Open a new terminal window. Run the following command in this new terminal:\n\n **Note:** Do **not** run the following command in an SSH session connected to the device. This command transfers the JSON file from a directory on your development machine to the device. An SSH session cannot access your local directories. \n\n ```\n scp ~/Downloads/client_secret_client-id.json pi@raspberry-pi-ip-address:/home/pi/\n ``` \n\n ```\n password: password-for-device\n ```\n 2. Close this terminal window."]]