27
Nov 19, 2016 Sofia var title = “Automate communication with MS Bot Framework”; var info = { name: “Stamo Petkov”, company: “Information Services Plc”, email: “[email protected]”, gitHub: “https://github.com/stamo”, blog: “http://www.stamopetkov.eu” };

Automate Comunication with MS Bot Framework

Embed Size (px)

Citation preview

Page 1: Automate Comunication with MS Bot Framework

Nov 19, 2016

Sofia

var title = “Automate communication with MS Bot Framework”;var info = {

name: “Stamo Petkov”, company: “Information Services Plc”,

email: “[email protected]”,gitHub: “https://github.com/stamo”,blog: “http://www.stamopetkov.eu”

};

Page 2: Automate Comunication with MS Bot Framework

Nov 19, 2016

agenda();

• Definitions• Overview of MS Bot Framework• Building blocks of the framework• Bot Builder for Node.js• Registering your Bot• Configuring channels• Publishing your Bot• Best practices• Bot Intelligence

Stamo Petkov Automate communication with MS Bot Framework

Page 3: Automate Comunication with MS Bot Framework

Nov 19, 2016

Definitions

Page 4: Automate Comunication with MS Bot Framework

Nov 19, 2016

Definitions

Stamo Petkov Automate communication with MS Bot Framework

Hello, Dave!

Page 5: Automate Comunication with MS Bot Framework

Nov 19, 2016

Definitions<bot>

Origin: 1960s - shortening of robot.• Oxford English Dictionary

o The larva of the botfly, which is an internal parasite of horses

o An autonomous program on a network (especially the Internet) which can interact with systems or users, especially one designed to behave like a player in some video games

• In context of bot frameworko A bot is a web service that interacts with users

in a conversational format

Stamo Petkov Automate communication with MS Bot Framework

Page 6: Automate Comunication with MS Bot Framework

Nov 19, 2016

DefinitionsConversational User Interface – CUI

Stamo Petkov Automate communication with MS Bot Framework

Page 7: Automate Comunication with MS Bot Framework

Nov 19, 2016

Overview of MS Bot Framework

Page 8: Automate Comunication with MS Bot Framework

Nov 19, 2016

• Channelso Text/SMSo Skypeo Slacko Facebook

Messengero Office 365 mailo GroupMeo Telegramo Kiko Webo Direct Line

• The framework o Bot Builder SDK• .Net SDK• Node.js SDK• REST API

o Bot Connectoro Developer Portalo Bot Directoryo Emulator

Overview of MS Bot Framework

Stamo Petkov Automate communication with MS Bot Framework

Page 9: Automate Comunication with MS Bot Framework

Nov 19, 2016

Building blocks of the framework

Bot Builder SDK, Bot Connector, Developer Portal, and Bot Directory

Page 10: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Builder SDK

• Powerful dialog system with dialogs that are isolated and composable.

• Built-in prompts for simple things like Yes/No, strings, numbers, enumerations.

• Built-in dialogs that utilize powerful AI frameworks like LUIS.

• Bots are stateless which helps them scale.

Stamo Petkov Automate communication with MS Bot Framework

Page 11: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Builder SDK• .Net SDK

o Microsoft.Bot.Builder NuGet packageo https://github.com/Microsoft/BotBuilder/tree/master/CSharp

• Node.js SDKo Botbuilder npm packageo https://github.com/Microsoft/BotBuilder/tree/master/Nodeo Use typedoc to buid the documentation

• REST APIo Authentication

• SSL/TLS, OAuth 2.0, JSON Web Tokens, OpenId metadatao Bot Connector REST API

• Generate from the Connector API Swagger fileo Bot State REST API

• Generate from the State API Swagger file

Stamo Petkov Automate communication with MS Bot Framework

Page 12: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Connector• The Microsoft Bot Connector is a

communication service that helps you connect your Bot with many different communication channels

• To use the Microsoft Bot Framework Connector, you must have:o A Microsoft Account (Hotmail, Live,

Outlook.com)o An Azure-accessible REST endpoint exposing a

callback for the Connector serviceo Developer accounts on one or more

communication services(such as Skype) where your Bot will communicate

Stamo Petkov Automate communication with MS Bot Framework

Page 13: Automate Comunication with MS Bot Framework

Nov 19, 2016

Developer Portal

• Register your bot• Connect to

channels• Test• Publish• Manage• Measure

Stamo Petkov Automate communication with MS Bot Framework

Page 14: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Directory

Stamo Petkov Automate communication with MS Bot Framework

Page 15: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Builder for Node.js

Page 16: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Builder for Node.js• To get started either install the Bot Builder

module via NPM:o npm install --save botbuilder

• Or clone our GitHub repository using Git. This may be preferable over NPM as it will provide you with numerous example code fragments and bots:o git clone https://github.com/Microsoft/BotBuilder.gito cd BotBuilder/Nodeo npm install

Stamo Petkov Automate communication with MS Bot Framework

Page 17: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Builder for Node.js• Initialize bot

var builder = require('botbuilder');

var connector = new builder.ConsoleConnector().listen();

var bot = new builder.UniversalBot(connector);• Start adding dialogs

o Bot Builder breaks conversational applications up into components called dialogsbot.dialog('/', function (session) { session.send('Hello World');});

Stamo Petkov Automate communication with MS Bot Framework

Page 18: Automate Comunication with MS Bot Framework

Nov 19, 2016

Registering and Publishing

Register, Configure, Publish, Best practices

Page 19: Automate Comunication with MS Bot Framework

Nov 19, 2016

Registering your Bot• To register your bot,

sign in to the Bot Framework site and provide the requisite details for your bot, including a bot profile image.

Stamo Petkov Automate communication with MS Bot Framework

Page 20: Automate Comunication with MS Bot Framework

Nov 19, 2016

Configuring channels• Connect your bot to

the conversation channels of your choice using the channel configuration page and your developer credentials associated with that channel. The Skype and Web channels are auto-configured for you

Stamo Petkov Automate communication with MS Bot Framework

Page 21: Automate Comunication with MS Bot Framework

Nov 19, 2016

Publishing your Bot

• Bots registered through Developer Portal and reviewed for publishing will appear in the Bot Directory

• Publishing your bot is an optional process• Microsoft will review your bot submission

to make sure it meets certain minimum requirements before it is publicly available on the Bot Directory

Stamo Petkov Automate communication with MS Bot Framework

Page 22: Automate Comunication with MS Bot Framework

Nov 19, 2016

Best practices

• Craft an engaging welcome messageo Always introduce your Bot to members of the chat.o Let users know how they can interact with your Bot (e.g., list command

interfaces your Bot supports).o Engage them by requesting a response and wait for the user to

respond before continuing the conversation.

• Emotion, variety and personality are vitalo Unless you want to deliberately project a robotic persona, make your

Bot colorful and rich in expression (e.g., using different font-styles, emoticons etc. in your Bot’s script). Try to keep variety in the conversation responses when the same topic or question comes up multiple times in a conversation. Over time, based on the tone and character of your Bot, the user should build a character for your Bot in their mind.

Stamo Petkov Automate communication with MS Bot Framework

Page 23: Automate Comunication with MS Bot Framework

Nov 19, 2016

Best practices• Be judicious with data and message

frequencyo Don’t send out too many messages in sequence when they can be

grouped into a single message.o Be cognizant of the user’s network-speed and bandwidth charges when

sending images and/or videoso If you want to do something out of the ordinary (e.g. send a 100

messages in the next minute, send a large file etc.), then take consent from the user before doing it.

o Don’t send out messages that might appear as spam (e.g. wishing a user “Good night” at 10 pm every night).

• Give feedbacko It’s always good to give a sense of awareness to the user. Let the user

know if the Bot understood or didn’t understand the user’s response. Paraphrase and/or confirm if the Bot is uncertain about the user’s intent and before performing more involved (or irrevocable) actions like deleting something permanently.If the Bot needs to take time in performing time-intensive actions, don’t leave the user hanging.

Stamo Petkov Automate communication with MS Bot Framework

Page 24: Automate Comunication with MS Bot Framework

Nov 19, 2016

Best practices• Keep the user in control

o The user must not feel constrained or forced by the Bot’s script. Let the user tailor the Bot to suit their needs, for example, if the Bot sends updates on five categories of something but the user is only interested in two, let the user turn off updates for the other three.

o Let the user select from options in your script wherever appropriate.

• Be nice and do the right things including but not limited to:o Being respectful and considerate of everyone;o Respecting user privacy;o Not being be rude in conversations;o Striving for quality;o Operating with integrity.

Stamo Petkov Automate communication with MS Bot Framework

Page 25: Automate Comunication with MS Bot Framework

Nov 19, 2016

What’s nextBot intelligence

Page 26: Automate Comunication with MS Bot Framework

Nov 19, 2016

Bot Intelligence• Microsoft Cognitive Services lets you tap

into an ever-growing collection of powerful AI algorithms developed by experts in the fields ofo computer visiono speecho natural language processingo knowledge extraction o intelligent web search

• https://www.microsoft.com/cognitive-services

Stamo Petkov Automate communication with MS Bot Framework

Page 27: Automate Comunication with MS Bot Framework

Nov 19, 2016

Thanks to our Sponsors:General Sponsor:

Gold Sponsors:

Media Partners:

Technological Partners:

Hosting Partner: