botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Bot Builder Routing not changing, always trigering same intent action.

Open sajadhaja opened this issue 9 years ago • 6 comments

Bot Info

  • Bot handle:
  • App ID:
  • SDK Platform: Node.js
  • SDK Version: 3.9.0
  • Active Channels: Skype
  • Deployment Environment: Auzure Bot Service

Issue Description

Dialog is not changing from one intent to another intent Please find logs:-

[2017.09.20 12:44:22.419] [LOG] UniversalBot("") routing "hi" from "emulator" [2017.09.20 12:44:22.937] [LOG] Library("")recognize() recognized: input.welcome(1) [2017.09.20 12:44:22.943] [LOG] Session.beginDialog(/) [2017.09.20 12:44:23.199] [LOG] / - Session.sendBatch() sending 0 message(s) [2017.09.20 12:44:23.562] [LOG] / - IntentDialog.matches(input.welcome) [2017.09.20 12:44:23.563] [LOG] / - Session.beginDialog(input.welcome) [2017.09.20 12:44:23.564] [LOG] .input.welcome - waterfall() step 1 of 2 [2017.09.20 12:44:23.566] [LOG] .input.welcome - Session.send() [2017.09.20 12:44:23.816] [LOG] .input.welcome - Session.sendBatch() sending 1 message(s) [2017.09.20 12:44:24.883] [INFO] ChatConnector: message received. [2017.09.20 12:44:24.892] [LOG] UniversalBot("") routing "i am hungry" from "emulator" [2017.09.20 12:44:25.282] [LOG] Library("")recognize() recognized: enquiry.food(1) [2017.09.20 12:44:25.284] [LOG] Library("*").findRoutes() explanation: ActiveDialog(0.1) [2017.09.20 12:44:25.285] [LOG] .input.welcome - waterfall() step 1 of 2 [2017.09.20 12:44:25.286] [LOG] .input.welcome - Session.send() [2017.09.20 12:44:25.538] [LOG] .input.welcome - Session.sendBatch() sending 1 message(s)

Code Example

var intents = new botbuilder.IntentDialog({
 recognizers: [ apiairecognizer ],
 intentThreshold: 0.2,
 recognizeOrder: botbuilder.RecognizeOrder.series
});

intents.matches('enquiry.food', 'enquiry.food');
intents.matches('input.welcome', 'input.welcome');
      
this._bot.dialog('/', intents);
this._bot.recognizer(intents);

this._bot.dialog('enquiry.food', [
 function (session, args, next) {
   session.send('Thanks for enquiring food service, will inform ...');
 }
]);

this._bot.dialog('input.welcome', [
 function (session, args, next) {
   session.send('welcome to hotel');                
 },        
]);

Expected Behavior

From Skype :- Hi --------> Welcome to hotel (intent=> input.welcome) I am hungry ---------> Thanks for enquiring food service, will inform ... (intent=> enquiry.food)

Actual Results

From Skype :- Hi --------> Welcome to hotel (intent=> input.welcome) I am hungry ---------> Welcome to hotel (intent=> enquiry.food)

When i give request "I am hungry" it must route to function of "enquiry.food", but now it was always going to previous intent function "input.welcome". It seems that intent moving properly into enquiry.food

sajadhaja avatar Sep 20 '17 07:09 sajadhaja

When you type "I am hungry" first, does it still route to input.welcome?

stevengum avatar Sep 20 '17 18:09 stevengum

Hi Steve, Thanks for your reply. Yeah am always routing to input.welcome dialog. but intent was detected as enquiry.food when we type "I am hungry". I was observed that if the first intent was input.welcome in a conversation, then preceeding intents will always routing to that input.welcome.

sajadhaja avatar Sep 21 '17 04:09 sajadhaja

@sajadhaja, that's what I thought might be happening; if you end your dialogs then you shouldn't run into this problem.

If you don't explicitly end a dialog (via session.endDialog or session.endConversation) then your users will be stuck on that dialog. Try calling session.endDialog() and see if that fixes it.

stevengum avatar Sep 21 '17 05:09 stevengum

Thanks You so much Steve. It works me.

sajadhaja avatar Sep 21 '17 06:09 sajadhaja

No problem, I'm glad that fixed it.

stevengum avatar Sep 21 '17 06:09 stevengum

I am facing the similar issue. Tried ending the session using sess.endDialog(); , but still unable to fix the issue. Please help!

shruti-12 avatar Dec 13 '18 07:12 shruti-12