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

How to use Luis Recognizer inside a waterfall on raw string?

Open suvamsh opened this issue 9 years ago • 6 comments

bot.dialog('/activate_service', [
    function (session,args,next) {
        .
        ..
        ...
        session.beginDialog('/foo');
    }
]);

bot.dialog('/foo', [
    function (session) {
        builder.Prompts.text(session, "What do you want to do?");
    },
    function (session, results) {
        //I would like to use Luis Recognizer on results.response to determine what the users wants.
       //I have a raw string here, I don't want to begin a new dialog or anything.
    }
    ]);

In the above example I am trying to use Luis to understand a users response.

suvamsh avatar Dec 29 '16 00:12 suvamsh

Can you call the LuisRecognizer code through the IIntentRecognizer interface?

https://github.com/Microsoft/BotBuilder/blob/eb29aa87ab90fc5215a36d1ca0232bf4be62a6e4/Node/core/src/dialogs/LuisRecognizer.ts#L42

willportnoy avatar Dec 29 '16 18:12 willportnoy

I saw that method but I'm not too sure how to use it. Could you point me toward some example code?

suvamsh avatar Dec 29 '16 19:12 suvamsh

Yep you should be able to manually using LuisRecognizer.recognize if you want to do it manually.

maxpert avatar Dec 29 '16 19:12 maxpert

I was able to get this to work. Thanks for your help!

suvamsh avatar Dec 30 '16 00:12 suvamsh

How to do same in c#

alokraj68 avatar Mar 17 '17 07:03 alokraj68

@alokraj68 you should open top level threads for new-ish issues, otherwise they won't be seen. You can just use the ILuisService implementation (called LuisService) directly.

willportnoy avatar Mar 20 '17 15:03 willportnoy