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

Multiple LUIS models requires input to be entered twice

Open baishali-ghosh opened this issue 10 years ago • 9 comments

I have been working on a bot with multiple luis models. I have used Node.js for this. So everytime I enter an utterance, I get the response as classified by LUIS as long as I am within the same intent's waterfall. But as soon as the waterfall ends, the next time I enter a query, I do not get a response but if I reenter the same query, I get a response.

For example:- I have two models A and B. Model A handles food requests, Model B handles clothing.

Me: Give me some food Bot: Continental / Italian/ Indian? Me: Italian Bot: Hungry for some pizza? Me: Sure! Bot: Sending it on your way. Me: I also need some new shoes. No response from bot Me: I also need some new shoes. Bot: What size do you wear?

Am I missing something when doing an intents.matches?

baishali-ghosh avatar Nov 01 '16 12:11 baishali-ghosh

I have the same issue in c# between luis root dialog and child prompt dialogs.

GhostAtom avatar Nov 02 '16 09:11 GhostAtom

You're using a single IntentDialog with two models right? If that's the case then it's most likely something to do with how you finish up the task. Can you show me one of your waterfalls? I'm curious what you do when you send "Sending it on your way."

Stevenic avatar Nov 02 '16 18:11 Stevenic

Yes, I'm using a single IntentDialog with two models. Here is a snippet for the waterfall.

intents.matches('SaveMoney', [
    var savings = builder.EntityRecognizer.findAllEntities(args.entities, 'builtin.number');
   var amount = session.dialogData.amount = {};
    function(session, args, next) {
        if (savings.length == 0) {
            builder.Prompts.text(session, 'How much money would you like to save?');
        } else {
            if (savings.length > 1) {
                    builder.Prompts.number(session, "Please enter a single amount. If you enter more than one amount, the first amount will be accepted");
            } else {
                amount.savings = savings[0].entity;
                next();
            }
        }
    },
  function(session, results)
    {
        var amount = session.dialogData.amount;
        var amountSaved = 0;
        if (results.response) {
            amountSaved = results.response;
            amount.savings = results.response;
        } else if (amount.savings) {
            amountSaved = amount.savings;
        }
        builder.Prompts.text(session, 'Good choice to save ' + amountSaved);
    }]);

baishali-ghosh avatar Nov 03 '16 07:11 baishali-ghosh

@Stevenic or @maxpert can you help?

chrimc62 avatar Nov 27 '16 00:11 chrimc62

Sorry for the delay... You're calling Prompts.text() in your last waterfall step which is going to wait for the user to respond. You should call session.endDialog() with your message instead.

Stevenic avatar Dec 12 '16 09:12 Stevenic

I'm having similar issue c#, user: text1 Bot: (One Intent identifies and returns buttons in HeroCard) Button1/Button2/Button3 User: (selects/enter other value instead of selecting/entering above buttons value) text2 Bot: (displaying) text2 (But text2 should be identified by LuisDialog intent) DisplayTraining.txt PFA async DisplayTraining method which accepts Buttons value. Based on button value it returns some values and again displays those in HeroCard. In above its going to else block where no items returns based on text2. In this else block we need to post text2 as new post which should be identified by LuisDialog intents instead of simply displaying text2 from bot.

Thanks in advance, Rasheed

RasheedSiriyala avatar Dec 22 '16 10:12 RasheedSiriyala

using below line helped me to re-dispatch the activity on the same LuisDialog, await MessageReceived(context, Awaitable.FromItem(context.Activity.AsMessageActivity()));

RasheedSiriyala avatar Dec 28 '16 05:12 RasheedSiriyala

Hey @baishali-ghosh I think the code snippet you pasted has syntax error. Also is it still happening?

maxpert avatar Dec 29 '16 19:12 maxpert

Closing this but feel free to comment.

Stevenic avatar Feb 23 '17 00:02 Stevenic