Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This blog has been produced by Jamie Dalton UK Technical Evangelist
AI and Bots are hot right now, everyone wants one as they realise the business value of reaching their customers via the various conversational channels (Skype, Facebook Messenger, Kik, Office 365 mail etc..) that they are already using they to serve their needs.
This article isn’t going to go into depth about the different types of bots that you can develop and whether you should be building a truly intelligent bot (the answer is yes btw) this post is geared around building out simple low friction “chit-chat” bots – such bots take a turn-by-turn approach with the user
Yo Pizza Bot
A typical example is the pizza ordering systems the process is as follows
These conversations follow a linear path and thus easy to develop. However, even though these paths are relatively simple, what happens if the user changes their mind to a previously answered question, wants to go back to the beginning or terminate the conversation half-way through.
Bots and Logic?
The logic begins to get more complicated. If you then have branches within your questions you’d then need to handle those various different dialogs.
Microsoft Bot Framework
The MS Bot Framework makes this very simple by offering up “FormFlow”
So what is FormFlow
FormFlow essentially allows you to define a class with properties and the framework automatically generates the conversation and handles the state management of it as the user answers each question. If the user changes their mind to any previous answers, the framework allows the user to navigate back in the conversation and change their response. The keywords it can understand during any conversation are:
One great thing about FormFlow is that it supports JSON schemas, this makes it exceptionally easy to build out simple chit-chat bots that could be used for any scenarios such as Questionnaires/Customer Surveys/Polls/Frequently asked questions (FAQ).
You also add some insights and feedback into the app for example you can add telemetry to record the total number of responses to a specific question. To save the telemetry is simple with Application Insights, snippet below:
// Wang in your own telemetry here, responses is key/value pairs
TelemetryClient telemetry = new TelemetryClient();
telemetry.TrackEvent("BotSample", responses);
You can then use Application Insights Analytics to view your telemetry:
customEvents
| extend p1 = customDimensions.p1
| order by timestamp
Key success and telemetry
Being Agile and success you don’t want to spend large amounts of development effort second guessing your customer usage. Here, you are best to iterate something fast then using telemetry track insights such as:
I’ve now created a new “BotSample” which uses FormFlow and a JSON template similar to the Brexit Bot), which will allow you to quickly spin-up and deploy a bot using Application Insights for telemetry, rather than me discuss anymore on what this bot does, it’s best you try it out for yourselves to get a feel for it. This sample uses the latest v3.0 of the framework released on 7/7/2016.
Give the bot a try
Simply open the following URL https://bit.ly/29sjzKj which links to the BOT hosted on Azure.
Source code
The complete code is available on github, speak to the bot and it will serve you a direct link to the repo
Please sign in to use this experience.
Sign in