In May 2017 I did a talk in Ottawa .NET User Group on Introduction to Microsoft Bot Framework, it was a interesting turnout and lots of conversation on what a bot can do for a business and how to use them.
Below you will find the slides for my talk on Microsoft Bot Framework. The sample demo code can be find on github https://github.com/Microsoft/BotBuilder-Samples, where we demo searching of Real Estate, image search, etc.
Ottawa IT Meetup Community: https://www.meetup.com/ottawaitcommunity/events/235920172/
If you are interested in more on bot framework and like to see more articles on it, please let me know π
Transcript
1. Introduction to Bot Framework Taswar Bhatti @taswarbhatti http://taswar.zeytinsoft.com
2. 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
3. Not, not this Bot!
4. 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
5. High Level view of Bots
6. Bot Connector
7. Deep Vision of Bot
8. An Echo Bot Code β’ [BotAuthentication] β’ public class MessagesController : ApiController{ β’ public async Task 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; β’ } β’ }
9. 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
10. Bot Emulator Screenshot
11. Demo Bot Framework
12. 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
13. 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)
14. Demo Search Image and Card β’ Using cognitive vision api
15. 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
16. 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
17. Questions β’ Questions?????