0
votes

Over the holiday weekend, I've been trying to get a bot working using the Microsoft Bot Framework. I'm using version 3.9.1 of the botbuilder package for Node.js.

I've created an app and model at www.luis.ai. I have been able to successfully test my intents via the "Train & Test" feature. Then, in my actual Node code, I have the following:

let connector = new BotBuilder.ChatConnector({ 
  appId: 'myId', 
  appPassword: 'myAppSecret'
});

let bot = new BotBuilder.UniversalBot(connector);
let luis = new BotBuilder.LuisRecognizer('myLuisAppUrl');

let intent = new BotBuilder.IntentDialog({ });
intent.recognizer(luis);                

intent.matches('Intent.1', '/execute-report');
intent.matches('Intent.2', '/execute-batch-job');
intent.onDefault('/unknown');

bot.dialog('/', intent);

bot.dialog('/execute-report', [function(session, args, next) {
  var result = ((Date.now() % 2) === 0) ? 'Report Ran!' : 'Failed';                        
  session.send(result);
}]);

bot.dialog('/execute-batch-job', [function(session, args, next) {
  var result = ((Date.now() % 2) === 0) ? 'Batch Job Ran!' : 'Unable to run Batch Job';
  session.send(result);
}]);

bot.dialog('/unknown', [function(session, args, next) {
  session.send('What did you ask for?');
}]);

When interacting with my bot, I always get "What did you ask for?". In other words, at this point, I know that:

  1. I can successfully interact with my bot. However, the /unknown dialog is always being called, which is not the correct interaction.
  2. My model in LUIS looks correct:

    a. If I enter "Run Report" in the LUIS.ai Test app, the top scoring intent is "Intent.1"

    b. If I enter "Execute Batch Job" in the LUIS.ai Test app, the top scoring intent is "Intent.2"

However, my bot is not sending the appropriate response. The /execute-report and /execute-batch-job dialogs are never used, even though they should be. I don't understand what I'm doing wrong. To me, I believe I've setup my bot correctly. I don't see what I'm doing wrong. Can someone please tell me what I'm doing wrong? Is there a way to see the response returned from LUIS in my Node code similar to what's seen in the "Test" app at LUIS.ai

1

1 Answers

0
votes

If you go to line 89 of the LuisRecognizer and add the following on a new line: console.log(result); you will see the LUIS response object that your bot has received.

Your code looks correct to me, so the issue might be on the LUIS side. Have you published your app?