question

newuser-45292da8-69e1-4ad3-91d1-c5aab4716d2b avatar image

Answering "No" to Intent Confirmation

A bit confused about a brief note I found within some documentation for the dialog directive. Namely, when the user is prompted to confirm an intent and the user answers no: "The dialog is considered complete since all information was gathered. Since the dialogStateis COMPLETED, the skill can no longer return the Dialog.Delegate directive."

I don't understand the motivation behind this. What I'm trying to do in my current skill is return to the beginning of slot collection if the user answers no upon intent confirmation (I understand that this is not the optimal experience, but it seems that this should at least be possible for intents with 1 or 2 slots). With this limitation, it appears that I would have to exit the skill in order for the user to redo slot collection.

I suppose my question comes in 2 parts.

  1. What is the motivation behind this design decision?
  2. Are there any workarounds to allow a user to re-enter slot collection after the dialogState is completed?
intentsslotsdialog model
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

AaronG avatar image
AaronG answered

Hi,

The reason that the dialog will be considered completed if the user answers "no" for an intent confirmation is that Alexa doesn't know how to proceed from there to correct the information. For example, a particular slot value may be wrong (and Alexa won't know which), or perhaps the user wants to cancel the entire intent. In some cases you might want to restart the entire dialog, but in others you might want to ask the user which of the slots they want to change, etc. It's very dependent on your skill's use cases.

There is a workaround for this, however. While returning the Dialog.Delegate directive, your skill can update the existing slot values and/or confirmation status using the updatedIntent field documented here. In this way, even if the dialog is considered completed, if your skill sees that the intentConfirmation was "DENIED", you can cause the dialog to resume by changing the slots and returning the Dialog.Delegate directive.

For example, if you want to effectively start over with the dialog, you can clear out all slot values and set their confirmationStatus to NONE:

intent.confirmationStatus = "NONE";
Object.keys(intent.slots).forEach(
    (slotName) => {
        var slot = intent.slots[slotName];
        delete slot.value;
        slot.confirmationStatus = "NONE";
    }
);

var delegatedirective = {"type": "Dialog.Delegate",
                         "updatedIntent": intent}

You have more options than the above. If your slots require individual confirmation to proceed, you can just set their confirmationStatus to 'NONE' and Alexa will re-ask for confirmation of each slot value, allowing the user the chance to reject the value they previously gave and they'll be reprompted for a new one. Plus, you can always decide for your skill to take direct control of the dialog, as described here.

Please note that when using the Dialog.Delegate directive, Alexa will end the dialog if the intent confirmation is denied twice, so in general your users get one retry through the dialog within a given session. To work around this limitation, you can take full control of the dialog, in which case you can keep the dialog going for as long as you need. We're looking at ways of improving that part of the experience.

4 comments
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It's been awhile since this answer was posted, but I'm running into the same issue and using the mentioned work-around results in the same error

"Directive \"Dialog.Delegate\" can be used only when a dialog is active and hasn't been completed"

Below is my code ... I'm also confused by motivation behind this behavior, it doesn't seem like confirming an intent should be an option if a "no" response cannot be handled ... maybe I'm misunderstanding completely

if (request.intent.confirmationStatus === "DENIED")
        request.intent.confirmationStatus === "NONE";
        Object.keys(slots).forEach(slotName => {
          const slot = slots[slotName];
          delete slot.value;
          slot.confirmation = "NONE";
        }
        const speechText = "Ok, let's try again";
        return handlerInput.responseBuilder
          .speak(speechText)
          .addDirective({
            type: "Dialog.Delegate",
            updatedIntent: request.intent
          })
          .getResponse();

Am I missing something here?

0 Likes 0 ·
newuser-ed0cc813-7670-48a0-bb65-c112eaef8734 avatar image newuser-ed0cc813-7670-48a0-bb65-c112eaef8734 newuser-ed0cc813-7670-48a0-bb65-c112eaef8734 ·

I realized I was running this only when the dialog state was completed, needed to run this when it was still in progress

0 Likes 0 ·

I followed as mentioned above. But it is giving the same error.


"Directive \"Dialog.Delegate\" can be used only when a dialog is active and hasn't been completed"

0 Likes 0 ·
Amazon_Bernardo Bezerra avatar image Amazon_Bernardo Bezerra ♦♦ newuser-85335a04-675d-413b-832f-0b684771eb0d ·

Hello and thank you for your message.

As mentioned in the error message you are receiving, the Dialog.Delegate directive can only be used when there is a dialog delegation strategy (can be set up in the developer portal) and the dialog hasn't completed yet.

To check the second point, you can have an if loop that looks like the following:

"...
if (request.dialogState && request.dialogState !== 'COMPLETED') {
    // DO SOMETHING
   return handlerInput.responseBuilder
       .addDelegateDirective(request.intent) // this will make the skill return to the same intent
       .getResponse();
}
..." 

Regards,
Barry

0 Likes 0 ·
Brian@Amazon avatar image
Brian@Amazon answered

Looking into this.

10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Armand avatar image
Armand answered

Hi all,

I would like to reopen this case as I am experiencing a problem. Basically, I am testing a dialog intent when the user denies the intent confirmation. Some info

- I have set the Dialog Delegation Strategy as 'disable auto delegation'.

- When the user denies the confirmation intent. I receive the dialogeState as 'IN_PROGRESS' and the intent.confirmationStatus as 'DENIED'.

- I clear the intent as indicated in the best answer and restart the process:

intent.confirmationStatus = "NONE";
Object.keys(intent.slots).forEach(
    (slotName) => {
        var slot = intent.slots[slotName];
        delete slot.value;
        slot.confirmationStatus = "NONE";
    }
);
 
var delegatedirective = {"type": "Dialog.Delegate",
                         "updatedIntent": intent}

- The skill correctly asks the fist slot query but it returns again the intent.confirmationStatus as 'DENIED' (even when the confirmationStatus has been changed to 'NONE'). Therefore, the skill enters a loop.

Any idea how to overcome this?

Thanks

7 comments
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @Armand and thanks for your question.

Please provide your skill ID so I can look further into this.

Regards,
Barry

0 Likes 0 ·
Armand avatar image Armand Amazon_Bernardo Bezerra ♦♦ ·

Thanks @barry@amazon. Here it is my skill id

amzn1.ask.skill.3a0dc9b8-9564-4e34-9acc-879b52d1b253

I have several dialog but all of them show the same problem when dealing with a denied confirmation.

0 Likes 0 ·

Thank you for your skill ID, @Armand.

However, it is not clear to me how to reproduce the issue. Can you please provide a script that will cause the skill to behave on the way you described originaly?

Regards,
Barry

0 Likes 0 ·
Show more comments