Nov 102017
 

 

 

 

 

You can say that the bot framework can be classified in to the following concepts.

keyconcepts

 

Connector: The bot framework is basically a REST full API that is used to communicate between the Bot and the channel. Now here the channel could be anything like skype, slack kik etc. Basically the connector library is used to perform an interaction between the Bot and the user.

Activity: The means to facilitate communication between the bot and the user is called activity. This is used by the connector. Now an Activity is an object which could be a message or any other type.

Dialog: Dialog in bot framework is used to model a conversation and conversation flow. You can have a dialog within a dialog to model a meaning full conversation. The main purpose of having a nested is model like is because of the re usability. The Dialog in the Dialog Context is maintained in dialog stack that are in a conversation.

FormFlow: Sometime the input from a user is more complex than just a message in those cases a form flow is used. For example if you want to take multiple input from the user like customer review or some general information regarding a complex question. The formflow can automatically generate dialog to maintain a guided conversation.

State: As obvious by its name the state is associated with a user. The bot frame maintain the state of the user that is communication with the bot at any given time, If the user leaves you can always reload the state of the user and see where he left and continue the conversation from there.

 Posted by at 4:29 am
Nov 062017
 

Whenever i talk Bot i always think of those Sifi movies where you can have those super complex and intelligent digital beings. When I heard that the bot framework is out I wanted to try it and it wasn’t that easy to learn and develop. I know I am a bit late in this blog so the words might be new but the technology is not that recent. So lets start coding then.

So first off you need to follow this post to set up the environment and the template for the bot. So when you create a new bot project you will given some template files on which you can work directly and that is what we are going to do as well. I will directly use those templates and change them to more meaningful and understandable code.

If you see the template generate files you will observe that the code is divided into two main parts, Controller and Dialog. The Controller will send the message that will come from the user via the bot interface and it will send it to the dialog. The dialog will process the message and will reply accordingly. We can have multiple dialogs you can consider them as routes in a website.

How will we work

MessageController: No change here so we will use the same file as the template generate it.

RootDialog: Here we will instrust the dialog to get user profile information. Do remember that this class needs to be serializable.

EnsureProfileDialog: This dialog will get the user profile from the user. You can also notice that this class is serializable

UserProfile: This serializable datastrcuture will hold the actual profile information

This is how the bot will look like

bot hello world

 Posted by at 10:35 am