Google Assistant was released by Google in 2016 and ever since it has been the most loved AI by people. It is available on android phones, for your homes, for your cars, and even on your television sets and wearables, but sadly, not on your laptops or PC. Google has not yet released a web or windows/mac/Linux version of this powerful AI and so if you are a PC or laptop user you will need a work around this limitation to be able to use Google Assistant on your device. Let’s take a look at one such clever hack that uses a combination of Python, Google Cloud, and Google Assistant API to download Google Assistant for laptop.
You can get Google Assistant on your Windows/Mac using this workaround that uses Python, Google Cloud, and Google Assistant API.
- Go to python’s official website and navigate to Downloads. Download Python for Windows 3.7. make sure to check the box that is next to add Python 3.7 to PATH.
- Open Windows file explorer, go to your C: Drive and create a new folder there named Google Assistant (no space).
- Go to your browser and search for Google Cloud Platform.
- Select Create Project and log in with your Google account if prompted.
- Enter WinGoogleAssistant as the name of your project. You will be given a project ID. Write it down carefully and keep it with you.
- Open a new tab in your browser and open Google Assistant APIs.
- You will be shown an enable button, click on it to enable the API for your project.
- You will be shown a create credentials window. Click on Create Credentials.
- Choose Google Assistant API as your response to the first question which asks you to choose an API.
- Select Windows as the option for where to call the API from.
- Choose User data for the data to be accessed.
- Click on the ‘What Credentials do I Need’ button.
- You will be shown a dialog box. Click on Set up Consent Screen.
- Change Application type to internal, enter WinGoogleAssistant as the application name.
- Save and select Create Credentials and then Help me Choose
- You will be shown a form, enter WGAcredentials in the name text box. Click on create OAuth Client Id. You will be able to download your credentials. Click on Save.
- Select the download arrow beside your credentials and download and save your JSON format credentials in the new folder you had created in your C: drive.
- Launch windows command prompt and type in:
py -m pip install google-assistant-sdk[samples]
- Let the installation complete, then in the same command prompt, enter
py -m pip install –upgrade google-auth-oauthlib[tool]
- Open the JSON file that you have saved in your C: Drive GoogleAssistant folder, open properties and copy the file name from there
- Come back to the command prompt and type: google-oauthlib-tool –client-secrets C:\GoogleAssistant\[YOUR-FILENAME-HERE]—scope https://www.googleapis.com/auth/assistant-sdk-prototype –save –headless
- Press Enter
- You will be shown a URL, copy it
- Paste the URL in your browser search bar, log in with the same Google account
- Click on allow when prompted for permissions
- You will be shown an alphanumeric string, copy it
- Paste this text in your windows terminal and press enter
- Type on terminal: py -m googlesamples.assistant.grpc.audio_helpers
- Now, take the projectID that you had written down, navigate to the location of GoogleAssistant folder in your terminal,
- Type: googlesamples-assistant-devicetool –project-id
- Press space, type in your project ID, give space again and type: register-model –manufacturer “Assistant SDK developer” –product-name “Assistant SDK light” –type LIGHT –model “GA4W”
- Press Enter to complete your setup and say ‘OK Google’
You Google Assistant for laptop is now ready to use. Google assistant Chromebook can be easily enabled in the settings for Chromebook users.