2020 — The year of virtual assistants. Have you always wanted to develop your own application that you can control just by your voice? Nowadays, voice application helps in many areas. For example, in health or travel. Disabled people that can’t move can with Google Assistant move with their bed, get the weather forecast and don’t need to look out the window. In the travel area, you can search for tickets just by your voice.
And now you can develop your own! And only the thing you need is a Gmail account. How to design it? I can’t code, can I still do it? Is it difficult? Keep reading, you spend just 3 minutes.
The first thing you need to have is a Gmail account. You don’t have to be a programmer and you can build your own action. So, let’s start.
Actions on Google
Actions on Google is the page you need to know. It is the main page for developing voice applications on Google Assistant. Let’s navigate to the page (http://actions.google.com/). Log-in and hit New project. Type your name there and choose language and region. And create. On this page, you will test your action in the future.
If you want to send your action to the world, you need to write Privacy police, fill out some information about you and your company. And select the name of your action.
In the right bottom corner, choose the Conversation design. Now it is important. You have to type the name of your application. This is the name, how users can invoke your action. Below, you can select a voice of assistant.
Now, move to Google Dialogflow (https://dialogflow.com/). Google Dialogflow helps you with NLU. So you don’t need to care about the understandition process. Also, here you define the mainframe of your application. Every intent can represent a function. Using Dialogflow you can integrate your application to other platforms like Facebook Messenger. And you are able to write your own code using the Fulfillment section.
In the beginning, there are two intents — default fallback and default welcome. The welcome one will be executed just ones — when the user starts the application. The fallback will be executed if you don’t have a defined answer, or the application doesn’t understand.
Let’s try to create our first intent. The first thing you need to do is to fill Training phrases. Training phrases are important to start the intent. If the user says “weather”, your intent will be executed. I recommend writing there more phrases — synonyms, sentences. It will increase the usability of your action.
The second important thing is Responses. If you write more Responses there, it will randomly select one and play it. Also, you can add suggestions, a carousel or images. At the end of the section, you can select this intent as the end of the conversation. That means it will be the last intent — your application will stop.
Action and parameters. Google AI can recognize what the user says. For example, you want to detect time. You can create parameter sys.time. Always when the user says time, it will automatically save into sys.time. Also, you can set the parameter as required.
Using Fulfillment you can write your own code. You can write it online — on the page using Inline editor. Or offline — in your code application like Visual Studio Code. For offline coding, you need to integrate Firebase functions. You need to install Actions on Google and Firebase functions using npm.
In this section, you can see all the platforms where can your application run. For example, you can have action on Google Assistant and Facebook messenger. Real-life example: you want to turn light off in your room. You can say to your assistant: turn light off. And on your smartphone, you can write to Facebook messenger bot to turn light on.
Also, there are some analytics and other functions. If you want to use APIs in your action, you need to upgrade your plane on Firebase to Blaze: pay as you go.
My name is Matej, I am a 17-year-old high school student interested in modern technologies, coding, business and marketing. I develop Google Assistant Actions for almost a year. During the summer I have won international Kiwi.com Student Challenge with a voice application Talking Tickets. The official name was Sport Travel Agency, but it was renamed. You can try it yourself — Hey Google, talk to Talking Tickets. Also, I have created an application for disabled people with Neuromuscular disease. The application was made with initiative Google Assistant for Good. Try it — Hey Google, talk to Game for Good.