Google Assistant– the most accurate AI in the smartphone industry till now. It doesn’t bring 100% accuracy but it can easily beat other AIs like Alexa, Siri, Cortana etc. However upcoming Samsung’s personal Artificial Intelligence, Bixby, which Samsung claims that it can beat all other AIs in the market. Although time will say. Anyway, let’s get into the topic.
Since the Google Assistant came, we are getting used to it. Recently, Google released the Google Assistant API, which allows Assistant to be set up and run on basically any platform.
So today we will show you how to get Google Assistant on Windows, Linux as well as Mac.
- Python 3– You will need to have Python 3 in your system. It doesn’t matter which OS you come up with, its (installing procedure) already well documented by the Python Wiki. You can also get it by Googling it. There are tons of tutorial for you. However, most Linux distro and Mac come with Python preinstalled but check the Python version details (you can confirm it using command python )
Configure the Google Assistant API:
Before we install the necessary file for the Google Assistant, we need to enable access the Google Assistant API in the Google Cloud Platform console.
All the steps will be the same for Windows, Linux as well as Mac. Some Command would be different which I will mention below.
- Go to “Projects” on the Google Cloud Platform Console website, and click on “Create Project”.
- Give your project a name of your choice, obviously. Any name will do. I named it just “Google Assistant”.
- The cloud Platform will build your project in a few moments. You will be able to check the progress in top-right “bell icon”. When you get to see your project is ready, click on that.
- In the new page appeared, click on “API Manager” and go to “Library”.
- Search for “Google assistant API” in the text field. Click on the result.
- In the next page, click “ENABLE”.
- Google prompts you to “Create credentials” in order to use the API. Click on that.
- In the form that opens up, choose “Other UI (e.g. Windows, CLI tool)” under “Where will you be calling the API from”.
Select “User data” under “What data will you be accessing?”. Finally, click on “What credentials do I need?”
- Create a client ID. Give it any name, I have given in my name here. Then create “Create client ID”.
- In the next step, use the name of your project in the “Product name as shown to users”, and then click “Continue”.
- You will get an option to download the credentials. Click on “Done”. We’ll do the download later.
- Now go to Activity Controls page, and make sure that all the toggles are turned on. This is required fo Google Assistant to provide personalized responses.
- In the next screen, you’ll be able to see the client ID you created. Click on the download icon at the very right of the screen. This will download a JSON file to your computer. Save it somewhere you can easily get to. I saved it at “/droidsay/project/assistant”.
Install Google Assistant Sample Project
- Launch the Command Prompt (Windows) or Terminal (Linux/Mac) and type the following command and enter:
python -m pip install google-assistant-sdk[samples]
- Once the command completes, type the next command and hit enter:
python -m googlesamples.assistant.auth_helpers --client-secrets "droidsay/project/assistant/client_secret_17151337amigo.apps.googleusercontent.com.json"
**NOTE: You have to enter YOUR file path where you downloaded the json file.**
- You will get a URL as the output in the Terminal. Navigate to this URL in your browser, copy and paste the confirmation code from the webpage into the Terminal, and press Enter.
Use Google Assistant on Windows, Linux and Mac
Now that you have set up everything required, it’s time to test and begin using the google Assistant.
- Launch the Terminal and execute the following command:
python -m googlesamples.assistant.audio_helpers
This will start a 5-second audio recording which will be then played back. If you can here it then you can use it.
- To use Google Assistant on Windows, Linux and Mac, just run the following command:
python -m googlesamples.assistant
thus you can start using Google Assistant in Windows, Linux and Mac. This setup supports each and every command of the Android counterpart.
Remember, this setup doesn’t have a GUI so you have to be familiar with the command line interface. Go give it a try and show off like a geek to your friends!