无法将示例bot框架项目连接到luis API

时间:2017-10-09 13:56:50

标签: c# botframework luis

到目前为止我做了什么:

  1. here
  2. 创建了一个示例Microsoft Bot Framework项目
  3. 创建了示例LIUS应用程序,包含一些意图,实体和话语。
  4. 还通过端点网址在浏览器中测试了应用程序,这似乎工作正常
  5. 问题:

    我遇到了多个问题,也许他们对专家来说是微不足道的,但我似乎无法让他们得到解决

    1. luis仪表板中的“每个时段的端点命中数”部分在执行上述步骤3时未显示任何命中。 (但我仍然确定我的Sample Bot Framework应用程序正在点击网址,我通过实时线鲨追踪验证了它。)为什么不更新?
    2. 模拟器显示此错误。从哪里出现这个错误,应用程序崩溃了?:

      “异常:响应状态代码不表示成功:400(错误请求)。 ['text / plain'类型的文件]“

    3. 我无法深入了解项目有关来自luis的响应,我在哪里可以编写调试行来查看请求和响应?

    4. 这是我的代码:

      [LuisModel("b5439fa6-5be1-4680-bc46-379698e780ed", "045c3ef0bfc14040b7b35079ea030a98", domain: "westus.api.cognitive.microsoft.com")]
      [Serializable]
      public class RootDialog : LuisDialog<object>
      {
          public RootDialog()
          {
          }
          public RootDialog(ILuisService service)
              : base(service)
          {
          }
      
          [LuisIntent("")]
          public async Task None(IDialogContext context, LuisResult result)
          {
              <some code written here>
          }
      
          [LuisIntent("FAQs.Data.Coverage")]
          public async Task Coverage(IDialogContext context, LuisResult result)
          {
              <some code written here>
          }
      
          [LuisIntent("FAQs.Data.Info")]
          public async Task Info(IDialogContext context, LuisResult result)
          {
              <some code written here>
          }
      
          [LuisIntent("FAQs.Data.Package")]
          public async Task Package(IDialogContext context, LuisResult result)
          {
              <some code written here>
          }
      
          [LuisIntent("FAQs.Data.PhoneSupport")]
          public async Task PhoneSupport(IDialogContext context, LuisResult result)
          {
              <some code written here>
          }
      }
      

2 个答案:

答案 0 :(得分:2)

我直接点击您的终端并收到以下消息:

  

Model not published. Please publish your model before hitting the endpoint.

要发布,您将访问应用程序的“发布应用程序”页面,您还可以在其中选择要与端点一起使用的密钥。您可以在documentation的此页面找到有关发布的更多信息。

在您完成此操作之前,请转到您的LUIS帐户设置(点击退出旁边右上角的姓名)并重新生成您的Programmatic API密钥。这样,没有人能够使用您在问题中提供的密钥。

答案 1 :(得分:0)

在暂存环境中发布应用并在网址中设置属性staging = false时,您会遇到此问题

相关问题