You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Task模块中Input.ChoiceSet联想搜索无法触发onInvokeActivity求助

Task模块中Input.ChoiceSet无法触发onInvokeActivity,返回504错误

在Teams的Task模块内使用Input.ChoiceSet组件时,选择选项后无法触发onInvokeActivity方法。该问题数月前已提交给微软团队,但尚未得到解决时间节点的回复。

以下是相关代码示例及错误信息,恳请有同类问题解决经验的开发者提供帮助:

自适应卡片示例代码

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.4",
  "body": [
    {
      "type": "Input.ChoiceSet",
      "id": "choiceInput",
      "choices": [
        {
          "title": "选项1",
          "value": "opt1"
        },
        {
          "title": "选项2",
          "value": "opt2"
        }
      ],
      "placeholder": "请选择"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "提交"
    }
  ]
}

onInvokeActivity方法代码

protected override async Task<InvokeResponse> OnInvokeActivityAsync(ITurnContext<IInvokeActivity> turnContext, CancellationToken cancellationToken)
{
    if (turnContext.Activity.Name == "task/submit")
    {
        var data = JsonConvert.DeserializeObject<JObject>(turnContext.Activity.Value.ToString());
        // 处理提交逻辑
        return new InvokeResponse
        {
            Status = 200,
            Body = new
            {
                task = new
                {
                    type = "message",
                    value = "提交成功"
                }
            }
        };
    }
    return await base.OnInvokeActivityAsync(turnContext, cancellationToken);
}

触发时的错误信息

当选择Input.ChoiceSet选项并提交时,网络请求返回以下错误:

{"statusCode":504,"message":"App is not installed"}

内容的提问来源于stack exchange,提问作者Yogendra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 16:36:20