Search code examples
actions-on-googlegoogle-assistant-sdk

Asking for Confirmation overriding previous responses in Google Actions


The Problem

I have a Google Actions SDK project and I am using the nodejs client library for building fulfillment. I am facing some problem trying to use the Confirmation Helper intent. It is overriding previous responses given before it. Let me give you a simplified example of the problem:

  • First, Action says, "Hi, hope you are having a great day"
  • Then, Action asks for a Confirmation, "Do you want today's weather report?"

But in the simulator, all I hear is the second question. I am targeting a Voice Only situation, so I really need all the responses. Interestingly, I can see all the responses in the AUDIO tab of simulator. How can I hear both of these phrases?


I am copy/pasting the response JSON as shown in the RESPONSE tab.

{
  "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": ""
}

How can I fix this situation. Thanks!


Solution

  • This is intentional behavior as using one of the intents like Confirmation will be the only response, and other responses will be ignored.

    There are two potential ways to get around this.

    1. Combine all of your responses to be in the Confirmation
    2. Create your own Yes/No intent and use simple responses for everything.