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

Pre-process the intent before sending to LUIS

Open amolghanwat2020 opened this issue 9 years ago • 4 comments

I am using LUISDialog to communicate with luis and added business logic for each intent. During actual conversation, LuisDialog sends the utterance directly to luis and returns the result to my method. For a use case, I need to pre-process the utterance before the dialog sends it to LUIS. Is there a way to interrupt and add pre-processing logic?

Thanks for help.

amolghanwat2020 avatar Mar 03 '17 04:03 amolghanwat2020

Please take a look at SimpleEchoBot's Controller in BotBuilder SDK.

  • You need to inherit the IDialog and implement the interface.
 public class EchoDialog : IDialog<object>
    {
        public async Task StartAsync(IDialogContext context)
        {
            context.Wait(MessageReceivedAsync);
        }

        public async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
        {
            var message = await argument;
            string utterance = message.Text;
            //Call the Luis API Programatically
            context.Wait(MessageReceivedAsync);
        }
    }

SathishNeel avatar Mar 03 '17 11:03 SathishNeel

You might consider using a proxy ILuisService implementation, or a root dialog that modifies the message before calling IDialogStack.Forward to a child LuisDialog.

willportnoy avatar Mar 03 '17 17:03 willportnoy

@amolghanwat2020 Did the answer from @willportnoy work for you?

carlosscastro avatar Mar 09 '17 17:03 carlosscastro

Closing issue due to lack of response from user.

stevengum avatar May 02 '17 22:05 stevengum