question

Jerome E. Garcia avatar image
Jerome E. Garcia asked

In a ASK SDK 2, how to handle a dialog intent with a slot with values limited by the value of another slot

A great IncompleteIntentRequest class was provided by barry@amazon that just sends the Delegate directive for all requests where DialogState is not complete.

https://forums.developer.amazon.com/questions/174300/dialogstate-missing-in-20x-and-2x-public-beta.html

I now have a more complicated problem in which an intent has three slots. A metric, a first span, and a second span. I can create prompts for the metric and the first span slots in the Alexa Skills console but the values allowed for the third slot are determined by the value of the second slot. I thought I could just modify that class so that it returned false for the case in which the real handler has to take control but that does not work because then my real handler for that intent is never called.

Is it possible for the IncompleteIntentRequest class to be modified to work the way I need?

Is there some "best practices" way of handling this kind of intent?

Is it possible to do this kind of thing entirely in the Alexa console? I mean is there a way to constrain the values of a slot to those determined by the value of another slot?

alexa skills kitintentshow-toslotsdialog model
10 |5000 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.

apeksha avatar image
apeksha answered

Hello,

Could you please provide us the skill id of the skill you facing this issue.

10 |5000 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.

Jerome E. Garcia avatar image
Jerome E. Garcia answered

Sorry about the delayed response, I got yanked off to another project.

The skill is amzn1.ask.skill.78b6bbaf-666e-4584-935b-09fe71a68ba8 in the CompareToSelf intent but I solved the problem in the Lambda function instead using a dialog. That said, I still think it would be nice to be able to accomplish that feat in the skill definition since all the necessary data is known at the time the skill is being developed.

1 comment
10 |5000 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.

Hello @Jerome E. Garcia,

This scenario can't be handled from the skill end that is from Alexa console this can be done from lambda side by using SDK V2. Check for all the 3 conditions intent request, dialogState, slotValue and proceed. if slot 2 is filled don’t proceed next for third slot just call for corresponding intent.

const InProgressPetMatchIntent = {

canHandle(handlerInput) {

const request = handlerInput.requestEnvelope.request;

return request.type === 'IntentRequest'

&& request.intent.name === 'PetMatchIntent'

&& request.intent.name.slots.slotName.value === ’Slotvalue’

&& request.dialogState !== 'COMPLETED';

}
1 Like 1 ·