Pre-process the intent before sending to LUIS
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.
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);
}
}
You might consider using a proxy ILuisService implementation, or a root dialog that modifies the message before calling IDialogStack.Forward to a child LuisDialog.
@amolghanwat2020 Did the answer from @willportnoy work for you?
Closing issue due to lack of response from user.