Microsoft Bot Framework Tutorial & Azure Bot Service Intro | Create a Chatbot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys what's going on and welcome to another cloud path tutorial today we're going to be talking about some very cool technology this is a technology that will allow you to create intelligent chat BOTS and utilize them across various channels such as slack Skype and Facebook Messenger yes that's right I'm talking about the Microsoft bot framework so if that sounds good stick around and let's get our feet wet by creating a simple chat bot and seeing what this thing is all about [Music] alright so Before we jump into coding let's go over some basic terminology and take a look at the bots ecosystem from a high-level first of all we have the Microsoft bot framework the bot framework is a collection of SDKs that we can use to build and develop BOTS SDKs are available for nodejs javascript and also c-sharp SDKs for Java and Python are also currently under development next we have the bot framework emulator this gives us an easy way to visualize our bot interact with it and debug it so the emulator is actually a program that we can download onto our computers run point to a specific bot that's under local development and spin it up as if it were you know embedded in any of the channels such as slack or Skype or anything like that so this is a great tool that we can use for local testing before we deploy our bot to Azure now in addition to the SDK and the emulator there are several different command-line interface tools that allow us to interact with different libraries to augment our BOTS with additional intelligence and more advanced capabilities now one of the most interesting of these is the Loess or language understanding intelligence service and as we can see on their website this service is described as a machine learning based service to build natural language into app spots and Internet of Things devices quickly create enterprise-ready custom models that continuously improve so in the context of using Luas with a bot the basic idea is that Luis will sort of parse or evaluate the user input and judge it based on possible intents so it will return back to our code a list of possible intense with each intent being scored as more likely or less likely now with Louis the evaluation of the users input is actually decoupled from the logic that dictates how to handle the results Louis hands its results back to our application which then decides what to do with the results or how to respond back to the user this model provides a lot of freedom and flexibility to developers who are working on the app who may have other factors to consider such as the specific context in which the app and its users are operating and finally we have the is your bot service so the bot service is just kind of the overarching BOTS infrastructure in which everything operates so once we develop our bot locally we can upload it to Azure and at that point the bot service is what enables us to connect to deploy and manage our BOTS all in one central location alright guys so in this tutorial we're going to build a simple Ecco bot that just basically outputs an echo of the user input to the console we'll do this using the SDK version 4 which is the latest SDK as of today's date once our BOTS created we'll start it up and take it for a test drive using the bot emulator there are a few things we'll need to get installed in our development environment first so without further ado let's get started alright so the first requirement here is to have no js' installed on our system so if you already have it that's great you can just disregard this step if not let's just go ahead and Google nodejs alright and we can go directly to the download page and depending on which operating system you're using you want to choose the correct installer or binaries I'm using Windows so I'm gonna click on the windows installer that's going to download to my system and what sets downloaded I'm gonna run the installer alright and there it is so I'm through the motions here and get this installed it's gonna install the latest version of node and NPM so I'll be all up to date here and I'll just pause the video and come back once this is complete all right so my note install is now complete the next thing I'm going to want to do is install Windows build tools alright which is needed to compile certain native packages now this is only applicable if you're using a Windows system if you're on a Mac or Linux or other you can just disregard this step so what I'm going to do is click on the windows icon here actually I'm just going to type in PowerShell okay and I'm gonna right click and run as an administrator okay now there's an install command here from NPM and I'll add this to the description of the video so you guys can just copy and paste it but this is what it looks like so I'm gonna go ahead and run that and this will just take a few seconds to install so all again stop the video here all right so the the windows build tools install is complete I did run into one issue where I had an existing version of Python that caused a conflict apparently with this script so I had to go in and uninstall Python and then run this again and now I do see one other sort of warning message here saying could not install Visual Studio studio build tools and I'm assuming this because I may have them already installed with my Visual Studio setup so I really don't want to go and uninstall that again so I think I'm just gonna move forward from this point and hopefully everything is where it needs to be so hopefully you guys don't run into the same issue but let's go ahead and proceed to the next step all right so I'm going to close this I close my note j/s and I'm just gonna open a command prompt here and let's make this a little bit bigger so you guys can see better there we go okay so the first thing we want to do here is create a folder for our bots all right so I'm gonna switch over to see and I'm gonna create a new folder I'm just gonna call it BOTS alright and then I'm gonna switch into that folder okay so the next thing we want to do is install yeoman and the generator bot builder okay so again this this command will be in the description of the video let's go ahead and get that installed then when this is done we'll actually be able to use generator bot builder to scaffold a bot nodejs project alright so I'm just going to pause the video until this is complete alright so install is complete and now we can actually go ahead and create our test bot so all we have to do is come down here and type in yo bot builder yo bot builder hit enter and this will go ahead and create our bot nodejs app alright so we're presented with a little dialogue here similar to what you'd see when you do a 10:00 p.m. in it so let's go ahead and give this guy a name I'm gonna say bot demo or let's just say demo bot okay we can just skip through this one yeah I'm gonna leave JavaScript selected and we've got a couple of choices here in terms of what kind of template we want to use so let's try echo bot it's the first choice here and let's say yes alright so now it's created the basic folder structure for our bot app and it's going to go ahead and run npm install and install all of our dependencies so i'm just going to pause the video again and come back in a second one this is done alright and once this script is finished running you should see a message like this saying your new bot is ready so let's tell you what let's go over to our code editor and just take a look at what's been generated so I'm here in Visual Studio and here's that BOTS folder that I created earlier now the script has created demo bot folder which is essentially my bot nodejs application all right so this looks familiar you know if you've ever worked with node.js before we've got our node modules we've got our package JSON and our entry point into the application which in this case is our index J s so if we just pop this open we can see that the code is really well documented you can kind of just read through this and see what's going on here I'll point out a few things so we're using Resta Phi here which is similar to Express if you've ever used that sort of a REST API framework all right we're pulling in various various objects from the bot core okay the core library which the bot uses for all of its interactions and we're pulling in a bot configuration file here okay and what else we're just basically spinning up a server nodejs server you've seen this kind of code before and just sort of setting things up and initializing our application so the next kind of interesting thing to look at is going to be in bot j/s and this is where sort of the shape of our bot interaction or conversation is defined so if you look down here we can see something called on turn and turn context so this idea of a turn this concept of a turn you can kind of think of a normal human conversation you know I ask you a question you give me an answer you ask me a question I give you an answer I say something you say something we're sort of taking turns speaking in this conversation and this translates to bought to user communication as well since this is a you know that our communication is asynchronous in nature okay I can say something and the bot will respond and we're taking turns right so only one sort of communication can happen at a time because of the asynchronous nature and we can see we can read a little bit more about this if we look at the documentation here how abouts work and just make this a little bit bigger here so as you can see here it says every interaction between the user and the bot generates an activity okay so an activity can be something generated by the service such as a channel join or a bot join or it can be a bot - user interactions such as a message okay hi you say hi and notice that these are all HTTP posts so that's the mode of interaction between the bot and the user we're using rest here and if we go back to the code here now this will kind of make a little bit more sense so if turn context activity that type so we're saying if the activity is of type message then send activity and in this case it's just a very simple bot it's just echoing whatever the user enters then the bot will echo back you said and turn context activity text all right so let's see what this looks like in action what we can do now is go ahead and download and install the bot emulator and then point it to our new bot and take it for a little test drive so let's go back to the browser I'm just going to google bot emulator and let's see looking for the installer here and I'll add a link an exact link here so you guys don't have to search through here like me this looks like it right here for Windows and you know they got Linux and Mac as well so I'm gonna download this installer alright and once that's done downloading I'm gonna go ahead and pop it open here alright so the emulator is installed and it opened up right away for me so before I can actually open my bot I need to start it up so let's go back to our command line and let's do node indexed yes you're not find bots ah okay I need to go into my demo bot first okay let's try that again there we go alright so one starts up we can go back to the emulator and that looks like it's is that running yep looked like okay so this is what I'm looking for right here rest if I listening on blah blah blah port three nine seven eight so let's go back to our emulator and let's click on open bot so we can do one of two things here we can navigate to the dot bot file in our project root or we can copy and paste this URL in here which is the default the default URL and path that our bot will be listening on so once you've done either one of those things go ahead and click on connect and here we go so our bot is up and running in the emulator this central area right here is just like the the message panel where you you know interact with this thing and over here there's kind of a log where you can see that HTTP requests back and forth so let's test this out I'm going to type in hello and our bot responds with you said hello so this is just you know a very simple echo hey you said hey tomato you said tomato yeah it doesn't know the song all right we're gonna have to add some more intelligence to this thing alright so there you have it there is your basic chat bot and as you can see we've just really scratched the surface of what's possible with with the bot framework and you know we haven't even added any intelligence or any you know third-party libraries or I should say any uh you know additional libraries or functionality this is just the basic bare-bones chat bot so I think in future videos we'll look at you know how to deploy our chat bots to Azure how to integrate with Luis and maybe some other libraries and how to really make this thing more interactive and more intelligent alright guys so thanks for joining this video and if you guys like this or my other content please consider subscribing that the cloud path channel would love to have you and I will see you guys very soon in the next video take care now [Music] [Music] you
Info
Channel: Block Explorer
Views: 94,367
Rating: undefined out of 5
Keywords: microsoft bot framework, microsoft bot framework tutorial, azure bot service, azure bot service tutorial, bot framework, bot framework tutorial, microsoft azure bot service, microsoft azure tutorial, create a chatbot, chatbot tutorial, nodejs chatbot, chat bot tutorial, nodejs chat bot, microsoft chat bot tutorial, chat bot framework
Id: 530FEFogfBQ
Channel Id: undefined
Length: 15min 46sec (946 seconds)
Published: Fri Apr 05 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.