- Node.js version 10.14 or higher
- If you don't have a LUIS Account, create a free LUIS Account
- If you don't have a QnA Maker Account, create a free QnA Maker Account
- Visual Studio Code as a recommended development environment
-
Download or clone the repository
git clone https://github.com/hinojosachapel/coreplus.git
- Select Import new app.
- Click Choose App file (JSON format)...
- Import
CoreplusLUIS.json
file located in thecognitiveModels
folder of the project. This file contains six intents: Greeting, ChitchatCancel, ChitchatHelp, ChitchatJoke, ChitchatProfanity and None.
- After creating the QnA Maker service, create a knowledge base using the
CoreplusKB.tsv
file located in thecognitiveModels
folder of the project. Use this .tsv file to populate your KB. Then add the chit-chat files (CoreplusPC.tsv
andqna_chitchat_friendly.tsv
) using the Add file link located in theSettings
tab. Train and publish your model, and obtain the values to connect your bot to the knowledge base.
-
Create the appsettings.json file in the
javascript_nodejs/src
folder with the missing values for your bot app, LUIS and QnA Maker services. You will need Cosmos DB keys only when deploying to Azure.{ "microsoftAppId": "<YOUR_APP_ID>", "microsoftAppPassword": "<YOUR_APP_PASSWORD>", "appInsights": { "instrumentationKey": "" }, "LUIS-en-US": { "appId": "<YOUR_APP_ID>", "authoringKey": "<YOUR_AUTHORING_KEY>", "subscriptionKey": "<YOUR_AUTHORING_KEY>", "endpoint": "https://your-region.api.cognitive.microsoft.com" }, "QNA-en-US": { "kbId": "<YOUR_KNOWLEDGE_BASE_ID>", "subscriptionKey": "<YOUR_SUBSCRIPTION_KEY>", "endpointKey": "<YOUR_ENDPOINT_KEY>", "hostname": "https://your-qnamaker-app-name.azurewebsites.net/qnamaker" }, "cosmosDb": { "cosmosDbEndpoint": "https://your-cosmosdb-account-name.documents.azure.com:443/", "authKey": "<YOUR_AUTHORING_KEY>", "databaseId": "<YOUR_DATABASE_ID>", "containerId": "<YOUR_COLLECTION_ID>" }, "publicResourcesUrl": "http://localhost:3978", "allowPublicFolder": "true" }
-
Navigate to the
javascript_nodejs
folder and run the following npm commands to install modules and start the bot:npm install npm start
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 version 4.5.0 or greater from here
- Launch Bot Framework Emulator
- File -> Open Bot
- Enter a Bot URL of
http://localhost:3978/api/messages
, <YOUR_APP_ID> and <YOUR_APP_PASSWORD>.