Deconstructing Chatbots: Build an Appointment Scheduler with Dialogflow

In the first blog we learnt what conversation experiences are, why they are important, covered NLU briefly, and how Dialogflow lets you get up and running really quickly. In second article, we described a simple high level architecture to set up an agent in Dialogflow and learned about intents, entities, context and fulfillment at a high level. Now, we are ready to start working with Dialogflow and create our first chatbot.

Introduction

Wouldn’t it be awesome to have access to an appointment scheduler at a doctor’s office or DMV or a repair shop? In this article you will build a simple chatbot using Dialogflow and learn how to integrate it with web using one click integration.

The exercises are ordered to reflect a common cloud developer experience:

What you’ll learn

Prerequisites

Basic concepts and constructs of Dialogflow. For introductory Dialogflow tutorial videos that covers basic conversational design check out the following videos:

Create a Dialogflow Agent

Test the Agent!

On the right hand side of the Dialgflow console, you can see the testing panel that looks like this:

To test the agent, in the “Try it now” box type “Hi”. The agent should respond back with the default greeting defined in the “Default Welcome Intent”. This could be “Greetings! How can I assist?” You can also modify the response.

Now, if you try “set an appointment” it does not know what to do so it initiates the fallback intent. This is because we have not created any intent to catch that particular question!

Create Intent

Set an appointment on Wednesday at 2pm

Need an appointment for 4pm tomorrow

I would like to set an appointment for 3pm on Tuesday

Slot Filling

Now, try to test “set an appointment”, since that is not very specific and we have not currently handled that scenario, it should be handled by Fallback intent. To support this, we use something called Slot-filling.

Slot filling allows you to design a conversation flow for parameter value collection within a single intent.This is useful when an action can’t be completed without a specific set of parameter values. To learn more about slot-filling refer to this documentation.

Next, let’s set up Slot-filling.

Test Your Chatbot!

At this point, the Dialogflow should be set up. Test it in the Try it now panel on the right by entering the following conversation:

Enable One-Click Web Integration

Dialogflow provides many types of integration for your chatbot. Let’s take a look at a sample web user interface for the chatbot.

Click on Integrations in the Dialogflow left panel.

Enable the Web Demo integration by flipping the switch

Click on the URL link to launch Web Demo

Start using the chat interface by typing in the Ask something… section! If you are using a Chrome browser, if you click the microphone icon and you can speak your questions to the chatbot. Start chatting with the chatbot using the following conversation:

Congratulations!

You built a chatbot, and you’re now a chatbot developer! Keep reading for more tutorials like this here on medium or on GCP youtube series.

Next steps

--

--

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