代码之家  ›  专栏  ›  技术社区  ›  Oyen

'东南亚'不是有效的LUIS端点。'

  •  0
  • Oyen  · 技术社区  · 6 年前

    我正在尝试用sdk4构建一个LUIS机器人(在.netframework中,而不是在.netcore中),但是我无法通过添加我的LUIS服务。

    System.ArgumentException:““东南亚”不是有效的LUIS “终结点。”

    var app = new LuisApplication(luis.AppId, luis.SubscriptionKey, luis.Region);
    

    我遵循了.bot设置指南: https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/12.nlp-with-luis

    我的端点是: https://southeastasia.api.cognitive.microsoft.com/luis/v2.0/apps/ {LuisAppID}?订阅密钥={LuisSubscriptionKey}&时区偏移=-360&问=

    这在我的.bot文件中:

    {
          "type": "luis",
          "name": "LuisBot", 
          "id": "",
          "appId": "{LuisAppID}",
          "subscriptionKey": "{LuisSubscriptionKey}",
          "version": "0.1",
          "region": "southeastasia"
        },
    

    如果我为LuisApplication()使用空构造函数,然后设置app.Endpoint=“southeastasia”,那么之后就没有错误了。接受端点参数的LuisApplication构造函数是否有问题?

    1 回复  |  直到 6 年前
        1
  •  1
  •   JJ_Wailes    6 年前

    V4有一些变量改变了名称。在代码片段中,您有:

    var app = new LuisApplication(luis.AppId, luis.SubscriptionKey, luis.Region);
    

    新的变量名和声明LuisApplication的方式是:

    var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint())
    
    推荐文章