This tutorial is about setting up Google Assistant on your Windows. Yes, it’s now possible and we will tell you How to Setup Google Assistant on Windows. Google Assistant, as the name suggests, is your assistant which act on your Voice commands. All you have to do is to say “OK Google” and then tell Google assistant what you want it to do. Just a few days ago Google launched the Google Assistant SDK which allows Assistant to run on any platform like Windows, MAC or Linux machine using Python.
To setup Google Assistant on Windows you will need to have Python installed on your machine whether its Mac, Linux or Windows, it doesn’t matter. Therefore, install Python on your Windows PC using this Wiki. Once you are done with installation of Python on Windows open command prompt and then simply type python. If you see the terminal/command prompt return the current Python version on your computer, then you’re good to go. But before you start giving commands to your PC we need to enable access to the Google Assistant API. So, keep on reading if you want to know how to setup Google Assistant on Windows.
Let’s start setting up Google Assistant on your Windows.
How to Configure the Google Assistant API
- Go to the Google Cloud Platform Console.
- Click on the Create Project.
- Name the project “My Google Assistant”.
- Once your project is created, you will be automatically routed to your Project’s configuration page.
- Now go straight to the Google Assistant API page. Click Enable on the top of Google Assistant API page.
- Now Google will ask you to create credentials to use this API. To do so click on Create Credentials in the top right corner, this will take you to the wizard where you can create credentials.
- On credentials page under “where will you be calling the API from”, select “Other UI (e.g. Windows, CLI tool)“. For “what data will you be accessing” select the “User data” circle. Now click on “what credentials do I need?” button.
- Now Google will ask you to create an OAuth 2.0 client ID. Once done picking a name, click on “create client ID”.
- Under “product name shown to users” enter “My Google Assistant.” Click continue.
- Don’t click “Download” yet, here click on “Done”.
- Now under the list of OAuth 2.0 client IDs your client ID, which you created earlier, must be listed. Click on the farthest Download button on the right side to download the .json file. Save this file anywhere on your computer.
- Make sure that “Web & App Activity”, “Location History”, “Device Information”, and “Voice & Audio Activity” are enabled in Activity Controls Page of your Google account.
Install the Google Assistant Sample Python Project
- Open command prompt and enter the below command.
- py -m pip install google-assistant-sdk[samples]
- Now enter the following command. Please make sure to adjust the paths as you set them.
- py -m googlesamples.assistant.auth_helpers –client-secrets path\to\your\client_secret_XXX.apps.googleusercontent.com.json
- After entering the above command, you will see a response telling you to visit a URL in order to authorize the application. Copy and paste the URL in your browser and hit enter. Select the same Google account in which you created the API.
- On the next page you will be given a client’s access token. Copy that token and paste it in command prompt where it says “Enter the authorization code:”.
Test the Google Assistant on Windows PC
- To test the MIC type in the below command in command prompt and press enter.
- python -m googlesamples.assistant.audio_helpers
- Enter this command to begin talking to Google Assistant.
- python -m googlesamples.assistant
Now, wait for the command prompt to say “press Enter to send a new request”, then press enter to begin talking to your Google Assistant. If you see warning afterward, ignore it.
This is how to setup Google Assistant on Windows.