![](/img/trans.png)
[英]ASP.NET OpenIdConnectAuthenticationOptions - MVC Response status code does not indicate success: 400 (Bad Request)
[英]Bot Framework C# Luis Getting > Exception: Response status code does not indicate success: 400 (Bad Request)
我需要将Luis应用程序集成到C#Bot Framework Bot中的帮助
当我将Luis App添加到C#Microsoft Bot Framework聊天机器人并在模拟器中运行时,出现异常。
例外:响应状态代码未指示成功:400(错误请求)。
Github上另一位开发人员的调试文章建议添加域,我将其添加到LuisModel中(请参见下文)。 这不能解决问题。
[LuisModel(“”,“”,域:“ australiaeast.api.cognitive.microsoft.com”,登台= true)]
逐步执行代码,当我调用新的Dialog.RootLuisDialog()时,我的本地人似乎是正确的。
消息控制器代码段
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;
}
路易斯对话班
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);
}
}
}
[LuisModel("<MyLuisAppID>", "<MyLuisKey>", domain: "australiaeast.api.cognitive.microsoft.com")]
删除了暂存阶段[LuisModel("<MyLuisAppID>", "<MyLuisKey>", domain: "australiaeast.api.cognitive.microsoft.com")]
现在,Luis集成正在运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.