This sample demonstrates using Adaptive dialog, Language Generation features with LUIS and QnA Maker to demonstrate an end-to-end ToDo bot in action.
-
.NET Core SDK version 3.1
# determine dotnet version dotnet --version
-
Configure the necessary LUIS and QnA maker applications required to run this sample
-
Clone the repository
git clone https://github.com/Microsoft/botbuilder-samples.git
-
Run the bot from a terminal or from Visual Studio:
A) From a terminal, navigate to
samples/csharp_dotnetcore/adaptive-dialog/08.todo-bot-luis-qnamaker
# run the bot dotnet run
B) Or from Visual Studio
- Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to
samples/csharp_dotnetcore/adaptive-dialog/08.todo-bot-luis-qnamaker
folder - Select
ToDoBotWithLUISAndQnAMaker.csproj
file - Press
F5
to run the project
Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.
- Install the latest Bot Framework Emulator from here
- Launch Bot Framework Emulator
- File -> Open Bot
- Enter a Bot URL of
http://localhost:3978/api/messages
- Install nodejs version 10.14 or higher
- Install required CLI tools
> npm i -g @microsoft/botframework-cli
- In a command prompt, navigate to
samples/csharp_dotnetcore/adaptive-dialog/08.todo-bot-luis-qnamaker
- In order for interruption to work effectively, you need to generate LU models that are cross-trained.
- Cross training requires a definition of your dialog hierarchy. See Dialogs/DialogLuHierarchy.config.json as an example.
> cd Dialogs
> bf luis:cross-train --in . --out ../generated --config DialogLuHierarchy.config.json --force
- Get your LUIS authoring key
- To create, train and pubish LUIS applications for this bot
> bf luis:build --in ../generated --out ../generated --log --force --botName TodoBotWithLuisAndQnA --authoringKey <Your LUIS Authoring key>
- This command writes out a bunch of .dialog files (which are useful if you are using declarative form of adaptive dialogs) as well as luis.settings.<youralias>.<region>.json file.
- Add the application IDs for the created applications from luis.settings.<youralias>.<region>.json to appsettings.
- Note: You can just re-run
bf luis:build
command as you make changes to your .lu content. The command will smartly update only those applications that have changes. - Get your QnA Maker subscription key
- Run qnamaker:build to create/ update, train and publish QnA Maker KBs required to run this bot. The content for the KB comes from .qna files under dialogs.
> bf qnamaker:build --in ../generated --out ../generated --botName TodoBotWithLuisAndQnA --log --force --subscriptionKey <Your QnA subscription key>
- This command writes out a bunch of .dialog files (which are useful if you are using declarative form of adaptive dialogs) as well as qnamaker.settings.<youralias>.<region>.json file.
- Add the KB IDs for the created applications from qnamaker.settings.<youralias>.<region>.json to appsettings.json.
- Adaptive dialogs
- Language generation
- Adaptive Expressions
- .lu file format
- .lg file format
- .qna file format
- Bot Framework Documentation
- Bot Basics
- Activity processing
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- .NET Core CLI tools
- Azure CLI
- Azure Portal
- Language Understanding using LUIS
- Channels and Bot Connector Service