要求确认覆盖 Google 操作中的先前响应
Asking for Confirmation overriding previous responses in Google Actions
问题
我有一个 Google Actions SDK 项目,我正在使用 nodejs client library 来构建实现。我在尝试使用 Confirmation
Helper 意图时遇到了一些问题。它覆盖了之前给出的先前响应。让我给你一个问题的简化示例:
- 首先,Action 说,“嗨,祝你今天过得愉快”
- 然后,Action 要求确认,“你想要今天的天气预报吗?”
但是在模拟器中,我听到的只是第二个问题。我的目标是只有语音的情况,所以我真的需要所有的回复。有趣的是,我可以在模拟器的 AUDIO
选项卡中看到所有响应。我怎样才能听到这两个短语?
我是 copy/pasting 回复 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": ""
}
我该如何解决这种情况。谢谢!
这是有意的行为,因为使用诸如确认之类的意图之一将是唯一的响应,其他响应将被忽略。
有两种潜在的方法可以解决这个问题。
- 将您的所有回复合并到确认中
- 创建您自己的 Yes/No 意图并对所有内容使用简单的响应。
问题
我有一个 Google Actions SDK 项目,我正在使用 nodejs client library 来构建实现。我在尝试使用 Confirmation
Helper 意图时遇到了一些问题。它覆盖了之前给出的先前响应。让我给你一个问题的简化示例:
- 首先,Action 说,“嗨,祝你今天过得愉快”
- 然后,Action 要求确认,“你想要今天的天气预报吗?”
但是在模拟器中,我听到的只是第二个问题。我的目标是只有语音的情况,所以我真的需要所有的回复。有趣的是,我可以在模拟器的 AUDIO
选项卡中看到所有响应。我怎样才能听到这两个短语?
我是 copy/pasting 回复 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": ""
}
我该如何解决这种情况。谢谢!
这是有意的行为,因为使用诸如确认之类的意图之一将是唯一的响应,其他响应将被忽略。
有两种潜在的方法可以解决这个问题。
- 将您的所有回复合并到确认中
- 创建您自己的 Yes/No 意图并对所有内容使用简单的响应。