Dialogflow API V2 largeImage for MediaObject 不工作

Dialogflow API V2 largeImage for MediaObject not working

我最近从 V1 切换到 V2 的对话流,我正在更新我的 webhook。

我在我的代理中使用带有大图像的 mediaObjects 作为个人品味。 不幸的是,我似乎无法让它适用于 V2。 我当前的媒体对象代码是这样的:

 conv.ask(new MediaObject({
          name: 'Name',
          largeImage: new Image({
              url: 'https://[...].jpg',
              alt: 'alternative'
          }),
          url: 'https://[...].mp3',
          description: 'description'
}));

如您所见,我使用了 largeImage 字段,正如我在 Google's example 的 JSON 部分中找到的那样。由于文档不存在,我正在检查 node.js 库以获取信息,并验证了 largeImage 字段扩展了 Image 接口,因此它应该是正确的。

当我将 largeImage 切换为 Icon 时它可以工作,但我不喜欢它。

我的JSON回复是这样的:

"payload": {
    "google": {
      "expectUserResponse": true,
      "richResponse": {
        "items": [
          {
            "simpleResponse": {
              "textToSpeech": "text"
            }
          },
          {
            "mediaResponse": {
              "mediaType": "AUDIO",
              "mediaObjects": [
                {
                  "contentUrl": "https://[...].mp3",
                  "description": "description",
                  "name": "name"
                }
              ]
            }
          }
        ],
        "suggestions": [
          {
            "title": "Not yet implemented"
          }
        ]
      },
      "userStorage": "{\"data\":{}}"
    }
  }

出于某种原因,largeImage 字段没有出现在我的 JSON 中,但没有出现任何错误。

JSON 中的某些 API 与 Node.js 参数不匹配。例如JSON中的largeImage实际上是image in the MediaObjectOptions定义。