Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un progetto Google Cloud Platform concede al progetto l'accesso all'API Google Assistant.
Il progetto monitora l'utilizzo delle quote e offre metriche utili per il
richieste effettuate dal tuo hardware.
Per attivare l'accesso all'API dell'Assistente Google, procedi nel seguente modo:
Nella console di Cloud Platform, vai alla pagina Progetti. Seleziona un elemento esistente
o creare un nuovo progetto.
Potresti dover impostare un nome di prodotto per la schermata di consenso del prodotto. Attivato
Nella scheda Schermata consenso OAuth, assegna un nome al prodotto e fai clic
Salva.
Fai clic su Altro e assegna un nome all'ID cliente.
Fai clic su Crea. Viene visualizzata una finestra di dialogo che mostra un ID client e
il secret. Non è necessario ricordarlo o salvarlo, è sufficiente chiudere la finestra di dialogo.
Fai clic su ⬇ (all'estrema destra dello schermo) per scaricare l'ID client
il file JSON del client secret (client_secret_<client-id>.json).
Il file client_secret_<client-id>.json deve trovarsi sul dispositivo per
autorizza l'esempio dell'SDK dell'Assistente Google a eseguire query sull'Assistente Google.
Non rinominare questo file.
Solo per Raspberry Pi:
Assicurati che questo file si trovi nel percorso /home/pi. Se vuoi caricare il file
al dispositivo:
Apri una nuova finestra del terminale. Esegui questo comando nel nuovo terminale:
[null,null,["Ultimo aggiornamento 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."]]