这是一个非常简单的问题,但我找不到任何答案的证据。我想为一个列表配置一个插槽类型 - 这意味着Lex将不得不继续询问该列表中的更多元素。
例如,这是一个来回的样子:
Lex: What flowers would you like to order?
Me: roses
Lex: Any other types?
Me: yes, I also want lillies
Lex: Anything else?
Me: that is all
发送到Lambda的示例有效负载如下所示:
{
"currentIntent": {
"slots": {
"PickupDate": "2030-11-08",
"PickupTime": "10:00",
"FlowerType": "lilies"
},
"name": "OrderFlowers",
"confirmationStatus": "None"
},
"bot": {
"alias": "$LATEST",
"version": "$LATEST",
"name": "OrderFlowers"
},
"userId": "John",
"invocationSource": "DialogCodeHook",
"outputDialogMode": "Text",
"messageVersion": "1.0",
"sessionAttributes": {}
}
^^^直接来自AWS Lambda控制台中的示例测试配置。
我希望它看起来像这样:
{
"currentIntent": {
"slots": {
"PickupDate": "2030-11-08",
"PickupTime": "10:00",
"FlowerTypes": [
"roses",
"lilies"
]
},
"name": "OrderFlowers",
"confirmationStatus": "None"
},
"bot": {
"alias": "$LATEST",
"version": "$LATEST",
"name": "OrderFlowers"
},
"userId": "John",
"invocationSource": "DialogCodeHook",
"outputDialogMode": "Text",
"messageVersion": "1.0",
"sessionAttributes": {}
}
答案 0 :(得分:1)
Lex插槽总是字符串,因此您必须提出更复杂的解决方案。我建议:
Goofy,我知道,但Lex现在对插槽的选择非常有限!