This sample shows how to integrate LUIS to a bot with ASP.Net Core 2.
- Clone the samples repository
bash git clone https://github.com/Microsoft/botbuilder-samples.git
Before the sample can be used, the LUIS service must be provisioned. Choose one of the following approaches to provision your bot.
For further information, see the MsBot Clone overview.
For further information, see the ludown/luis and msbot command line tools.
Fo further information, see the LUIS documentation.
The .bot file contains information, including the endpoint, app ID, and password, and references to services that are used by the bot.
The .bot file is generated automatically if the MsBot Clone process was used to provision. Other provisioning methods require manually creating and saving the file within your project.
The bot configuration file must be deployed with your bot.
{
"name": "yourBotName",
"description": "",
"services": [
{
"type": "abs",
"id": "3",
"name": "<yourBotName>",
"tenantId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"subscriptionId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"resourceGroup": "yourBotName",
"serviceName": "yourBotName",
"appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
},
{
"type": "endpoint",
"id": "1",
"name": "development",
"appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
"appPassword": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpoint": "http://localhost:3978/api/messages"
},
{
"type": "endpoint",
"id": "2",
"name": "production",
"appId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
"appPassword": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpoint": "ie, https://<yourBotName>.azurewebsites.net/api/messages"
},
{
"type": "appInsights",
"tenantId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"subscriptionId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"resourceGroup": "<yourBotName">,
"name": "<yourBotName_Decorated>",
"serviceName": "<yourBotName_Decorated>",
"instrumentationKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"applicationId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"apiKeys": {},
"id": "4"
},
{
"type": "blob",
"id": "5",
"name": "nlp67a74p",
"name": "<yourBotName_Decorated>",
"tenantId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"subscriptionId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"resourceGroup": "<yourBotName">,
"connectionString": "xxxxxxxxxxxxxxxx",
"container": "ie, botstatestore"
}
],
"padlock": "xxxxxxxxxxxxxxxxxxxxxxx",
"version": "2.0"
}
- Navigate to the samples folder (
botbuilder-samples/samples/csharp_dotnetcore/12.nlp-with-luis
) and openLuisBot.csproj
in Visual Studio - Hit F5
- Open
botbuilder-samples/samples/csharp_dotnetcore/12.nlp-with-luis
sample folder - Bring up a terminal, navigate to
botbuilder-samples/samples/csharp_dotnetcore/12.nlp-with-luis
folder. - 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 the Bot Framework Emulator
- File -> Open bot and navigate to
botbuilder-samples/samples/csharp_dotnetcore/12.nlp-with-luis
folder - Select .bot file that was either generated or created.