Working with API.AI

Note:Google have changed name of API.AI to DIalogFlow and some of UI components.

API.AI is an AI tool that runs automated task continuously. API.AI is a site using which we can create chatbots. It is simple and free to create chatbot.
In last September 2016, Google acquired it and used it in Google Assistant. And the main thing is that it provides large no. of SDK & APIs using which we can publish our bot on different platforms and create custom clients too. Docs of Api.Ai is also pretty good to find the important stuff. If you have any doubts then you can also ask for it in forums and supports.

Videos: If you are interested to learn more about DialogFlow(API.AI) then you can visit my video series on Udemy (10$).

Agents are just module of your application, Agents are transferring user request to the actionable data. And Intent performs this transformation, Intents are specified by the developer.
Start with agent name, you can choose any name, note that it should not contain any spaces.
I am going to use MyApp as the name.

Next is a description, you can specify a brief description for the bot that you are going to create. I am writing MyApp, For a basic understanding of API.AI. Next dropdown contains some predefined data that you can use in your bot. I am creating empty bot so you can understand easily.

Next dropdown is a language that used in your bot. As said previously it supports various languages. Note that you cannot change language after creating Agent. I am going to English. Next is time zone, it is very useful because sometime you may want to retrieve time from the user. I am selecting GMT+5:30 for Indian time zone.

If you have Google cloud account and have any project then you can see dropdown here. We can import our existing project from Google to here. I want to create a new project instead of importing existing.

Intent represents a mapping between what a user says and what action should be taken by your software.
click on plus sign near intents. From here we can create intent.
Here we can specify the name for intent, I am using hello as intent name, and by clicking on this blue dot we can change a priority of this intent. The default is normal, I am remaining same.
We will learn about Context, Events, and Actions in later sessions. Now we will see the only User says, and Response.

Expand the user says section; in this section, we need to specify the list of a sentence that user may use to perform the action. For example, if your bot handles call-related functionality then the user may say Call John, make a call to the john, or dial phone to john etc. I am using Hello and Hi i user says section.

And now expand the response section, here we can write what user will see for that user says. For that, I am using Hey there, and Hy there. You can add one line to this response, but multiple lines are suggested. When you are specifying multiple lines API.AI will pick up any line randomly from these lines. The user may feel like human-communication if they got different messages every time, this is only logic behind it.

And click on save button. Click on top-right side, from here we can perform chat with our bot for testing purpose.
Let write Hi and press enter, here we got … and let write Hello we got … if you notice here is our intent name that is Hello, what if user write something else like this.

Videos: If you are interested to learn more about DialogFlow(API.AI) then you can visit my video series on Udemy (10$).

Leave a Reply

Your email address will not be published. Required fields are marked *