Watch the video
This tutorial assumes you have a user account for the Conversational Cloud and Conversation Builder platforms. If you don't, your team should have an administrator who can create one for you.
Step 1: Create a new bot
- Navigate to https://authentication.liveperson.net/login.html, enter your credentials, and log in.
- In the left sidebar in Conversational Cloud, click the Conversational AI and Bots icon.
- In the Conversational AI dashboard, click Conversation Builder.
- Click New Bot in the upper-right corner, and select the generic Custom Bot template. Click Next.
Give the bot a unique name and description, and click Create Bot.
This takes you to the new bot in Conversation Builder. Since you selected the Custom Bot template, by default this creates a bot with a “Welcome” dialog that matches and responds to simple forms (patterns) of “hello.” The bot also has a Fallback dialog with some fallback text.
Examine the Welcome dialog, which is displayed by default.
(You can learn about the different parts of Conversation Builder here.)
Step 2: Test the Welcome dialog
With the bot created, let’s see how to make it respond to user utterances.
The first interaction in the Welcome dialog is a Dialog Starter interaction that allows us to match a user’s utterance using patterns or intents. Following that is a Text Statement interaction that displays some text ("Hi there! Thanks for coming!") to the user.
Statement interactions (e.g., Text, Image) are for displaying content to the user, without listening for a user response. Once the statement is displayed, the conversation flow moves on to whatever is next in the dialog. (You can learn more about interactions here.)
Let’s see the interactions in action!
Click Preview in the upper-right corner.
In the Preview window, enter “hello” or “hello there,” and click Send. You should see the welcome response.
So how is the Welcome dialog triggered?
Examine the Dialog Starter interaction. On the interaction tile, note the different patterns used to match this particular dialog. (You can also use an intent to trigger a dialog, but in this tutorial we focus on patterns.)
Since this is a "Welcome" dialog, it uses patterns like “hi”, “hello” and “howdy” to match those phrases exactly and display a response.
By adding wildcards (e.g.,
hello *) you can allow for broader matches like “hi there” or “hello my friend.” Using parentheses and pipes allows you to specify a series of alternates. For instance,
(hi|hello|hey)*will match “hi”, “hello there” and “hey you.”
Patterns are a great way to create hard-coded logic in the bot while you build out the design. As your bot grows, you’ll want to incorporate Natural Language Understanding to provide a more conversational experience for users. Our next tutorial on "intents" and "entities" serves as an introduction to these topics.
Click the patterns (green button). On the Patterns & Intent tab in the Interaction Settings window, add some more patterns (e.g., “hiya”, “ciao”, and “hola”). Click Save.
In the Preview window, click Reset Session. This starts a new session that "picks up" your changes.
Test the new patterns in the Preview window like you did before.
Now that you’ve seen how a dialog is triggered, let’s change the welcome response by editing the Text Statement interaction.
Select (click) the Text Statement interaction below the dialog starter.
Change the text from "Hi there! Thanks for coming!" to "Hi there! How can I help you?", and press Enter. (There is no need to open the Interaction Settings to change simple output text.)
To see your change, open the Preview window again, and click Reset Session. Then enter “hi”. You should see the “Hi there! How can I help you?” response.
Step 3: Add a Goodbye dialog
Let’s create another dialog to put these concepts into more practice. Since there is a "Welcome" dialog, let’s now create a “Goodbye” dialog.
- Click Add Dialog in the lower-left corner.
In the Add Dialog window, on the New Dialog tab, name the dialog "Goodbye", and select Dialog for Dialog Type. Click Save.
By default, the new Goodbye dialog has a Dialog Starter interaction; this allows the dialog to be triggered by patterns or an intent. But the interaction isn't configured by default, so let's do that now.
For the dialog starter to match user input, you need to add some patterns.
Select the interaction, and click + Pattern.
Under Patterns, add a few patterns like
see ya, etc. You can do this manually:
Alternatively, a quick and easy way to add these patterns is to click the Library link, and select the "Bye" set of patterns.
Before you test things in the Preview window, you need to add some content to be displayed when the bot matches a pattern. Let's add a Text Statement interaction.
In the Interactions toolbar, click the Text Statement icon . This inserts the interaction.
(If you can't see the Interactions toolbar, close the Preview window, which might be covering it up.)
In the interaction, enter a goodbye message (e.g., "Thanks for stopping by."), and press Enter.
Let's test the changes.
Open the Preview window again, and click Reset Session.
Enter “hi” to trigger the Welcome dialog and see the welcome message. Then enter “goodbye” to trigger the Goodbye dialog and see the goodbye message.
Step 4: Test the Fallback dialog
You’ve seen how to create a new dialog and trigger it using patterns. But what happens when you enter an utterance that hasn't been accounted for? To catch and handle these when they occur, you can provide a "fallback dialog." By default, when you create a bot using the Custom Bot template, one is included. Let's examine and test it now.
There can be only one dialog of type Fallback per bot.
In the Dialogs panel on the left, click 2 Fallback. This opens the Fallback dialog.
Note how there isn't a Dialog Starter interaction.
You don't need a dialog starter in the Fallback dialog because the Fallback dialog has special properties that cause it to display when there are no other matches available. However, you do need to add some type of message to tell the user that the bot didn’t understand their query. A default message is provided for you.
Select the Text Statement interaction, and change the message to, "Sorry, I am not able to understand. Please try again." Press Enter.
Open the Preview window again, and click Reset Session.
Enter something other than your hello and goodbye patterns. You should see your fallback message.
Continue on to the next tutorial in the series.