Skip to content

Latest commit

 

History

History
115 lines (99 loc) · 4.66 KB

12.README.md

File metadata and controls

115 lines (99 loc) · 4.66 KB

This sample shows how to integrate LUIS to a bot with ASP.Net Core 2.

To try this sample

  • Clone the samples repository ​bash git clone https://github.com/Microsoft/botbuilder-samples.git ​

Prerequisites

Provision the LUIS Service

Before the sample can be used, the LUIS service must be provisioned. Choose one of the following approaches to provision your bot.

Provision through MsBot Clone

For further information, see the MsBot Clone overview.

Provision through CLI tools

For further information, see the ludown/luis and msbot command line tools.

Provision through Azure Portal

Fo further information, see the LUIS documentation.

Create the Bot Configuration

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"
}

Building the sample

Visual Studio

  • Navigate to the samples folder (botbuilder-samples/samples/csharp_dotnetcore/12.nlp-with-luis) and open LuisBot.csproj in Visual Studio
  • Hit F5

Visual Studio Code

  • 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'.

Testing the bot using Bot Framework Emulator

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.

Connect to bot using Bot Framework Emulator

  • 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.

Further reading