This sample shows how to integrate QnA Maker in a simple bot with ASP.Net Core 2.
The QnA Maker Service enables you to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes.
In this sample, we demonstrate how to use the QnA Maker service to answer questions based on a FAQ text file as input.
- Clone the samples repository
git clone https://github.com/Microsoft/botbuilder-samples.git
- [Optional] Update the
appsettings.json
file underbotbuilder-samples/samples/csharp_dotnetcore/11.qnamaker
with your botFileSecret. For Azure Bot Service bots, you can find the botFileSecret under application settings.
- Follow instructions here to create a QnA Maker service.
- Follow instructions here to import the sample.qna to your newly created QnA Maker service.
- Update BotConfiguration.bot with your kbid (KnowledgeBase Id) and endpointKey in the "qna" services section. You can find this information under "Settings" tab for your QnA Maker Knowledge Base at QnAMaker.ai
- (Optional) Follow instructions here to set up the QnA Maker CLI to deploy the model.
- Navigate to the samples folder (
botbuilder-samples/samples/csharp_dotnetcore/11.qnamaker
) and open QnABot.csproj in Visual Studio . - Hit F5
- Open
botbuilder-samples/samples/csharp_dotnetcore/11.qnamaker
sample folder. - Bring up a terminal, navigate to
botbuilder-samples/samples/csharp_dotnetcore/11.qnamaker
folder. - Type 'dotnet run'.
- In Visual Studio right click on the solution and select "Restore NuGet Packages".
Note: this sample requires
Microsoft.Bot.Builder
,Microsoft.Bot.Builder.AI.QnA
andMicrosoft.Bot.Builder.Integration.AspNet.Core
.
Microsoft 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 Bot Framework Emulator from here.
- Launch the Bot Framework Emulator
- File -> Open bot and navigate to
botbuilder-samples/samples/csharp_dotnetcore/11.qnamaker
folder. - Select the BotConfiguration.bot file.