Hello Devz,

Having a Google Home at home and a Google Assistant in my pocket, I wanted to go further and create my own Actions. Pretty easy with Google DialogFlow!

DialogFlow is a free web interface that allows you to create a, wait for it… dialog flow!

Let’s say I want to add an expense by voice. Go to dialogflow.com, create your new project and open the Intents. As you can see, two default Intents will be present: the fallback and the welcome ones. Which will manage the default interactions with the user. Like “Hello”, “I ‘don’t know”, …

Create Dialogflow Intent

Create Dialogflow Intent

You can try the default interactions with these intents:

Test default Welcome Intent

Test default Welcome Intent

Now we can add our own custom Intent. Let’s call it AddExpense. Here we can first add some training phrases. You will see that some words will take colors. An AI is helping you to recognize the default entities, like currencies, date, time, …

Intent - Training phrases

Intent – Training phrases

If you click on one of the training phrases, you will see the parameters:

Google Dialogflow - Intent Parameters

Google Dialogflow – Intent Parameters

A bit below, you can see the parameters configuration. You can specify that some parameter are required and a default prompt if it’s missing.

Google DialogFlow - Intent Parameters configuration

Google DialogFlow – Intent Parameters configuration

As you can see, you can put as many prompt you want:

Google Dialogflow - Parameter prompt

Google Dialogflow – Parameter prompt

When the AI have all the needed parameters, it can give a custom answer to the user:

Google DialogFlow - Answer

Google DialogFlow – Answer

Now if you need more than the default parameters, you can create them in the Entities part. In this example, I will add a PaymentType (cash, credit card, … and their synonyms):

Google DialogFlow - Custom Entities

Google DialogFlow – Custom Entities

Now you can test you Intent to see if everything works:

Google DialogFlow - test Intent

Google DialogFlow – test Intent

Your Intent is complete, a JSON file is generated and can be sent to any webservice, even “locally” in the Google Cloud as a Fullfillement.

 

Google DialogFlow - json result

Google DialogFlow – json result

 

Google DialogFlow - fullfillement

Google DialogFlow – fullfillement

Now you can integrate your AI to all kind of chat like application:

Google DialogFlow - Integrations

Google DialogFlow – Integrations

Happy DialogFlow!!  😉