Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
<ph type="x-smartling-placeholder">
Un projet Google Cloud Platform permet à votre projet d'accéder à l'API Google Assistant.
Le projet suit l'utilisation des quotas et fournit des métriques utiles pour
des requêtes effectuées à partir de votre matériel.
Pour activer l'accès à l'API de l'Assistant Google, procédez comme suit:
Dans la console Cloud Platform, accédez à la page "Projets". Sélectionner un élément existant
ou créer un projet.
Vous devrez peut-être définir un nom de produit pour l'écran de consentement du produit. Activé
Dans l'onglet Écran d'autorisation OAuth, attribuez un nom au produit, puis cliquez sur
Enregistrer.
Cliquez sur Autre et donnez un nom à l'ID client.
Cliquez sur Créer. Une boîte de dialogue s'affiche
avec un ID client et
secret. Vous n'avez pas besoin de mémoriser ni d'enregistrer cet élément. Il vous suffit de fermer la boîte de dialogue.
Cliquez sur ⬇ (à l'extrémité droite de l'écran) pour télécharger l'ID client.
le fichier JSON du code secret du client (client_secret_<client-id>.json).
Le fichier client_secret_<client-id>.json doit se trouver sur l'appareil pour
autoriser l'exemple du SDK de l'Assistant Google à envoyer des requêtes à l'Assistant Google.
Ne renommez pas ce fichier.
Pour le Raspberry Pi uniquement:
Assurez-vous que ce fichier se trouve dans /home/pi. Si vous voulez importer le fichier
à l'appareil, procédez comme suit:
Ouvrez une nouvelle fenêtre de terminal. Exécutez la commande suivante dans ce nouveau terminal:
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 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."]]