An introduction to Microsoft Bot Framework

TaswarBhattiMVP 3,416 views 17 slides Jun 13, 2017
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

Talk given in #Ottawa Meetup Group https://www.meetup.com/ottawaitcommunity/events/235920172/
Want to learn what bots and Microsoft Bot Framework can offer? The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are t...


Slide Content

Introduction to Bot Framework Taswar Bhatti @ taswarbhatti http://taswar.zeytinsoft.com

What is a Bot? In this context Microsoft Bot Framework, bots are computer assistants or think of it as just a web api (ASP.NET Web App) Bots appear in your favorite messaging app including Facebook Messenger and Skype You use bots for booking flights, hotels, ordering takeaway and much, much more Purchase Request Api to build commerce enabled bot

Not, not this Bot!

Bot Framework Overview The Microsoft Bot Framework consists of: Bot Builder SDK(.NET, Node.js, REST Api ) Bot Framework Emulator for Windows, Linux and Mac Bot Connector Developer Portal (http://dev.botframework.com) Bot Directory

High Level view of Bots

Bot Connector

Deep Vision of Bot

An Echo Bot Code [ BotAuthentication ] public class MessagesController : ApiController { public async Task< HttpResponseMessage > Post([ FromBody ]Activity activity) { if ( activity.Type == ActivityTypes.Message ) { ConnectorClient connector = new ConnectorClient (new Uri( activity.ServiceUrl )); // return our reply to the user Activity reply = activity.CreateReply ($"Echo { activity.Text }"); await connector.Conversations.ReplyToActivityAsync (reply); } else { HandleSystemMessage (activity); } var response = Request.CreateResponse ( HttpStatusCode.OK ); return response; } }

Bot Emulator The Bot Famework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost It is supported on Windows, Linux and Mac

Bot Emulator Screenshot

Demo Bot Framework

Bot Builder Dialog and Sessions Bot builder uses dialogs to manage a bot conversation between a user Session Objects are passed to the dialog handlers Session Objects are the primary mechnics between bots and users

Types of Dialogs Prompts – Text, Confirm, Number, Time, Choice, etc Waterfall dialogs – collection and use sequence of steps User Data – Store data of user, conversation (private data) Payload max is 32k Intent Dialog – listen to keywords or phrases using NLP ( e.g LUIS) Attachments and Cards – For Rich Objects (media or images)

Demo Search Image and Card Using cognitive vision api

Guideline for bots Don’t send a bot to do a webpages’s job Bots are just apps Don’t abuse Natural Language Processing Sometimes buttons do everything you need Its all a matter of User Experience

Resources Microsoft Bot Framework Resources ( http://aka.ms/botresources ) LUIS ( https://www.luis.ai ) Azure Trail ( https://azure.Microsoft.com/services/bot-services ) Books (Building Bots with Microsoft Bot Framework PACKT) Books (Programming the Microsoft Bot Framework MSPress) An introduction to Microsoft Bot Framework

Questions Questions?????