Share via


What is Microsoft Bot Framework Overview

botGetting started with the Microsoft Bot Framework

 

The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.

 

The Microsoft Bot Framework (preview) : framework enables organizations to build intelligent agents, known as Bots.

Bots let users interact with intelligent solutions as though they are conversing with another person, and interactions can take many forms, from text/SMS to Office365 mail to Skype and Slack. The Framework provides developers with a developer portal and SDK to build Bots, a Bot Connector service to connect to social channels such as Twitter and Slack, and a Bot Directory to discover and use existing bots.

Bots (or conversation agents) are rapidly becoming an integral part of your digital experience 

human-vs-robot-13

 

Bots  are as vital a way for users to interact with a service or application as is a web site or a mobile experience. Developers writing bots all face the same problems: bots require basic I/O; they must have language and dialog skills; and they must connect to users

The Bot Framework provides tools to easily solve these problems and more for developers e.g., automatic translation to more than 30 languages, user and conversation state management, debugging tools, an embeddable web chat control and a way for users to discover, try, and add bots to the conversation experiences they love.

The Bot Framework has a number of components including the Bot Connector, Bot Builder SDK, and the Bot Directory.

 

Bot Connector

The Bot Connector lets you connect your bot(s) seamlessly to text/sms, Office 365 mail, Skype, Slack, and other services. Simply register your bot, configure desired channels and publish in the Bot Directory.

connector

Getting Started – Its all in web API

 

Bot Builder SDK

The Bot Builder SDK is an open source SDK hosted on GitHub that provides everything you need to build great dialogs within your Node.js- or C#-based bot.

 

 image

 

Simple Dialog Model

The concept of a dialogue is simple the set of questions and results which the user is asked and provided. (the Conversation with the USER)

image

 

 

Getting Started

Key things you need to consider for the API is Scale, so you have a state per session and a state per user.

The Dialog starts by a conversation

    1: public async Task<Message> Post ([FromBody]Message message)
    2: { 
    3:     if (message.Type =="Message")
    4:     {
    5:     //return a reply to the user
    6:     return await Conversation.SendAsync (message, () => new Echo.Dialog ());
    7:     }
    8:     else
    9:     {
   10:         return HandleSystemMessage (message);

 

The Web Api then calls Dialogues – This is a simple example of a Dialog

    1: [Serializable]
    2: public class EchoDialog : IDialog
    3: {
    4:     private int count =1;
    5:     public async Task StartAsync (IDialogContext context)
    6:     {
    7:     context.Wait(MessageRecievedAsync);
    8:     }
    9:  
   10:     public async Task MessageRecievedAsync(IDialogContext context, IAwaitable<Message> argument)
   11:     {
   12:         var message = await argument;
   13:         if (message.Text="Enter your command here")
   14:     {
   15:         PromptDialog.Confirm(
   16:         context,
   17:         AfterResetAsync,
   18:         "Message you want here",
   19:         "response for failure");
   20:         }
   21:         else
   22:         {
   23:         await context.PostAsync(string.Format("{0}:You Said{1}", this.count++, message.Text));
   24:         context.Wait(MessageReceivedAsync);
   25:         }
   26: }

 

 

You can also add some cool freatures like Microsoft LUIS

 

Adding Cortana Cognitive Services such as LUIS (See my previous post on LUIS)

    1: [LuisModel]("Enter your Key", "Enter your Subscription ID")]
    2: [Serializable]
    3: public class SimpleAlarmDialog : LUISDialog
    4: {
    5:    [LuisIntent ("builtin.intent.alarm.find_alarm")]
    6: public async Task FindAlarm(IDialogContext context, LUISResult result)
    7: {
    8:     Alarm alarm;
    9:     if (tryFindAlarm(result, out alarm))
   10:     {
   11:         await context.PostAsync($"found alarm{alarm}");
   12:     }
   13:     else
   14:     {
   15:         await context.PostAsync("did not find alarm");
   16:     }
   17:     context.Wait(MessageReceived);
   18: }    

 

Using FormFlow

 

So as an Example of a Simple sandwich order system

 

User is prompted the following the questions

 

  1. Select your Sandwich filling?
  2. Select your Sandwich length?
  3. Select your bread type?
  4. Would you like Cheese?
  5. Select your Sandwich Topping?
  6. Select your Sauce Option?

 

Example code

 

image

 

 

Resources

Get started with the Bot Connector.

Microsoft Bot Samples: https://github.com/Microsoft/BotBuilder

Get started developing your first bot bot: https://dev.botframework.com/

Documentation: https://docs.botframework.com/sdkreference/

Getting the latest version of Skype for Bot Support – https://www.skype.com/go/getskype-full
Bot Framework Directory https://dev.botframework.com see the Bot Directory tab

Bot FAQ https://docs.botframework.com/faq/#navtitle

 

Examples

Caption Bot https://www.captionbot.ai

Project Murphy Demo - https://www.projectmurphy.net/

Project Murphy why? https://www.projectmurphy.net/story

Comments

  • Anonymous
    April 17, 2016
    Useful post! thanks for sharing.
  • Anonymous
    May 03, 2016
    So since the launch of the BOT Framework just over a month ago - more than 20,000 developers have signed up and started developing BOTS. So many developers have contributed to enhancement suggestions and code contributions being made by the community to the Bot Framework open source Bot Builder SDKs available on GitHub. https://github.com/Microsoft/BotBuilderHere are few updates 3rd May 2016 • The Bot Directory, the public directory of bots registered with Bot Framework, is now open to developers for bot submission and review. The Bot Directory itself isn’t live yet, but when it is available, users will be able to discover, try, and add bots to their favorite conversation experiences.• Beginning today, those favorite conversation experiences can include Facebook Messenger. With the addition of Facebook Messenger as a supported channel, now your text, image, card, and button capable bots can reach more people across an even broader variety of the world’s top conversation experiences – from Skype, to Slack to Text/SMS, Office 365 mail and more. Get those submissions going, and if you have any feedback, we’d love to hear it. https://feedback.botframework.com/
  • Anonymous
    November 04, 2016
    Can we write the bot code in a language other than Node JS or .Net ?
    • Anonymous
      November 28, 2016
      Yes, As long as you maintain the rest api specific protocol
  • Anonymous
    November 28, 2016
    Hi The following link is the best resources for Bot Framework and its regularly updated with the latest resources https://blogs.msdn.microsoft.com/smich/2016/09/30/microsoft-bot-framework-resources/
  • Anonymous
    December 29, 2016
    I've been a .NET developer for some years now, and I've seen one or two (or more) SDK's in my life. In the past two hours or so I've sipped through the Bot Framework docs, and for the life of me, I couldn't figure out what this framework is all about. What benefit do I get from it? The only thing I could find is that I can build a single bot that will talk through multiple channels. Is that it? Is that what this whole framework does?I'm in the process of building a Skype for Business internal company bot, to provide some info to company employees. Is this framework something I should consider?
  • Anonymous
    January 02, 2017
    hi how we can store chat bot data into our custom storage.?? I am using node js.thanks!
  • Anonymous
    February 24, 2017
    Some training resources for BOT development https://github.com/Azure/bot-education
  • Anonymous
    June 06, 2017
    BOT Connector and Channels - Are there any fees involved in using these connectors / channels as part of BOT Framework Developer portal? and If there are no fees, can we use them in our productive applications? The reason for asking the question, we have created a bot which is ready for deployment, but we are not sure whether to depend on BOT Connectors / Channels available in Developer portal for productive deployment. Hence, the question. If we cannot depend on the connectors available in developer portal, are there any alternate options?
  • Anonymous
    October 18, 2017
    The comment has been removed