Requirement
Recently, we had a requirement to build a chatbot for enterprise users, with features like creating a request in Service Now or determining the latest status of requests submitted in service now. In addition, the bot must act as a knowledge champion with respect to its department.
Overall, the objective was to produce an intelligent chatbot to interact with users to provide solutions based on their needs.
Solution
We have decided to utilize the Microsoft Bot Framework to build the chatbot. The solution consists of 3 components.
First, we use Azure Web App Bot; you can choose basic bot (C#) version 4. For development purpose, use the free app service plan (60 mins daily).
Refer this link to find out more on Azure Bots.
Second, Azure Cognitive Services for building LUIS and QnA Services. Luis service will determine the intent of the user through conversations, whereas QnA can be used for providing answers to user queries.
In our case, I would like to use a dispatch tool to handle multiple LUIS or QnA models. This will ensure our design is capable of handling queries from different areas (say we have one QnA for Technical, another one for functional or business units).
Third, we will have to develop Dialogs, which will handle the service now interactions. Let's say you want to report an incident to service now, in this case, end-user will be provided with a set of dialogs to capture the incident details.
Implementation
Implementation is quite simple as you can find examples in GITHUB,
Use below code to implement dispatch tool,
https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/14.nlp-with-dispatch
Use the below code to implement Dialogs,
https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/19.custom-dialogs
Let's say you have created a dialog class, with the following events to capture inputs
- Ask the user whether he/she wants to raise an incident
- Capture the incident details
- Confirm the incident details
- Create the incident and return the incident number
We can use prompt dialogs (Choice, Number, Datetime, etc.) to capture the incident details.
- public ServiceNowDialog(UserState userAccessor): base(nameof(ServiceNowDialog)) {
- _userAccessor = userAccessor.CreateProperty < User > ("User");
- var waterfallSteps = new WaterfallStep[] {
- TicketCreationOptionsAsync,
- TicketInputSiteAsync,
- TicketInputShortDescriptionAsync,
- ConfirmStepAsync,
- SummaryStepAsync
- };
- AddDialog(new WaterfallDialog(nameof(WaterfallDialog), waterfallSteps));
- AddDialog(new TextPrompt(nameof(TextPrompt)));
- AddDialog(new NumberPrompt < int > (nameof(NumberPrompt < int > )));
- AddDialog(new ChoicePrompt(nameof(ChoicePrompt)));
- AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
- InitialDialogId = nameof(WaterfallDialog);
- }

Join the conversation! Your thoughts help the community grow.