This bot relies on the LUIS.ai cognitive service to function. This document will show how to use simple command line tools to setup LUIS for use with this bot.
To successfully setup and configure the services this bot depends on, you need to install the MSBOT, LUIS, and Ludown CLI tools. See the documentation for the Bot Framework CLI Tools for additional information on what CLI tools are available to help you build your bot.
Ensure you have Node.js version 8.5 or higher
npm i -g msbot luis-apis ludown
We highly recommend you can keep track of all the services your bot depends on in a .bot file. You can use either the msbot
CLI tool or use Bot Framework Emulator to manage your .bot file. This project was created with a bot file named basic-bot.bot
You can use MSBOT to create and configure the required services for this bot. To do this, simply run the following command from a terminal. You can get your LUIS authoring key by following steps here and get your Azure subscription ID by following steps here.
> cd samples/javascript_nodejs/13.basic-bot
> msbot clone services -n <YOUR BOT NAME> -f deploymentScripts/msbotClone --luisAuthoringKey <LUIS-KEY> --subscriptionId <AZURE-SUBSCRIPTION-ID>
The LUIS application created for this bot is described in a markdown based .lu file(s) here. To update your published LUIS application with any changes made to the .lu files, run the following commands.
> cd samples/javascript_nodejs/13.basic-bot
- To parse the .lu files to a LUIS model:
> ludown parse toluis --in dialogs/greeting/resources/main.lu -o cognitiveModels/ --out basicBot.luis -n 'basic-bot-LUIS' -d 'Basic bot Bot Builder V4 sample.' --verbose
- To create a new LUIS application using the LUIS model generated in step 1 and update the .bot file with the LUIS service configuration:
You can obtain your LUIS authoring key by following instructions here LUIS authoring regions are listed [here][10]. They can be one of westus | westeurope | australiaeast.
> luis import application --in cognitiveModels/basicBot.luis --authoringKey <YOUR-LUIS-AUTHORING-KEY> --msbot --endpointRegion --region <LUIS-AUTHORING-REGION> | msbot connect luis --stdin
- To train the LUIS application,
> msbot get basic-bot-LUIS | luis train version --wait --stdin
- To publish the LUIS application,
> msbot get basic-bot-LUIS | luis publish version --stdin
See Bot Builder tools to learn more about the Bot Builder CLI tools.