Reputation: 53
I am trying to find out an activity text into a LUIS dialog. I am using the LUIS intent handler:
[LuisIntent("")]
public async Task None(IDialogContext context, IAwaitable<IMessageActivity> result)
{
await context.PostAsync("I have no idea what you are talking about.");
context.Wait(MessageReceived);
}
but this throws an Exception:
File of type 'text/plain'
Can anyone suggest me why this happens? I also put a breakpoint but it isn't hit.
Upvotes: 2
Views: 127
Reputation: 7513
You're seeing that problem because of the intent handler signature. Notice the IAwaitable<IMessageActivity> result
. Re-writing like this will work:
[LuisIntent("")]
public async Task None(IDialogContext context, LuisResult result)
{
await context.PostAsync("I have no idea what you are talking about.");
context.Wait(MessageReceived);
}
Instead of an IAwaitable<IMessageActivity>
, you should use LuisResult
. Alternatively, LuisDialog
does target an intent handler overload with three parameters and this will work too:
[LuisIntent("")]
public async Task None(IDialogContext context, IAwaitable<IMessageActivity> activity, LuisResult result)
{
await context.PostAsync("I have no idea what you are talking about.");
context.Wait(MessageReceived);
}
Upvotes: 2