【问题标题】:Adaptive card with Luis intent具有 Luis 意图的自适应卡片
【发布时间】:2018-08-27 07:20:19
【问题描述】:

直到上个月,这种方法对我都很有效。但是现在我收到错误消息,表明我的机器人代码有问题。最近有没有什么变化。这是我的代码>

protected override Task<string> GetLuisQueryTextAsync(IDialogContext context, IMessageActivity message)
        {
            if (message.Value != null)
            {
                dynamic value = message.Value;
                // assuming your DataJson has a type property like :
                // DataJson = "{ \"Type\": \"Curse\" }" 
                string submitType = value.x.ToString();
                return Task.FromResult(submitType);

            }
            else
            {
                // no Adaptive Card value, let's call the base
                return base.GetLuisQueryTextAsync(context, message);
            }

        }

Datajson> "x":"介绍"

【问题讨论】:

    标签: adaptive-cards


    【解决方案1】:

    当你调试这个方法时,错误出现在哪一行? 该方法中有许多地方“可能”是潜在的问题。 “消息”是否为空? 您确定 message.Value 是格式正确的 json 字符串吗? 格式正确的 json 字符串是否包含“x”?

    让我们知道错误发生在方法中的哪个位置以及异常是什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-29
      • 2017-12-29
      • 2020-07-07
      • 2021-02-06
      • 2021-11-14
      • 2019-09-01
      相关资源
      最近更新 更多