Reputation: 875
Bot builder comes with LuisRecognizer and other inbuilt classes that does the work of posting the message and getting back the intents and entities.
like replaceDialog helps to start a new waterfall/closure, is there a way to use in built botbuilder classes to post to Luis and based on the match invoke the respective waterfall sequence?
I tried the following.
session.replaceDialog('/'). This does not seem to invoke the luis recognizer again and therefore dialog.matches are not even invoked.
bot.receive(message). this does not do the luis call nor match the intent for the message well. plus, it also seems to go into a wrong sequence ( parent sequence which invokes bot.receive ) again, by default.
IntentDialog.recognize and intentDialog.invokeAction. recognize fails to recognise the message.
What am I doing wrong? is there a way to reuse botbuilder classes? I can think of writing a simple rest client to invoke Luis api. but that is the last resort, as the purpose of botbuilder's recognizer and intentdialog classes are exactly the same.
Upvotes: 1
Views: 222
Reputation: 875
flag setting does the trick. Now the modeller gets invoked on every beginDialog.
dialog = new builder.IntentDialog({
recognizeMode : builder.RecognizeMode.onBegin,
});
Upvotes: 1