In this article, we are going to create a Google Action. If you are familiar with Amazon Echo, Alexa, or you’ve heard about Amazon Skills, this is kind of similar to the technology developed by Google. The virtual assistants are powered by Google Home or Google Mini, as well as, the Google Assistant App.
As a third party developer, we can add the functionality to these devices by creating a Google Action which is similar to Alexa Skills or apps on the App Store.
How Google Action Works
Google Action is a platform using which developers can create apps or software to broaden the functionality of the Google Assistant, that works with your phones, TVs, smart speakers, and cars etc.
As explained in the above figure, when a user requests something to Google Home, it takes that dialog as a command and invokes the best app from Google Action and responds back to the Google Home or Google Assistant.
Let's create a Flash Card action using templates to build a Scrum Quiz game and test it using Google Assistant and Google Home.
Prerequisites
- A Google account or developer account.
- Google Assistant App
- Google Home Device (Optional for testing)
Step 1
Go to Google and search for Action on Google.
Once you find the developers.google.com/actions, (Register if you don't have an account,) go ahead and click on "Go to Action Console".
Step 2
From the console dashboard, click on "Add/Import project" to create a new project.
Step 3
From the popup window, enter the project name, select the language you want the action to support, and click on "Create Project".
Step 4
From the "More Options", select Templates.
Step 5
From the Templates selection, select Flash Cards. It will take you on the "Setup & Overview" page where you can enter the action information.
Step 6
From the Quick Setup, click on "Decide how your action is invoked".
Set up the display name, select the voice for your Google Assistant.
From the Personality selection, select one of the available voice personalities.
From the Content selection, click on the "bulk upload" option.
You can see the prompt to upload the Google Sheets data.
Click on "Make a copy of the pre-filled Google Sheet for editing" link, then click on "Make a copy".
In the given Google Sheet, update your questions and answers with the Hint and Follow-ups fields that give the user extra information about the correct answer.
Here, I have added Agile Scrum related basic questions and answers followed by hints and follow-ups.
From the 2nd tab in the Google Sheet, you can configure the key and value, like Title, No. of Questions, Question Title etc.
Once you are done filling the sheet, go ahead and copy paste the Google Sheet link, and click on Upload.
Once your upload has been done, click on "Create App".
That's it. Now, you can create your application by clicking on "Test Action".
You can invoke your action by asking the Trigger Phrase 'Ok Google' or 'Hey Google' talk to' 'App Name' as per the picture below.
From the simulator, you can test your app. Here, I have asked 'Ok Google, talk to Mr. Scrum'.
It invokes the action we have created and randomly asks the questions which we have uploaded from the Google Sheet.
Once you give the answer, it will check the answer and give you feedback about whether it's correct or not, and do you want a hint.
That's it. Google Assistant is now in Hindi also. You can activate it from the Google Assistant App Settings tab, as shown in the below screen.
I hope you like this article, please leave a comment & feedback in the comment box.