自适应卡片显示不显示在 cortana 频道上,但在团队和模拟器上运行良好

The Adaptive card display is not displayed on the cortana channel but works well on teams and emulator

我创建了一个 QnA 机器人并将 cortana 与其集成。 我可以在 cortana 频道上看到英雄卡,但看不到自适应卡。 虽然我在我的代码中的回复变量中获得了附件,但卡片没有呈现。 另外,自适应卡的 speak 属性 似乎已被弃用。

下面是我得到的 json 响应作为调试信息

{
  "botId": "ValoremReplyCortanaBot",
  "botRequest": {
    "type": "message",
    "id": "ru2O3ASCqo",
    "timestamp": "2019-05-28T12:28:38.6194349Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "valoremreplycortanabot"
    },
    "locale": "en-US",
    "text": "guide",
    "entities": [
      {
        "type": "Intent",
        "name": "None",
        "entities": []
      },
      {
        "type": "AuthorizationToken",
        "token": "##",
        "status": 0
      },
      {
        "type": "UserInfo",
        "current_location": {
          "StartTime": "2019-05-28T12:28:38.0673147Z",
          "EndTime": null,
          "Hub": {
            "Id": null,
            "Type": "Other",
            "Name": null,
            "Latitude": 10.0126075744629,
            "Longitude": 76.3658599853516,
            "Address": null
          },
          "VenueName": null,
          "Away": false
        },
        "name": {
          "GivenName": "##",
          "FamilyName": "##"
        },
        "email": "##@outlook.com"
      },
      {
        "type": "DeviceInfo",
        "supportsDisplay": "true"
      }
    ],
    "channelData": {
      "skillId": "cc3ef598-4f4f-444f-bd20-87a211581607",
      "skillProductId": "188779dd-2894-4cb3-b93f-b99955039ead",
      "isDebug": true
    }
  },
  "botResponse": {
    "type": "message",
    "timestamp": "2019-05-28T12:28:51.306281Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "valoremreplycortanabot"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "locale": "en-US",
    "text": "",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "version": "1.0",
          "body": [
            {
              "type": "TextBlock",
              "size": "large",
              "weight": "bolder"
            },
            {
              "type": "Image",
              "size": "stretch",
              "url": "##",
              "width": "100px",
              "height": "100px"
            }
          ],
          "actions": [
            {
              "type": "Action.OpenUrl",
              "url": "##",
              "title": "Guide Poster",
              "speak": "Guide Poster"
            }
          ]
        }
      }
    ],
    "entities": [],
    "replyToId": "ru2O3ASCqo"
  }
}

Cortana 桌面中的 HTML 渲染器不如其他客户端宽容。检查 https://adaptivecards.io/explorer/TextBlock.html

确保每个元素都有其必填字段。

它可以像您的 TextBlock 没有文本一样简单 object... 添加 "text": ""

哦,speak 并没有被弃用。它是卡片级别的;对等 body。而且...默认情况下,Cortana 不会说出来。您需要从卡片中复制并添加到消息中https://github.com/microsoft/cortana-skills-samples/blob/master/Consumer/CSharp/V4Patches/07.using-adaptive-cards.diff