假设我有以下意图的alexa技能:
{
"intents": [
{
"intent": "aaa",
"slots": []
},
{
"intent": "bbb",
"slots": [
{
"name": "City",
"type": "CITIES"
}
]
},
{
"intent": "ccc",
"slots": [
{
"name": "City",
"type": "CITIES"
}
]
},
{
"intent": "ddd",
"slots": [
{
"name": "City",
"type": "CITIES"
},
{ "name": "Name",
"type": "USER_NAMES"}
]
},
]
}
假设我使用这个简单的话语:
ddd tell me if user {Name} lives in the {City}.
通过这样做,我假设在我的alexa技能,只要我的Intent正在调用将在我的自定义插槽中的 Names 中的插槽名称之一和我的自定义插槽中的 Cities 的插槽城市中提供 .
但是,结果是我得到了自由文本,我没有在自定义插槽中提供 . 自由文本,如果你说的话听起来像我说的,但意味着不同的东西 .
我不确定我做错了什么或者这是否符合设计要求 .
1 回答
是的,这是正常的,并且是混淆的常见原因:您为自定义插槽提供的单词列表被视为指南,而不是确定的集合 .
由于它是一个混乱的来源,他们发布了一篇关于它的博客文章:
Why a Custom Slot is the Literal Solution
另请注意,您可以使用和构建城市的内置插槽类型,请参见此处:
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference