easily deploy your chat bot to multiple channels with stamplay

69
Giuliano Iacobelli, Co- founder / CEO [email protected] Easily Deploy your Chat Bot to Multiple Channels with Stamplay Cooking time: 30 mins

Upload: ibm-watson

Post on 12-Apr-2017

133 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Giuliano Iacobelli, Co-founder / [email protected]

Easily Deploy your Chat Bot to Multiple Channels with StamplayCooking time: 30 mins

Page 2: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Chat UX is more natural, dynamic and avoid any friction opening new accounts

The ideal user engagement channelMessaging platforms aim to change the way brands communicate with

consumers

More than 900 million monthly active users only on Facebook Messenger

In 2015 messaging apps have been the fastest growing In the global Top 10 of most used apps 6 are messaging apps

No need to download yet another app

Page 3: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

IngredientsThe bot will be available on Cisco Spark and Facebook Messenger will use IBM

Watson Conversation to handle natural language and will be implemented using Stamplay.

Page 4: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Getting started

Page 5: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Create an account on StamplayGo to https://editor.stamplay.com/signup and create your account for free

Page 6: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Create the project on StamplayOnce inside, click on the green “+” button in the upper right corner and select Start

from Scratch

Page 7: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Create the project on StamplayType a name for your project

Page 8: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Grab your credentials from Watson Conversation

Enter your Bluemix account get the credentials for the Watson Conversation service

Page 9: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Connect IBM Watson Converstion on Stamplay

On Stamplay go to Dashboard > Integrations and search IBM Watson Conversation

Page 10: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Copy your Watson Conversation credentialsCopy Username and password and then click “Connect”

Page 11: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Copy your Watson Conversation credentialsGo to https://developer.ciscospark.com/apps.html and create a Bot

Page 12: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Fill basic info for your botIcon URL

https://dl.dropboxusercontent.com/u/397182/logo_white_512x512.png

Page 13: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Save the Access TokenOnce the bot is created you’ll see an Access token, copy it and save it

somewhere

Page 14: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Connect Cisco Spark Bot on StamplayOn Stamplay go to Dashboard > Integrations and search Cisco Spark bot

Page 15: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Copy your Spark bot tokenCopy the Access Token you got before and then click “Connect”

Page 16: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

The Dialogue

Page 17: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Launch the Watson Conversation toolFrom your Bluemix account enter the Conversation service and click Launch

Tool

Page 18: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Import the dialogue modelClick the icon next to “Create” button and upload the dialogue model

https://app.box.com/s/x4j6fb8036lasosl45blyv9ir9s9gluo

Page 19: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Dialogue overview: IntentsA set of intents are used to return answers to known questions

Page 20: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Dialogue overview: Intents#when_it_burns intent handles questions like “what night does the man

burn?”

Page 21: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Dialogue overview: Intents#when_it_is intent handles questions like “what are the dates for the event?”

Page 22: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Dialogue overview: Intents#where_is_it intent handles questions like “where is the festival located”

Page 23: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Dialogue overview: Intents#what_is_it intent handles questions like “what is the burning man?”

Page 24: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

The Dialogue modelAn Start node of the dialogue tree handles the initial conversation

Page 25: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

The Dialogue modelCreate a root node for each intent that can answer a question (e.g

#what_is_it)

Page 26: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

The Dialogue modelCreate a root node for each intent that can answer a question (e.g

#where_is_it)

Page 27: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Connect to Spark

Page 28: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Inizializing the integration FlowGo to Flows and start by selecting the Cisco Spark bot app from the list

Page 29: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Configure the event that starts the flowWe’ll start this flow everytime the bot receives a New Direct Message

Page 30: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Select the event that starts the flowClick on continue when you get to the Account tab, we’ve connected this

before

Page 31: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Adding a steps to your flowAfter each step of your workflow you can define the following action by

moving your mouse hover the + icon

Page 32: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Add a Contidion step to filter bot messagesSpark triggers this event also when is the bot itself writing so we filter out its

messages with a condition step that checks for the sender email address

Page 33: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Checking if the message is sent by the botClick on the first dropdown on the left and select personEmail, this will be the

property we use to recognize if is a bot writing ([email protected])

Page 34: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

If the condition is met stop the flowTo run a branch of our flow only when the condition is met let’s add a step that

will be executed IF TRUE.

Page 35: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Adding a Stop stepAfter clicking IF TRUE, select STOP to add a step that will terminate flow

execution.

Page 36: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Saving the Stop stepSave the new step without any additional configuration and you’re good to go

Page 37: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Retrieve message contentThe New Message trigger of Spark only pass an ID of the message received

without content. To read the actual message we add the Get Message action.

Page 38: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing data from step to stepTo use a Message Id from a previous step. Click on the “{}” button to see the

steps available to fetch data from and select New Direct Message.

Page 39: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing data from step to stepClick on the id attribute of the message JSON representation sent by Spark

Page 40: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing data from step to stepStamplay will add a parameter inside the input field and will automatically

replace it with the actual value of the id of the New Direct Message that will trigger this flow

Page 41: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing the message to WatsonNow that we have the message that has been type by the user we can pass it

to Watson, add a new Action and select IBM Watson Conversation

Page 42: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing the message to WatsonSelect the only action available, Conversation

Page 43: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing the message to WatsonFill the parameters by passing the Workspace ID and the text. Workspace Id is

available on the Watson Conversation tool home, text will be passed by the previous step.

Page 44: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Getting the Workspace IdOn your account of the Watson Conversation tool you can find the workspace

Id by entering the Workspace details

Page 45: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing the message to WatsonSelect the text attribute from the JSON representation passed by the Get

Message action

Page 46: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Passing the message to WatsonStamplay will add a parameter inside the input field and will automatically

replace it with the actual value of the text of the Get Message action

Page 47: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserThe last step of our flow is to return the answer computed by IBM Watson

Conversation. Add one more action and select Cisco Spark Bot Post Message action

Page 48: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserThe Room dropdown shows us all the room where the bot is currently

available. Click on Type a custom value to be able to pass here a dynamic value

Page 49: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserOnce che cursor is blinking, click on the “{}” button to grab a valid Room Id

from the New Direct Message step of this flow

Page 50: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserSelect the roomId attribute from the JSON representation

Page 51: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserText field will be filled by passing the result returned by IBM Watson

Conversation, once again click the “{}” button to open the dropdown with the previous step of the flow

Page 52: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Returning the answer to the UserAfter selecting IBM Watson Conversation select the text attribute nested under

output

Page 53: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

You’re all setThe final flow should look like this, make sure it’s on by checking the switch

Page 54: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Adding Messenger

Page 55: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

The Data Model

Page 56: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Connecting your Facebook Page

Page 57: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Connecting your Facebook Page

Page 58: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Creating the integration Flow

Page 59: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

What starts the flow (trigger)

Page 60: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Configuring Webhook URL on Facebook

Page 61: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Configuring Webhook URL on Facebook

Page 62: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Configuring Webhook URL on Facebook

Page 63: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Lookup for existing conversations

Page 64: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

If conversation not found..

Page 65: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

..get info about user profile..

Page 66: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

..process user message with Watson..

Page 67: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

..save new conversation record..

Page 68: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

.. and reply to user on Facebook Messenger

Page 69: Easily Deploy your Chat Bot to Multiple Channels with Stamplay

Giuliano [email protected]

Thanks!