Getting started with Google Actions
Tags: googleactions, developers, googleassistant
Published: 2019-05-29 10:15:09

---
title: Getting started with Google Actions
published: True
description: A platform for developers to develop software to extend the functionality of Google Assistant.
tags: GoogleActions, Developers, GoogleAssistant
---

![Getting started with Google Actions](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/Getting-started-with-Google-Actions.png)

##What is Action?

An Action is a starting point into an interaction that you build for the Assistant. Users can talk to your Action by typing or speaking to the Assistant.

To start talking to your Assistant using action, the user says or types the phrase like “Hey google play some music” the whole sentence is utterance while the phrase “hey google” is the trigger. Let’s take another example, "Hey Google, talk to Appointment Scheduler". Here, “Hey Google” is the trigger and “Appointment Scheduler” is the invocation name.

##Setup Google Action

* Open [Google Actions Console](https://console.actions.google.com/?pli=1),log in with your Google account and add a new project. 
* Select the “conversational” option to build a customized conversational experience.
* You are now on your project’s overview page. Now click “Quick setup” and “Decide how your Action is invoked”.
* Set Invocation Display name and Google Assistant voice and save the changes.

![Output 1](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-1-2.png)

* Go to “Actions” in the Build section. And add your first action, leave the default selection of “custom intent” as it is and Builds. It will take you to the Dialog Flow console.

###What is Dialog Flow?

Dialog Flow is [Natural Language Processing](https://www.linkedin.com/pulse/natural-language-processing-using-python-top-5-libraries-barot/). Dialog Flow handles the job of translating natural language into machine-readable data using machine learning model.

Here is an example of how Dialog Flow handles a user utterance.

![output 2](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-2-2.png)

**Key Terms**:

- Agent
- Intent
- Entities
- Fulfillment

###Read Also - [Extracting text from image using Google Cloud vision OCR with Ruby](https://www.botreetechnologies.com/blog/extracting-text-from-image-using-google-cloud-vision-ocr-with-ruby)

**Agent**

* We first create an agent with a dialog flow, Agent is your entire chatbot application

What Agent does?

1. Collects what users say
2. Map it to an intent
3. Takes action on it
4. Provide the response

* This all starts with the trigger event called utterance. This is how users invoke the chatbot.

* Let's create an agent.

Enter the new Agent name or keep the default one and hit “Create”.

**Intent**

* The intent is something that lets you take any normal conversation/text and extracts computer-understandable information from it.

* For example: If you say “I want to set an appointment”. “Set appointment” is an intent here. Or if you ask “what are your hours of operation” then “hours of operation” here is intent.

* Dialog flow then trains the [machine learning model](https://www.botreetechnologies.com/machine-learning-solutions) with many more similar phrases and finally match the user's phase to the right intent. This process is called intent matching (Refer the example diagram above).

* Dialog Flow has two default intents, Welcome Intent and another is Fallback Intent. Welcome Intent helps greet users and the default fallback intent helps to catch all the phrases that your software does not understand. You can try writing some phrases in the “try it now section” of the test console (last panel) on the screen.

* Let's create our custom intent.

Write the Intent name, we are using “Schedule Appointment” and hit “Save”. Let’s skip context and events for now and we will add training phrases and responses.

![output 3](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-3.png)

Click “Add Training Phrases”, As you add the phrases and press enter you will see the date and time entities are automatically highlighted.

![output 4](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-4.png)

Click “Add Responses”, Type the response you want for the mentioned training phrases. And to show the date and time, use our system variables $date and $time in the response.”$” sign here helps to access the entity values.

![output 5](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-5.png)

Now, test it in the test console. Type your phrase in “Try it now” and press enter.

![output 6](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-6.png)

Voila... It works!
	
**Entities**

* Critical pieces of information in the statement to do some task. These are variables you want to define and collect.

* For example: “Set an appointment tomorrow at 4 pm”. 4 pm and tomorrow are the two entities

* DialogFlow has some predefined entities like date, time, address, city, etc…, these are called system entities.

* We can also define custom entities in our agent, which are called developer entities.

Now, What if someone writes the phrase “Set an appointment”. We have not yet handled that scenario, to support this we have something called Slot Filling. Here, we make the entities as required and the dialog flow will make sure to ask for the missing required entities.

Let's add the above scenario in our software.

* Click on “Manage Parameters and action” from the action and parameters section.
 
* Mark the entities required and click on “define prompts” to define the prompts for the required entities. 

You can add more variables if you want to and just click “Save”.

![output 7](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-7.png)

Now, again test it in the test console. 

![output 8](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-8.png)

Yayy… It works.

If you want to add any custom logic or calculations to the software then you can use fulfilment. That we will cover in the next blog post.

We did all the testing in the test console. What if you want to share this software you made with your friends? 

To share it just click on “Integrations” in the sidebar and enable the “Web Demo”. You can share the link or you can frame it in your website or mobile application.

###Deploying the application

Stay on the “Integrations” page and click “Integration Settings”. You can “Test” the app and then If all works fine to go on and click “Manage Assistant app”.

![output 9](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-9.png)

Click “Get ready for deployment”. Fill up the details and go back and click the “Release” option. Reach out to learn more about the [expert web developers in NYC](https://www.botreetechnologies.com/usa/web-development-company-new-york) for the various ways to improve or build the quality of projects and across your company.

![output 8](https://www.botreetechnologies.com/blog/wp-content/uploads/2019/05/output-10.png)

That’s it for now.