I am trying to get AutoDelegate to work (or any slot-filling method, because nothing seems to work for me). Strangely I have a request where it works perfectly, but anything I create new from scratch fails, even the most basic example.
Essentially, the slot-delegation is NEVER triggered at all, it practically goes straight to the “COMPLETED” stage, no matter if slots are required, require confirmation, if the whole request requires confirmation – everything seems to be ignored. I am loosing my mind if I hear or read one more time that “the intent won’t be even hit, until all slots are filled”.
It goes like this:
- Trigger intent with utterance without slot
- Hit
InProgressSlotIntentHandler
with stateSTARTED
- return
addDelegateDirective(currentIntent)
- State suddenly
COMPLETED
without filling any slots - Hits
SlotIntentHandler
and code fails because slots are not filled
The logged request-data also clearly shows that no slot was confirmed, but that it goes straight into COMPLETED
{
"type": "IntentRequest",
"requestId": "amzn1.echo-api.request.786ea058-6258-4e8e-8eac-a777f561b3a6",
"locale": "en-US",
"timestamp": "2024-09-20T09:35:22Z",
"intent": {
"name": "SlotIntent",
"confirmationStatus": "NONE",
"slots": {
"firstName": {
"name": "firstName",
"confirmationStatus": "NONE"
},
"testSlot": {
"name": "testSlot",
"confirmationStatus": "NONE"
}
}
},
"dialogState": "COMPLETED"
}
Even when using working templates (e.g. https://github.com/dabblelab/12-alexa-dialog-delegate-example-skill from https://www.youtube.com/watch?v=NHtK_BbYb0) copied 1:1 it does not want to work.
Here is the extract from my most basic model (simplified)
{
"interactionModel": {
"languageModel": {
"intents": [
{
"name": "SlotIntent",
"slots": [
{
"name": "testSlot",
"type": "AMAZON.DATE",
"samples": [
"give me a fact about {testSlot}",
"tell me some facts about {testSlot}",
"{testSlot}"
]
}
],
"samples": [
"tell me",
"tell me about {testSlot}"
]
}
]
},
"dialog": {
"intents": [
{
"name": "SlotIntent",
"confirmationRequired": false,
"prompts": {},
"slots": [
{
"name": "testSlot",
"type": "AMAZON.DATE",
"confirmationRequired": false,
"elicitationRequired": true,
"prompts": {
"elicitation": "Elicit.Slot.251925459829.983270759031"
}
}
]
}
],
"delegationStrategy": "ALWAYS"
},
"prompts": [
{
"id": "Elicit.Slot.251925459829.983270759031",
"variations": [
{
"type": "PlainText",
"value": "Give me a date."
}
]
}
]
}
}
And the 2 intents for handling the delegation and final output
const InProgressSlotIntentHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest' &&
request.intent.name === 'SlotIntent' &&
request.dialogState !== 'COMPLETED';
},
handle(handlerInput) {
const currentIntent = handlerInput.requestEnvelope.request.intent;
return handlerInput.responseBuilder
.addDelegateDirective(currentIntent)
.getResponse();
},
};
const SlotIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'SlotIntent';
},
async handle(handlerInput) {
const responseBuilder = handlerInput.responseBuilder;
let speechText = `Here's is your slot - ${handlerInput.requestEnvelope.request.intent.slots.testSlot}`;
return responseBuilder
.speak(speechText)
.getResponse();
},
};
In the Utterance Profiler
it works correctly, but once I deploy and run (on device, in the app, or in the simulator), it straight returns me “Here is your slot – undefined”
Is this a current hiccup at Alexa, or am I doing something fundamentally wrong, because I can not see it (especially because I have a skill where the delegation works in another intent, but ANYTHING new just does not..)
1
I do not really have an answer, but I created a NEW HelloWorld skill from scratch and copied the interaction JSON-model 1:1 in there – and with the new skill the AutoDelegation works (though it somehow breaks quite easily and quits with mysterious “Can’t find skill bundle metadata for en_US” errors if I modify things – but at least it seems like even then it TRIES to do AutoDelegation, it just gets confused itself where to find the prompt-resources??)
So I guess my only path forward is to scrap the existing skill and copy all data to a new one?
Luckily the skill is still in development, but that cannot be a solution. I still do not know why this is happening in the first place :-/