I need assistance with integrating my Luis App into C# Bot Framework Bot
When I add Luis App to my C# Microsoft Bot Framework chatbot and run in the emulator I get an exception.
Exception: Response status code does not indicate success: 400 (Bad Request).
A debugging post from another developer on Github suggested adding domain, which I have to my LuisModel (see below). This did not resolve the issue.
[LuisModel("", "", domain: "australiaeast.api.cognitive.microsoft.com", Staging = true)]
Stepping through the code, my locals seem correct when it calls the new Dialog.RootLuisDialog() Here is a screen grab
Message Controller Code Snippet
public async Task<HttpResponseMessage> Post([FromBody] Activity activity)
{
// check if activity is of type message
if (activity.Type == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => new Dialogs.RootLuisDialog());
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
Luis Dialog Class
namespace HalChatBot.Dialogs
{
[LuisModel("<MyLuisAppID>", "<MyLuisKey>",
domain: "australiaeast.api.cognitive.microsoft.com", Staging = true)]
[Serializable]
public class RootLuisDialog : LuisDialog<object>
{
[LuisIntent("")]
[LuisIntent("None")]
public async Task None(IDialogContext context, LuisResult result)
{
await context.PostAsync("I am the Default intent");
context.Wait(MessageReceived);
}
[LuisIntent("Greeting")]
public async Task Greeting(IDialogContext context, LuisResult result)
{
await context.PostAsync("I am the Greeting intent");
context.Wait(MessageReceived);
}
}
}