Closed moibelgal closed 6 years ago
Interaction Model I copied from the Code Editor:
{
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "OrderIntent",
"samples": [
"{quantity} {type} pizza",
"can I order {quantity} {type} pizza {size} {crust}",
"I want to order {quantity} {type} pizza",
"I want to order {quantity} {size} {type} pizza",
"I want to order {quantity} {size} {type} pizza with {crust}",
"may i order order {quantity} {type} pizza",
"may i order order {quantity} {size} {type} pizza",
"may i order {quantity} {size} {type} pizza with {crust} please",
"can i have order {quantity} {type} pizza",
"can i have order {quantity} {size} {type} pizza",
"can i have {quantity} {size} {type} pizza with {crust} please",
"can you deliver {quantity} {size} {type} pizza with {crust} ",
"{quantity} {size} {type} pizza"
],
"slots": [
{
"name": "type",
"type": "PIZZA_TYPE",
"samples": [
"{type}",
"I would go with {type}",
"{type} please",
"{type} pizza",
"{type} pizza please"
]
},
{
"name": "quantity",
"type": "AMAZON.NUMBER",
"samples": [
"{quantity}",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten"
]
},
{
"name": "size",
"type": "PIZZA_SIZE",
"samples": [
"{size} size",
"{size}",
"{size} I guess"
]
},
{
"name": "crust",
"type": "PIZZA_CRUST",
"samples": [
"{crust}",
"{crust} please"
]
}
]
}
],
"types": [
{
"name": "PIZZA_CRUST",
"values": [
{
"id": null,
"name": {
"value": "hand tossed",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "thin crust",
"synonyms": [
"crunchy thin crust",
"crispy thin crust",
"thin"
]
}
},
{
"id": null,
"name": {
"value": "stuffed crust",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "deep dish crust",
"synonyms": []
}
}
]
},
{
"name": "PIZZA_SIZE",
"values": [
{
"id": null,
"name": {
"value": "small",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "medium",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "large",
"synonyms": []
}
}
]
},
{
"name": "PIZZA_TYPE",
"values": [
{
"id": null,
"name": {
"value": "pepperoni",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "supreme",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "meat lover's",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "cheese",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "vegie",
"synonyms": []
}
},
{
"id": null,
"name": {
"value": "pesto",
"synonyms": []
}
}
]
}
],
"prompts": [
{
"id": "Elicit.Intent-OrderIntent.IntentSlot-type",
"promptVersion": "1.0",
"definitionVersion": "1.0",
"variations": [
{
"type": "PlainText",
"value": "What kind of pizza would you like?"
}
]
},
{
"id": "Elicit.Intent-OrderIntent.IntentSlot-quantity",
"promptVersion": "1.0",
"definitionVersion": "1.0",
"variations": [
{
"type": "PlainText",
"value": "How many order?"
},
{
"type": "PlainText",
"value": "how many?"
}
]
},
{
"id": "Elicit.Intent-OrderIntent.IntentSlot-size",
"promptVersion": "1.0",
"definitionVersion": "1.0",
"variations": [
{
"type": "PlainText",
"value": "What size, small, medium or large?"
}
]
},
{
"id": "Elicit.Intent-OrderIntent.IntentSlot-crust",
"promptVersion": "1.0",
"definitionVersion": "1.0",
"variations": [
{
"type": "PlainText",
"value": "What kind of crust?"
}
]
}
],
"dialog": {
"version": "1.0",
"intents": [
{
"name": "OrderIntent",
"confirmationRequired": false,
"prompts": {},
"slots": [
{
"name": "type",
"type": "PIZZA_TYPE",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicit": "Elicit.Intent-OrderIntent.IntentSlot-type"
}
},
{
"name": "quantity",
"type": "AMAZON.NUMBER",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicit": "Elicit.Intent-OrderIntent.IntentSlot-quantity"
}
},
{
"name": "size",
"type": "PIZZA_SIZE",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicit": "Elicit.Intent-OrderIntent.IntentSlot-size"
}
},
{
"name": "crust",
"type": "PIZZA_CRUST",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicit": "Elicit.Intent-OrderIntent.IntentSlot-crust"
}
}
]
}
]
}
}
I have tried to start using the delegate directive today and I cant get it to work. Having a similar issue to @moibelgal above - I can see that the intent is set correctly and matches up with whats in my code - but it appears to be falling through to my unhandled intent
I'm surprised that this has been only @Killfromafar and myself have encountered this issue. Delegate directive is a fundamental feature to handle multi turns conversation.
hey there, try this:
!== "COMPLETED"
instead of your
=== "IN_PROGRESS"
and in your else if statement change you code to:
this.emit(":delegate");
instead of:
this.context.succeed({
"response": {
"directives": [
{
"type": "Dialog.Delegate"
}
],
"shouldEndSession": false
},
"sessionAttributes": {}
});
hope this helps you out a bit
I'm facing the same issue as @moibelgal even after putting @Liamdelee suggestions in place. Help please!
Hi, @moibelgal @hotessy @Killfromafar, As long as the dialogState != "COMPLETED", you should return delegate directive with updatedIntent, because in each turn the intent will change. So try:
else if( this.event.request.dialogState === "IN_PROGRESS"){
const updatedIntent = this.event.request.intent;
this.emit(':delegate', updatedIntent);
}
@TianTXie this is my code:
if (state === "STARTED") {
let updatedIntent = this.event.request.intent;
this.emit(":delegate", updatedIntent);
return;
} else if (state != "COMPLETED") {
let updatedIntent = this.event.request.intent;
this.emit(":delegate", updatedIntent);
return;
} else {
handleCurrentIntent.call(this);
}
In the Alexa Test Simulator (Beta) I always get invocationResponse = null
though request.intent is as expected. Any insight(s) on why this might be happening ?
@hotessy , That might because: Service Simulator does not currently support testing audio player directives, dialog model, customer permissions and customer account linking. Text mode does not support launch intents and single interaction phrases. Could you try to test on the device to see if it works or not?
Hey @TianTXie and @hotessy - the brand new skill tester beta, launched today, might interest you: https://developer.amazon.com/blogs/alexa/post/577069bd-d9f9-439a-b4bf-3b0495e3d24b/announcing-new-test-simulator-beta-for-alexa-skills
"The new simulator expands existing testing capabilities such as text input, JSON debugging, and visual display by adding features like the ability to test multi-turn conversation, entity resolution, dialog management, and more."
Even audioplayer, with some caveats:
"The Test Simulator does not render the audio playback, but the Skill I/O section shows the AudioPlayer directives sent from your skill."
@TianTXie @talkingnews this is the very testing service that I'm using. Any suggestions ?
@hotessy can you provide us with some code of you delegate so we can have a look at it? I tested my skill again just now and i am using dialog, i did test it in the new test builder (love it btw) and for me everything works fine so maybe it might me a problem with your code or vui model.
@Liamdelee corrected things on my part. Can you confirm that you are obtaining the accessToken
(of account linking) in request.body
. The requests I make using the new test simulator don't contain it but the the ones I make using the old test simulator do.
I am not using account linking as of yet so can't really help you with that one sorry. But since it seems the problem lays with the new simulator? you might open a thread on the amazon forum or send a ticket to amazon because it looks like it is a problem from their side and not the SDK, or am i wrong here?
The latter seems more plausible. I'll send a ticket. Thanks !
i have exactly the same problem where even after all the slots are filled, dialogState remains at IN_PROGRESS instead of switching to COMPLETED.
I'm also facing the same problem. The value of dialogState
is never equal to "COMPLETED"
, even after getting all the slot values. If I try to make some of the slots required, then the skill fails to execute at the last one. It says "There was a problem with the requested skill's response".
after all the slots are filled, dialogState remains at IN_PROGRESS instead of switching to COMPLETED.
I have a skill to order pizza that returning Dialog.Delegate directive for AVS to fill the required slots. It had worked well but suddenly stopped working last time I checked (last week) even though I didn't change anything. And I am using Amazon Lamdba with zip package.
The symptom when testing with the Echo device is, it says "I'm not sure...something went wrong" right after the code to return Dialog.Delegate when the dialogState is STARTED. It just stops working right there. The code to process other states (IN_PROGRESS and COMPLETED) never get called.
I then tried to write very simple code (see below) and it has exactly the same problem. Code:
Note that I intentionally used 2 different ways to return the Dialog.Delegate directive.
I also checked the CloudWatch logs. All the slots I spoke to the Echo device were identified correctly but the Dialog.Delegate directive didn't seem to work or get called at all. See log:
START RequestId: 1f8ff07d-9208-11e7-a95d-0d225d5ece20 Version: $LATEST 2017-09-05T07:02:05.008Z 1f8ff07d-9208-11e7-a95d-0d225d5ece20 Warning: Application ID is not set END RequestId: 1f8ff07d-9208-11e7-a95d-0d225d5ece20 REPORT RequestId: 1f8ff07d-9208-11e7-a95d-0d225d5ece20 Duration: 50.84 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 30 MB
START RequestId: 274d24a8-9208-11e7-be95-7fce9de0ee98 Version: $LATEST 2017-09-05T07:02:17.549Z 274d24a8-9208-11e7-be95-7fce9de0ee98 Warning: Application ID is not set END RequestId: 274d24a8-9208-11e7-be95-7fce9de0ee98 REPORT RequestId: 274d24a8-9208-11e7-be95-7fce9de0ee98 Duration: 83.59 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 31 MB
START RequestId: 2eabbd54-9208-11e7-b7ff-fb9bcec93113 Version: $LATEST 2017-09-05T07:02:29.868Z 2eabbd54-9208-11e7-b7ff-fb9bcec93113 Warning: Application ID is not set 2017-09-05T07:02:29.987Z 2eabbd54-9208-11e7-b7ff-fb9bcec93113 Start OrderIntent 2017-09-05T07:02:29.987Z 2eabbd54-9208-11e7-b7ff-fb9bcec93113 { quantity: { name: 'quantity', value: '2', confirmationStatus: 'NONE' }, size: { name: 'size', value: 'large', resolutions: { resolutionsPerAuthority: [Object] }, confirmationStatus: 'NONE' }, type: { name: 'type', value: 'cheese', resolutions: { resolutionsPerAuthority: [Object] }, confirmationStatus: 'NONE' }, crust: { name: 'crust', confirmationStatus: 'NONE' } } 2017-09-05T07:02:29.990Z 2eabbd54-9208-11e7-b7ff-fb9bcec93113 STARTED 2017-09-05T07:02:29.990Z 2eabbd54-9208-11e7-b7ff-fb9bcec93113 { quantity: { name: 'quantity', value: '2', confirmationStatus: 'NONE' }, size: { name: 'size', value: 'large', resolutions: { resolutionsPerAuthority: [Object] }, confirmationStatus: 'NONE' }, type: { name: 'type', value: 'cheese', resolutions: { resolutionsPerAuthority: [Object] }, confirmationStatus: 'NONE' }, crust: { name: 'crust', confirmationStatus: 'NONE' } } END RequestId: 2eabbd54-9208-11e7-b7ff-fb9bcec93113 REPORT RequestId: 2eabbd54-9208-11e7-b7ff-fb9bcec93113 Duration: 215.48 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 31 MB
START RequestId: 2edeb386-9208-11e7-b5f7-63f49de38794 Version: $LATEST 2017-09-05T07:02:30.207Z 2edeb386-9208-11e7-b5f7-63f49de38794 Warning: Application ID is not set END RequestId: 2edeb386-9208-11e7-b5f7-63f49de38794 REPORT RequestId: 2edeb386-9208-11e7-b5f7-63f49de38794 Duration: 40.99 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 31 MB