Write your first Action for Google Assistant
Google Assistant is a virtual assistant developed by Google and you can interact with it using natural language.
If you love comics you can think about the Assistant as if it is like Alfred in Batman, if you feel more technical instead you can see it like Iron Man’s Jarvis.😉
What you will do
Following this codelab, you will create a simple Action working in the following way:
- Users will call the Action with a custom invocation and the Action will answer with a custom welcome message.
- User can request facts about relevant women in history.
- Action select a fact to tell to the user.
- User can terminate the conversation at their will.
What you will learn
- You will learn how do Actions on Google and DialogFlow work.
- You will understand how to create a DialogFlow agent.
- You will understand how to train the DialogFlow agent.
- You will know how to test your Action.
- You will understand how to use Cloud Functions and DialogFlow libraries to develop the Action fulfillment.
Hey Google, what’s under the hood?
As you can imagine, when you say “Ok Google” an entire mix of services and processes play their part: speech-to-text, NLP, speech-to-text, backend fulfillment…
But why do we need all those things?
To fulfill a request, Assistant should know what do we want and what informations are required to complete the task we asked to fulfill.
Human language is an extremely difficult input to parse so all the algorithms using rules to understand its syntax (its form) and semantics (its meaning) are not so good to do the job.
A completely different approach is then needed, an approach based on probability and deduction. Algorithms using this approach use a “model” trained on a previously labeled input (“training data”) to know how to deal with any kind of input (“prediction”).
Google offers DialogFlow, a platform to develop “conversational interfaces”: DialogFlow embeds all the tools needed such as the Action can understand what to do (“intent”) and the parameters required for the fulfillment (“entities”).
Now it’s up to the developer to code the backend, which receives request and parameters and sends responses in an Assistant compliant format (fulfillment)…and the work is done!