Hey,
i don't won't to use any kind of auto dialog delegation strategy. I need full control of the code. Thats why the dialog delegation should happens inside the lambda functions.
And i discovers this weird behavior (Errorcase and how to fix it ... but why?!)
All slots are set to:
Is this slot required to fulfill the intent? > NO
Any slot validation rules > NO
Everything without Dialog Delegation Strategy
- Intent 1: 1 slot
- Intent 2: 4 custom-slots
- Intent 3: 4 custom-slots
For this example i'am working with the Intent #3 and one of it's custom-slots
ERRORCASE
If there is no match within one certain slot, i'am using:
- First .speak('ASK FOR A MISSING VALUE').
- Than .addElicitSlotDirective('SLOTNAME') to fill especially this one slot
- Alexa says the correct speakOut ...
- Followed by "Something went wrong ...."
if (!getResolvedValue(handlerInput.requestEnvelope, 'bewohnerdaten')) { return handlerInput.responseBuilder .speak('Hier fehlt noch ein Slot') .reprompt('Hier fehlt noch ein Slot') .addElicitSlotDirective('bewohnerdaten') .getResponse(); }
Error from the JSON Input
"error": { "type": "INVALID_RESPONSE", "message": "The following directives are not supported: ElicitSlotDirective" }
FIXING THIS BEHAVIOR
Remember i'am working on one slot in Intent #3
Now, if a'm switching any other slot (absolute no matter which one and only one of them), even the one slot from Intent #1 to "Is this slot required to fulfill the intent?" > YES, everything is working as expected on Intent #3.
The Code shown above does exactly what it should. The "The following directives are not supported: ElicitSlotDirective" error vanish from the logging and i can fill the slot by answering Alexas prompt.
So, why is this?
Why do I need at leased one slot set to requrired to get the hole thing working? And if this isn't a bug, is there a workaround to gain the same correct behavior without required slots?