【问题标题】:Asking for Confirmation overriding previous responses in Google Actions要求确认覆盖 Google Actions 中的先前响应
【发布时间】:2020-01-01 08:28:59
【问题描述】:

问题

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

  • 首先,Action 说:“嗨,希望你今天过得愉快”
  • 然后,Action 要求确认,“你想要今天的天气预报吗?”

但在模拟器中,我听到的只是第二个问题。我的目标是仅限语音的情况,所以我真的需要所有的回应。有趣的是,我可以在模拟器的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】:

    这是有意的行为,因为使用像 Confirmation 这样的意图之一将是唯一的响应,而其他响应将被忽略。

    有两种可能的方法来解决这个问题。

    1. 将您的所有回复合并到确认中
    2. 创建您自己的“是/否”意图,并对所有内容使用简单的响应。

    【讨论】:

    • 我现在使用列表,因为列表可以配置字符串化键
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-08
    • 2015-10-27
    • 2017-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-27
    相关资源
    最近更新 更多