This sample shows how to integrate LUIS to a bot with ASP.Net Web API and Application Insights.
- Clone the repository
git clone https://github.com/Microsoft/botbuilder-dotnet.git-
Navigate to LUIS portal.
-
Click the
Sign inbutton. -
Click on
My Apps. -
Click on the
Import new appbutton. -
Click on the
Choose Fileand select LUIS-Reminders.json from theBotBuilder-Samples\samples\csharp_webapi\12.NLP-With-LUIS\CognitiveModelsfolder. -
Update nlp-with-luis.bot file with your AppId, SubscriptionKey, Region and Version. You can find this information under "Publish" tab for your LUIS application at LUIS portal. For example, for https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/XXXXXXXXXXXXX?subscription-key=YYYYYYYYYYYY&verbose=true&timezoneOffset=0&q=
- The
AppIDcan be found in "Application Information" - The
SubscriptionKeycan be found in "Keys and Endpoints", under theKey 1column - The
regioncan be found in "Keys and Endpoints", under theRegioncolumn - The Version is listed on the page.
- The
-
Update nlp-with-luis.bot file with your Authoring Key. You can find this under your user settings at luis.ai. Click on your name in the upper right hand corner of the portal, and click on the "Settings" menu option. NOTE: Once you publish your app on LUIS portal for the first time, it takes some time for the endpoint to become available, about 5 minutes of wait should be sufficient.
- (Optional) Install the LUDown here to help describe language understanding components for your bot.
- Follow instructions here to set up your Application Insights service.
- Note: The Application Insights will automatically update the appsettings.json file.
- Navigate to the samples folder (
BotBuilder-Samples\samples\csharp_webapi\12.NLP-With-LUIS) and openLuisBot.csprojin Visual studio - Run the project (press
F5key).
- Open
BotBuilder-Samples\samples\csharp_webapi\12.NLP-With-LUISsample folder - Bring up a terminal, navigate to
BotBuilder-Samples\samples\csharp_webapi\12.NLP-With-LUISfolder. - Type
dotnet run.
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 Bot Framework Emulator
- File -> Open bot and navigate to
BotBuilder-Samples\samples\csharp_webapi\12.NLP-With-LUISfolder - Select
nlp-with-luis.botfile