I have to connect Luis to node.js and create my first chatbot that, as a first stage should handle simple requests.
I have checked the following links : https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-recognize-intent-luis
https://github.com/Microsoft/BotBuilder-Samples/tree/master/Node/intelligence-LUIS
but getting started has proven to be difficult, what I've done as a first stage is:
var restify = require('restify');
var builder = require('botbuilder');
var http = require('http');
var recognizer = require ('recognizer');
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
appId: MY_APP_ID,
appPassword:MY_PASSWORD
});
var bot = new builder.UniversalBot(connector, function (session,args) {
}
});
var recognizer = new builder.LuisRecognizer(LUIS_ENDPOINT_URL);
bot.recognizer(recognizer);
and not sure how to move forward from here.
What I have in a Luis intent
is: calendar.add
what I have as entities
is: calendar.location
and calendar.subject
what I want the user to say in the bot framework channel emulator:
add a business meeting schedule in Paris.
What the bot should say: Understood the location is Paris and subject is business meeting.
It seems that the utterance add a business meeting schedule in Paris.
doesn't match the Calendar.Add
intent. So you can try to manually add this utterance in the intent in your LUIS application.
Intents
list, click Calendar.Add
into the edit page. add a business meeting schedule in Paris.
in the box, type enter add the utterance into the list. business
and meeting
letters into a big square brackets, select Calendar.Subject
in dropdown list, the same click Paris
and select Calendar.Location
. Finishing the actions, it should looks like: Save
to save the edition. Then Train and publish your LUIS application. Then your bot should match the utterance.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.