I am having trouble with my MS.Bot.Framework + Luis + Azure
await Conversation.SendAsync(activity, () => { return Chain.From(() =>
new LUISDialog() as IDialog<object>); });
I have active Azure subscription, set up endpoint with subscription keys.
When running the MS Bot emulator I get error message "Sorry, my bot code is having trouble." Using breakpoint in debug mode, I have worked out that the "new LUISDialog" is not being triggered, it seems to skip over it.
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Builder.Luis;
using Microsoft.Bot.Builder.Luis.Models;
using System.Threading;
using George;
using Microsoft.Bot.Connector;
namespace Geoge.Dialog
{
[LuisModel("*****", "*****")]
[Serializable]
public class LUISDialog : LuisDialog<object>
{
[LuisIntent("Greeting")]
public async Task GreetingIntent(IDialogContext context,
IAwaitable<IMessageActivity> activity, LuisResult result)
{
string message = $"Hello there";
await context.PostAsync(message);
context.Wait(this.MessageReceived);
}
Can anyone help me with this? I have spend way to much time trying to debug and think I must be missing something simple.
What is strange is your initial code line:
await Conversation.SendAsync(activity, () => { return Chain.From(() => new LUISDialog() as IDialog<object>); });
If you want to use your LuisDialog
, you should not have this Chain
here but rather something like the following:
await Conversation.SendAsync(activity, () => new LUISDialog());
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments