天蓝色:将机器人与LUIS连接

时间:2019-01-14 07:41:10

标签: azure luis

我在eu.luis.ai上的 MS Azure LUIS Bot 中创建了一个Web应用程序机器人。 现在,我从Azure下载了机器人,并填写了appsettings.json。到目前为止,它可以正常工作,我可以使用 BotFramework模拟器与之通信。

现在,我想改用 LUIS Bot ,据我了解,我必须为此修改.bot文件。它包含6个自动生成的服务:(我删除了ID,密码和其他一些私人信息)

"services": [
    {
      "tenantId": "",
      "subscriptionId": "",
      "resourceGroup": "",
      "serviceName": "HenryEDP",
      "type": "abs",
      "name": "HenryEDP",
      "id": "1"
    },
    {
      "connectionString": "",
      "tenantId": "",
      "subscriptionId": "",
      "resourceGroup": "",
      "serviceName": "henryedpbc32",
      "type": "blob",
      "id": "2"
    },
    {
        "appId": "",
        "appPassword": "",
        "endpoint": "http://localhost:3978/api/messages",
        "type": "endpoint",
        "name": "development",
        "id": "3"
    },
    {
      "appId": "",
      "appPassword": "",
      "endpoint": "http://localhost:3980/api/messages",
      "type": "endpoint",
      "name": "production",
      "id": "4"
    },
    {
        "instrumentationKey": "",
        "applicationId": "",
        "apiKeys": {},
        "tenantId": "",
        "subscriptionId": "",
        "resourceGroup": "",
        "serviceName": "HenryEDP2a7jx7",
        "type": "appInsights",
        "id": "5"
    },
    {
      "appId": "",
      "authoringKey": "",
      "version": "0.1",
      "region": "westeurope",
      "type": "luis",
      "name": "BasicBotLuisApplication",
      "id": "6"
    }
  ]

现在我想(找不到合适的文档),我必须编辑最后一个。我用LUIS Bot的信息替换了appID和appPassword,使它看起来与此类似(我更改了一些匿名性),该区域与我的机器人相同。

{
  "appId": "9845d1ff-5d83-41fe-f1d7-963c45e27b36",
  "authoringKey": "36360b0264589c24a0bc50a7f4fc7bb5",
  "version": "0.1",
  "region": "westeurope",
  "type": "luis",
  "name": "BasicBotLuisApplication",
  "id": "6"
}

现在,当我尝试运行机器人时,会在

处获得异常
try
{
    botConfig = BotConfiguration.Load(botFilePath, secretKey);
}
catch
{
    var msg = @"Error reading bot file. Please ensure you have valid botFilePath and botFileSecret set for your environment.
- You can find the botFilePath and botFileSecret in the Azure App Service application settings.
- If you are running this bot locally, consider adding a appsettings.json file with botFilePath and botFileSecret.
- See https://aka.ms/about-bot-file to learn more about .bot file its use and bot configuration.
";
    throw new InvalidOperationException(msg);
}

我在做什么错了?

0 个答案:

没有答案