Book Image

Building Bots with Microsoft Bot Framework

By : Kishore Gaddam
Book Image

Building Bots with Microsoft Bot Framework

By: Kishore Gaddam

Overview of this book

Bots help users to use the language as a UI and interact with the applications from any platform. This book teaches you how to develop real-world bots using Microsoft Bot Framework. The book starts with setting up the Microsoft Bot Framework development environment and emulator, and moves on to building the first bot using Connector and Builder SDK. Explore how to register, connect, test, and publish your bot to the Slack, Skype, and Facebook Messenger platforms. Throughout this book, you will build different types of bots from simple to complex, such as a weather bot, a natural speech and intent processing bot, an Interactive Voice Response (IVR) bot for a bank, a facial expression recognition bot, and more from scratch. These bots were designed and developed to teach you concepts such as text detection, implementing LUIS dialogs, Cortana Intelligence Services, third-party authentication, Rich Text format, Bot State Service, and microServices so you can practice working with the standard development tools such as Visual Studio, Bot Emulator, and Azure.
Table of Contents (10 chapters)

Bot state service

The key to good bot design is to do the following:

  • Make the web service stateless so that it can be scaled
  • Make it track the context of a conversation

Since all bots have these requirements, the Bot Framework has a service for storing bot state. This lets your bot track things such as what was the last question I asked them?

In our case, we want to save the contextId of the LUIS to exchange the missed information to the LUIS app from our bot.

To do that, first we need to create BotStateClient.

Creating a state client

The default state client is stored in a central service. For some channel IDs, you may want to use a state API hosted in the channel itself (for example, with the emulator channel) so that the state can be stored in a compliant store...