Making your first app for Google Assistant

Priyam
Voice Tech Podcast
Published in
5 min readAug 4, 2019

A ‘How-to’ into the first Action on Google for Google Assistant

A couple of weeks ago, while I had some free time in my hand, I explored the topic of making Actions for Google, and I was literally surprised at how easy it was! Within a couple of weeks, I had taught myself how to not only make a multi-lingual Action, but also integrate a backend with it. Just to give you a general idea, I am an Android Developer typically working on Java and some Kotlin, having no (I repeat, NO) backend knowledge.

While I did discover it was much easier than I thought, I also found out that there wasn’t any particular article or series of articles that I could follow to learn everything I needed to make a multi-lingual Action for Google Assistant, with a backend, for someone who had zero prior experience. This is why, I decided to write that article myself.

Here’s what we will be learning today (part 1):

a) Make an Action that responds to ‘Hey Google, talk to ‘My Cool App’

b) It will either respond with
‘This is the Cool App reporting! What’s up?’
or ‘ Hey, welcome to My Cool App! What can I do for you?’

Here’s what you need to do:

  1. Create a new project on Actions Console
  2. Set up your invocation name: this is the name that you will use to call out or invoke your action. (Eg. Hey Google! Talk to invocation_name)
  3. Set up your first action on dialogflow

The screenshots below will be able to guide you:

create project

From here, select Decide how your action is invoked: this is the invocation_name

invocation name

So that means, now to open my Action, I will just have to say ‘Hey Google! Talk to My Cool App’

Now, click on ‘Overview’ and set up the action by clicking on ‘Add Action’

actions console overview

This will now open another the ‘Develop’ window and click on ‘Add Your First Action’, this will open Dialogflow Console

Build better voice apps. Get more articles & interviews from voice technology experts at voicetechpodcast.com

Let’s talk about what dialogflow is, for a moment. Dialogflow is a platform in which we can create conversational interfaces. It is powered by Google’s Machine Learning and Natural Language Understanding.

4. Accept Terms and Conditions and proceed forward. And then, create the first dialogflow agent associated with the same project-id.

t&c
create agent

5. Add Text Responses to the ‘Default Welcome intent’

Let’s take a moment to understand what is an intent and how does it work:

According to documentation,

Intents are mappings between a user’s queries and actions fulfilled by your software.

Let’s take an example to understand this, if we open ‘Default Welcome intent’ we can see training phrases like ‘Hey’, ‘Hello’, ‘Howdy’ etc.. This means that, if we say any of these training phrases to our action, it is this intent that will get called out. Note that on the right side, you can test out the intent by typing Training Phrases as inputs

So now, every time we say any of the ‘training phrases’ to ‘My Cool App’ any of these two sentences from ‘Text Responses’ would be used to respond us. You can add more phrases to the Text Responses to try it out.

intents in Dialogflow
training phrases

Now, let us add two sentences in the Text Response field

‘This is the Cool App reporting! What’s up?’
and ‘ Hey, welcome to My Cool App! What can I do for you?’

responses

And TADA! You just created your first Google Action!

Let’s test it out now, shall we?

Testing ‘My Cool App’

In dialogflow console, click on ‘Integrations’ on the left menu

That is all! Congratulations on making your first Action for Google!

Read on for some bonus content…

  1. On the Actions Console, create an Intent and name it ‘Name Intent’
  2. In the Name Intent, add ‘Training Phrases’ like: ‘What is your name?’, ‘Who are you?’
  3. In the ‘Text Reponses’ field, add ‘My name is My Cool App’
  4. Save it!

That’s all, and now while testing, you can ask your action, ‘What is your name?’ and it will be able to respond to you! How cool is that?

Similarly, you can add your custom Intents and fill them up with your queries and responses as you like.

Some useful links

Dialogflow docs

Google Actions Codelab

If you want to make this app even cooler, read this article I wrote about integrating a backend to an Action on Google, in this case, a firebase function.

I will be writing more on this series, about my experiences and learnings. Please let me know if you’d like to read them, or, let me know if you have any questions in particular about this topic that you’d like me to answer in my coming articles.

Thanks for reading my FIRST medium article. Do leave a clap if you find it useful.

Please show some enouragement :)

Something just for you

--

--

Priyam
Voice Tech Podcast

I make software for a living. I love code, music, books and honesty. More than that, I like making plans that may or may not be executed.