Create Your First Google Assistant Application

In the previous article, we have see the basics of Google Assistant and Actions On Google, we have also seen the difference between them. (If you have missed it, check Basics of Google Assistant and Actions On Google)

Today we will learn how to create Google Assistant applications using Actions and Dialogflow.

Image for post

What you will learn

  • Create an Actions project.
  • Integrate DialogFlow with Actions project.
  • Create a DialogFlow Intent.
  • Testing application with Actions simulator.

Let’s move to the first step of creating our google assistant application

Create an Actions project

Open a google actions console in your browser and sign-in with your google account. Once you are signed in, you will be able to see the following screen in your browser.

Image for post

Click on Add/Import project and agree to the terms and condition of Action on Google.

Image for post

It will ask for the project name, enter your project name and click on Create Project.

Image for post

As you can see in above image, the project name is Cricket Facts. Using this assistant application, user will be able to know few known/unknown facts about cricket.

Once you are done with creating a project, you will be able to see the following screen.

Image for post

We are done with creating our first project on actions console. Now click on Actions on Google available in top left corner which will redirect you to home page.

Image for post

As you can see, now you have a project named Cricket Facts in your project list. Click on it and we will move to further steps.

Integrate DialogFlow with Actions project.

From the left-hand menu click Build > Actions > ADD YOUR FIRST ACTION. Then select Custom Intent > BUILD

Image for post

It will redirect you to DialogFlow console. DialogFlow will ask for the permission for your account, read all those for your understanding and click on Allow.

Image for post

If it is the first time you are acccessing DialogFlow, it might ask you to review account settings and terms of service. Read it carefully and click Accept.

Now you will be redirected to DialogFlow agent creation page.

Image for post

You might have observed that agent name is prefilled which is our project name that we have entered, click on Create. Now we will move forward and create first Intent for our application.

Create a DialogFlow Intent.

From the left side menu panel select Intent and click on CREATE INTENT and enter our first intent name Facts Generator.

Now click on ADD TRAINING PHRASES and add following phrases :

  • What are facts
  • Tell me about cricket facts
  • What are known/unknown facts
  • Cricket facts
Image for post

These are the supposed inputs from the users, so we can add as many as we can.

Now click on ADD RESPONSE and enter below responses :

  • Chris Gayle is the only batsman to hit a six off the first ball of a Test match
  • Vinod Kambli’s Test match average is better than his childhood friend Sachin Tendulkar
  • Sunil Gavaskar was out off the first ball of a Test match thrice in his career
  • The only cricketer to play Test cricket for India and England is Saif Ali Khan’s grandfather, Iftikhar Ali Khan Pataudi
  • Asif Karim of Kenya has played International cricket and Davis Cup (Tennis) for his country

As of now, we will keep 5 facts, you can add as many as you want.

Image for post

Now click on Save in the top right corner.

Testing application with Actions simulator.

For this step, you first need to check whether you have given necessary permissions or not. Open Google Activity Controls page and enable below permissions.

  • Web & App Activity
  • Device Information
  • Voice & Audio Activity

Once you are done with it, move back to your Actions on Google console. Select Test from the menu and you will be on test Simulator.

Image for post

To test your actions, hit the Enter key in the box written Talk to my test app or click on the chips given below Suggested Input.

Image for post

Now enter any of the training phrases that we have entered earlier. For example, enter Tell me about cricket facts

Image for post

From the response, you have got an idea that how it works. Now enter training phrases and responses of your choice from the DialogFlow console and test it with the simulator as many times as you want.

That’s Awesome!

Congratulations! You have just finished building your first Google Assistant application and now you are ready to publish it. To publish it over market check How To Publish Google Assistant Application.

Good luck!

React Native | Android. Find more about me on http://ravirupareliya.com.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store