What is Google DialogFlow?
DialogFlow (Formally called API.AI) is a conversational agent building platform from Google. You can call it Google Dialogflow
. It’s a web-based platform that can be accessed from any web browser. The tool has evolved over time from what was built as an answer to Apple Siri for the Android platform. It was called SpeakToIt, an Android app that created Siri-like conversational experiences on any Android smartphone. The AI and natural language technology that powered the SpeakToIt app was opened up to developers as API.AI in 2015.
DialogFlow (API.AI) enables developers to create conversational experiences by providing them with tools to undertake two kinds of tasks: understand and generate natural language utterances and manage the conversation. While there are many competing tools available in the market, we chose API.AI because it was one of the first, is mature, and constantly evolving; additionally, it’s easy to use and can integrate within other services.
Why build a Chatbot?
A chatbot is, in essence, a piece of robotic software used to imitate human conversation through text chats and voice commands (a good example being Siri or Amazon Alexa).
Two Types of Chatbots:
- Rule based chatbots (if you ask for phones the relevant phone pages open up in an e-commerce site that’s an example of a rule based chatbot)
- AI. based chatbots (learn over a period of time using Machine Learning techniques) — dialog flow is an example of that
CREATE YOUR FIRST DIALOGFLOW AGENT
Step 1: Log in to Dialogflow
Go to https://dialogflow.com/
Now press SIGN UP FOR FREE.
And connect with your Google account. If you don’t have a Google account, you will have to create one in order to use Dialogflow.
Read More: How To Build Facebook Messenger Chatbot Using ManyChat
Step 2: Create a new Agent
Choose a name for your new bot and the default time zone. To properly follow the tutorial, you should keep the language in english.
Step 3: Make the bot say hello
Right now, the bot doesn’t know how to answer to any user input. The journey of teaching it how to behave is just starting. Firstly, let’s model a bit of the bot’s personality and make him/her respond to ‘hello’ and present itself.
Press on Default Welcome Intent.
I will cover what Intents, Training phrases and Responses are in the next part of this tutorial, so don’t think of them now. Just do as I say.
Add ‘hello’ and ‘hi’ to the Training phrases by typing them in the text form and pressing enter after each of them.
Now go down to Responses and delete the current ones.
Press on ADD RESPONSES and then on Text response.
Now, like you did with the Training phrases, add a proper response. This is the first message the user will receive from the bot. Think of a normal conversation and imagine what a person would say, if you want your bot to look more conversational, but it’s a good practice to actually let the user know that they are talking to a bot and what’s the bot’s scope. I will add something like:
“Hello! My name is James and I am the virtual assistant of XYZ restaurant.
Would you like to book a table or learn more about our restaurant beforehand?”
Read More: What Is AI And Machine Learning? An Introduction For Clinicians
So the bot presents itself and presents the user some of its capabilities. This is more than enough for now. This message is a bit too long to be sent in a single line, but don’t worry, you will learn how to post multi-lines messages and randomize the responses later in this tutorial.
Step 4: Save
Don’t forget to always Save before you test the Intent or if you leave the page. Otherwise the changes won’t take effect.
Also, you should wait for Dialogflow’s training to be complete if you know you did everything right, but it’s not working. Two pop-ups will appear in the bottom right corner of the screen when the Agent started and finished training.
That’s it, the bot is ready. Let’s test it. Dialogflow allows testing the Agent without having to even leave the webpage. In the right side of the page, there’s the testing environment. Enter “hi” or “hello” in the right upper corner of the screen.
You should be able to see your bot’s welcome response.
If you get another message instead, something like the bot saying it didn’t understand, make sure you saved the Intent and try again.
This part maybe wasn’t very exciting, but this is just the beginning. You created your first agent and got your first response from the bot. In the next parts I will show you how to train your bot and create a true conversation.