An integrated LivePerson — Alexa, Google Home, and a chatbot solution

Rachel Batish
Chatbots Magazine
Published in
7 min readJun 8, 2018

--

Being able to serve customers automatically using a chatbot or a voice assistant such as Amazon Alexa or the Google home is great, however, what will you do when our bot can’t handle the customer’s intent or message? To handle the cases where your bot does not understand, or can’t handle the user’s request, Conversation.one enables the ability to handover the user to a human agent, using an integrated LivePerson — Alexa, Google Home, and a chatbot deployment.

Add bot to LivePerson

We will start by configuring LiveEngage to work with a bot. Please follow the steps below:

  • Add a new user, and set the type to “Bot”
  • Set the bot details: Login Name, Email, Nickname, and Name (you can fill the other details as well)
  • Select “Password” as the login method, and fill in a password
  • Assign the bot an “Agent” profile, set the “Max number of live chats” to “Unlimited”, set “Max number of messaging conversations” to “999”. Assign the bot a “bot” skill (you might need to create it)

That’s it! The bot user is ready. Let’s move to the next step to integrate the LivePerson bot with Conversation.one

If you do not have the option to select “Bot” as a user type, you will need to contact your LivePerson account manager.

Create a conversational app

A Conversation.one application represents your conversational interface through Amazon Alexa, Google Home or a chatbot bot. To create an app:

  1. If you don’t already have a Conversation.one account, sign up. If you have an account, log in.
  2. Click on Create New App in the navigation. If it’s your first application, you will be redirected to the Create New App wizard automatically.
  3. Select your industry and enter your company name. For the purpose of this tutorial, select “Retail” for the industry, and enter “My Store” as your company name. Click Next to continue.
  4. Select the devices you want to support with your app. For this demo select Amazon Alexa, and LivePerson. Click Next to continue.
  5. Your new application is ready. Click Customize to start developing your app.

Try it out

Now that your app is configured, you can try the pre-made retail template.

In the chat console on the right, type in a request. This can be something like “What is your address?”. After you type the request, hit “Send”.

The chatbot will answer with the demo business address, “Our address is 1 Market St, San Francisco, CA 94105”.

Connecting the Conversational application to LivePerson

Conversation.one is pre-integrated with LivePerson. To connect the new chatbot with LivePerson follow the steps below:

  • Open your app settings page
  • Select the LivePerson settings by clicking “Staging” and “LivePerson”
  • Fill in your LivePerson account number, and the bot login name and password you configured at the first step
  • Click “Save”, if all is well, the status will change to “Online”

Try it out

Now that Conversation.one is connected to LivePerson, you can try talking to the chatbot through the LivePerson widget.

Open the chat widget, the chatbot will greet you. In the chat console, type in a request. This can be something like “What is your address?”. After you type the request, hit “Send”.

The chatbot will answer with the demo business address, “Our address is 1 Market St, San Francisco, CA 94105”.

Hand over to a live-agent

While chatbot can cover a large variety of user cases, from simple F.A.Q. to complex data collection, there are still cases where you would need to hand over a client session to a live agent. In this tutorial, we will offer customers who asked for their order status to get connected to an agent. To method of handing over to an agent depends, naturally, on the communication channel. If the user contacted the business using the LivePerson widget, the hand over will be done seamlessly, on other cases such as Amazon Alexa or Google Home, we will demonstrate an over the phone hand over.

Some of the information in this guide is more developer-centric, but don’t be discouraged. If you follow the steps as they’re outlined, you will have a deployed, working hand over functionality.

  • In the editor, open “Order Related” and “OrderStatus”
  • Click “Add” response, and select “Code — Program your own action”
  • Add the following code, and click “Update”
res.say("<p>Do you have any further questions? Do you want me to connect you to a representative?</p>"); sdk.conversationHelper.setYesIntentHandler(context, req, res, 'Representative', true);
  • Go back to the Home folder, and click “Add new intent”
  • Enter “Representative” as “What you will the user ask your bot” and click “Next”
  • Select “Code — Program your own action” as your response
  • Add the following code and click “Finish”
if (req.getChannel() == "liveperson") {
res.say("Sure! I'm connecting you now.");
req.setRedirectToAgent("420922614");
} else {
if (!req.slot("PhoneNumber")) {
sdk.conversationHelper.askForEntity(context, req, res, [
[{
"name": "PhoneNumber",
"target": "PhoneNumber"
}]
], "To continue, please provide your phone number", "For example you can say, my phone number is (646) 869-2931.");
return;
}
var phoneNumber = req.slot("PhoneNumber").replace(/\D+/g, '');;
if (phoneNumber.length === 10) {
phoneNumber = "1" + phoneNumber;
}
res.say("A representetive will call you soon!");
sdk.twilloCall(phoneNumber, "+16468692931");
if (req.getChannel() == "alexa") {
req.shouldEndSession(true);
}
}

Please use your live agents Skill ID when redirecting to an agent using “req.setRedirectToAgent”.

  • Go back to the Home folder, and click “Add new intent”
  • Enter “Enter Phone Number” as “What you will the user ask your bot” and click “Next”
  • Select “Code — Program your own action” as your response
  • Add the following code and click “Finish”
return sdk.conversationHelper.FillEntity([{ "name": "PhoneNumber" }], context, req, res);
  • Open “Entities” and add a new entity named “PhoneNumber” with type “Phone Number”
  • Edit the “User Says” sample “Enter Phone Number”, delete the original text, and enter “{PhoneNumber}”
  • Click “Save” and wait until the model training is completed

Try it out

Now that your chatbot can hand over to a live agent, let’s try to run a full support cycle.

In the chat console on the right, type in the request “what’s the status of my order?”. After you type the request, hit “Send”.

The chatbot will answer with the demo answer, “example response for What’s the status of my order” and will offer the user to get connected with an agent “Do you have any further questions? Do you want me to connect you to a representative?

Answer “Yes”, and the chatbot will inform you that you are being transferred to an agent.

In the LivePerson dashboard, the agent will be notified that a new user is waiting

Once accepted, the agent can see the user’s conversation with the bot

And send a reply to the user

The user will continue the discussion with a human agent

What’s next?

You can try the handover on other channels, such as Amazon Alexa and Google Home.

Feel free to contact us, we are happy to help and answer any questions you may have.

Originally published at conversation.one on June 8, 2018.

--

--