Я создаю тестовый навык Алекса, который поможет с покупкой продуктов.Ожидается как название продукта, так и количество единиц для покупки.Эти слоты были настроены так, как требуется для выполнения намерения, и хотя они могут быть выполнены индивидуально, я настроил примерные высказывания, которые позволяют пользователю выполнять оба в одном предложении, например,
I want to buy {MyQuantity} {MyArticle}
Однакопри тестировании Alexa всегда будет запрашивать оба значения по отдельности.Ниже приведен пример потока беседы, а ниже - вывод JSON моего навыка.Не уверен, что я делаю не так.(В этом случае я делегировал управление диалоговыми окнами Alexa).
![enter image description here](https://i.stack.imgur.com/qGlsM.png)
JSON-конфигурация навыка:
{
"interactionModel": {
"languageModel": {
"invocationName": "priceline collect",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples": []
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "CreateOrder",
"slots": [
{
"name": "MyArticle",
"type": "ClickCollectArticle",
"samples": [
"I want to buy {MyArticle}",
"I want {MyArticle}",
"Can i get {MyArticle} please",
"I'd like to buy {MyArticle}"
]
},
{
"name": "MyQuantity",
"type": "AMAZON.NUMBER",
"samples": [
"{MyQuantity} thanks",
"I want {MyQuantity} please"
]
}
],
"samples": [
"I want to buy {MyQuantity} {MyArticle}",
"I want to buy {MyArticle}",
"Can i please get {MyQuantity} {MyArticle}",
"I want to order {MyArticle}",
"I would like to place an order"
]
}
],
"types": [
{
"name": "ClickCollectArticle",
"values": [
{
"name": {
"value": "foundation"
}
},
{
"name": {
"value": "conditioner"
}
},
{
"name": {
"value": "shampoo"
}
},
{
"name": {
"value": "perfume"
}
},
{
"name": {
"value": "after shave"
}
},
{
"name": {
"value": "aftershave"
}
},
{
"name": {
"value": "hairspray"
}
},
{
"name": {
"value": "hair gel"
}
},
{
"name": {
"value": "lipstick"
}
}
]
}
]
},
"dialog": {
"intents": [
{
"name": "CreateOrder",
"delegationStrategy": "ALWAYS",
"confirmationRequired": true,
"prompts": {
"confirmation": "Confirm.Intent.847210063881"
},
"slots": [
{
"name": "MyArticle",
"type": "ClickCollectArticle",
"confirmationRequired": true,
"elicitationRequired": true,
"prompts": {
"confirmation": "Confirm.Slot.847210063881.746398127202",
"elicitation": "Elicit.Slot.847210063881.746398127202"
}
},
{
"name": "MyQuantity",
"type": "AMAZON.NUMBER",
"confirmationRequired": true,
"elicitationRequired": true,
"prompts": {
"confirmation": "Confirm.Slot.847210063881.631830388134",
"elicitation": "Elicit.Slot.847210063881.631830388134"
},
"validations": [
{
"type": "isLessThan",
"prompt": "Slot.Validation.369260633406.54462952385.1162755638931",
"value": "20"
}
]
}
]
}
],
"delegationStrategy": "ALWAYS"
},
"prompts": [
{
"id": "Elicit.Slot.847210063881.746398127202",
"variations": [
{
"type": "PlainText",
"value": "We sell all kinds of awesome stuff, from lipstick to hairspray. What would you like to buy?"
},
{
"type": "PlainText",
"value": "We sell everything from shampoo to foundation. What would you like to order?"
},
{
"type": "PlainText",
"value": "What item would you like to order. Examples are lipstick or foundation. "
}
]
},
{
"id": "Confirm.Slot.847210063881.746398127202",
"variations": [
{
"type": "PlainText",
"value": "Great. So that's {MyArticle} ?"
}
]
},
{
"id": "Elicit.Slot.847210063881.631830388134",
"variations": [
{
"type": "PlainText",
"value": "What number of {MyArticle} would you like to purchase?"
},
{
"type": "PlainText",
"value": "How many {MyArticle} were you after?"
},
{
"type": "PlainText",
"value": "And how many of the item {MyArticle} would you like to buy?"
}
]
},
{
"id": "Confirm.Slot.847210063881.631830388134",
"variations": [
{
"type": "PlainText",
"value": "Awesome. So {MyQuantity} {MyArticle} ?"
}
]
},
{
"id": "Confirm.Intent.847210063881",
"variations": [
{
"type": "PlainText",
"value": "Ok. It looks like we're all ready to get you {MyQuantity} units of {MyArticle} , is that right?"
}
]
},
{
"id": "Slot.Validation.369260633406.54462952385.1162755638931",
"variations": [
{
"type": "PlainText",
"value": "Sorry, you can't order that many units. Please order less than twenty. "
}
]
}
]
}
}