With three sensitive microphones, it is possible to recognize speech from a distance of up to 5 meters, which makes it easy to integrate the device with Amazon Alexa, ChatGPT, Google Home, and other voice control systems.

 
In the version with the pan-tilt camera, facial detection and tracking allow for activation with just a glance (without the need to speak wake words like "Alexa" or "OK Google"). An example of this can be seen in the demonstration video (see Camera Pan/Tilt).
 

Setup Google Developer Project

For Developer Project configuration account settings follow steps described in Google guide Configure a Developer Project and Account Settings.

Next step is device registration. Also follow  steps described in Google guide Register the Device Model.

Audio configuration

Google samples will attach audio to default devices. You need to configure audio as described in Getting Started->Software

Install and Run Python Google Assistant 

If you are not using our OS image you need to install SDK

Install dependencies

sudo apt-get update
sudo apt-get install python3-dev python3-pip
sudo apt-get install portaudio19-dev libffi-dev libssl-dev

Install SDK and authorization tool

python3 -m pip install --upgrade google-assistant-sdk[samples]
python3 -m pip install --upgrade google-auth-oauthlib[tool]

Generate credentials to be able to run the sample code and tools. Reference the JSON file you downloaded in a previous step; you may need to copy it the device. Do not rename this file.

google-oauthlib-tool --scope https://www.googleapis.com/auth/assistant-sdk-prototype \
      --save --headless --client-secrets /path/to/client_secret_client-id.json

You should see a URL displayed in the terminal

Please visit this URL to authorize this application: https://...

After you approve the permission request from the API, a code will appear in your browser, such as "4/XXXX". Copy and paste this code into the terminal. If authorization was successful, you will see a response similar to the following

credentials saved: /path/to/.config/google-oauthlib-tool/credentials.json
Run sample by replacing in following command my-dev-project with the Google Cloud Platform project ID and my-model with the name of the model you created.
 
googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model
 

Install and Run C++ Google Assistant 

U can use our prebuilt libraries stored in our repository saraKIT

Add pkg_config path:

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:~/<path to saraKIT>/GoogleAssistant/libs/lib/pkgconfig/

Get credentials file. It must be an end-user's credentials. Go to the Actions Console and register your device model, following these instructions. Go to SaraKIT/tree/main/GoogleAsistant/src and move it in this folder and rename it to client_secret.json run get_credentials.sh. It will create the file credentials.json.

./get_credentials.sh

Execute make

make -j4

now you can simply run sampleAssistant

./sampleAssistant

 

You can find C++ and Python code for Raspberry Pi4 in the
SaraKIT Github repository:
https://github.com/SaraEye