寻求确认以取代Google Actions中的先前回复

问题描述 投票:0回答:1

问题

我有一个Google Actions SDK项目,我正在使用nodejs client library来实现目标。我在尝试使用Confirmation Helper意图时遇到了一些问题。它覆盖了之前的所有响应。让我给您一个简化的例子:

  • [首先,动作说,“ 嗨,希望您过得愉快
  • 然后,动作要求输入确认,“ 您要今天的天气报告吗?

但是在模拟器中,我只听到第二个问题。我针对的是“仅语音”情况,因此我确实需要所有回复。有趣的是,我可以在模拟器的AUDIO标签中看到所有响应。我怎么能听到这两个短语?


我正在复制/粘贴响应JSON,如RESPONSE选项卡中所示。

{
  "expectUserResponse": true,
  "expectedInputs": [
    {
      "possibleIntents": [
        {
          "intent": "actions.intent.CONFIRMATION",
          "inputValueData": {
            "@type": "type.googleapis.com/google.actions.v2.ConfirmationValueSpec",
            "dialogSpec": {
              "requestConfirmationText": "Do you want today's weather report?"
            }
          }
        }
      ],
      "inputPrompt": {
        "richInitialPrompt": {
          "items": [
            {
              "simpleResponse": {
                "textToSpeech": "Hope you are doing well!"
              }
            }
          ]
        }
      }
    }
  ],
  "conversationToken": ""
}

我该如何解决这种情况。谢谢!

actions-on-google google-assistant-sdk
1个回答
0
投票

这是故意行为,因为使用诸如“确认”之类的意图之一是唯一的响应,而其他响应将被忽略。

有两种潜在的解决方法。

  1. 将您的所有答复都包含在确认中
  2. 创建自己的是/否意图,并对所有内容使用简单的响应。
© www.soinside.com 2019 - 2024. All rights reserved.