Connecting LivePerson with Amazon Alexa, Google Home, and a Chatbot
How to connect LivePerson to IoT devices, including Amazon Alexa, Google Home, and a Chatbot.
Join the DZone community and get the full member experience.
Join For FreeBeing 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 situations where your bot does not understand the user’s request, Conversation.one allows you to handover the user to a human agent, using an integrated LivePerson – Alexa, Google Home, and a chatbot deployment.
Add a 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 in the other details as well)
- Select “Password” as the login method and fill in your password
- Assign the bot an “Agent” profile and set the “Max number of live chats” to “Unlimited." Then, set “Max number of messaging conversations” to “999." Next, 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 and 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:
- Log in to Conversation.one dashboard. If you don’t already have an account, sign up for free.
- Click “Create New App” on the navigation bar. If it’s your first application, you will be redirected to the “Create New App” wizard automatically.
- Select your industry and enter your company’s name. For the purpose of this tutorial, select “Retail” for the industry, and enter “My Store” as your company’s name. Click “Next” to continue.
- Select the devices you want to support with your app. For this demo, select Amazon Alexa and LivePerson. Again, click “Next” to continue.
- Now, your new application is ready. Click on “Customize” to further develop your app.
Test Your Bot and Customize It
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 for example “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."
You can learn how to create and customize a Conversation.one app in the “Building Your First Conversational App” tutorial.
Connecting the Conversational App to LivePerson
Conversation.one offers automatic, pre-integration with LivePerson. All we need to do now is connect the new chatbot we have created with LivePerson. Follow the steps below to complete the process:
- Open your app’s "Configuration" page on the Conversation.one dashboard.
- Select the LivePerson settings by clicking on “Staging” at the top and then “LivePerson” on the left-side menu.
- Fill in your LivePerson account number. Then, add the bot’s login name and password that you configured in Step #1.
- Next, click “Save." If everything is configured correctly, the LivePerson Agent status will automatically 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 start with a short greeting. Type in your request on the chat console. You can write for example: “What is your address?” Then, hit “Send."
The chatbot will answer with the demo business address, “Our address is 1 Market St, San Francisco, CA 94105”.
Handover to LiveAgent
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 LiveAgent. In this tutorial, we will show customers who asked for their order status to get connected to an agent. The method of handing over to an agent depends, naturally, on the communication channel. If the user contacted the business using the LivePerson widget, the handover will be done seamlessly. In other cases, such as Amazon Alexa or Google Home, we will demonstrate an over-the-phone handover.
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 be able to deploy a handover functionality in a snap!
- On the Conversation.one editor, click on the “Order Related” folder and then choose the intent “OrderStatus.”
- Scroll down to the “Response” area and click “Add” response. A pop-up will open. Select a “Code – Program your own action” response.
- Add the following code to the text box, 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 main interaction screen and click “Add new intent.”
- For the text box below with the question “What you will the user ask your bot," enter “Representative” and click “Next.”
- Once again, select “Code – Program your own action” as your response.
- Add the following code to the text box and click on “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);
}
}
Make sure to use your live agent's Skill ID when redirecting to an agent using “req.setRedirectToAgent."
- Go back to the main interaction screen once again and click “Add new intent.”
- Click “Enter Phone Number” under “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);
- On this new intent, click on “Entities” and add a new entity named “PhoneNumber” with type “Phone Number.”
- Edit the “User Says” sample “Enter Phone Number” by deleting the original text and entering “{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. It will read “Do you have any further questions?" and "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 take it from here.
Now, the agent will continue the conversation with the user.
And, the user will be notified that they are now talking with a human agent.
Published at DZone with permission of Chen Levkovich, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
The Role of AI and Programming in the Gaming Industry: A Look Beyond the Tables
-
13 Impressive Ways To Improve the Developer’s Experience by Using AI
-
Incident Response Guide
-
Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
Comments