Alexa 自定义意图接受未存储在可能触发它的 slot.values 中的值
Alexa custom intent accepts values which are not stored in the possible slot.values that should trigger it
如果用户要求 Alexa 播放我在 JSON 文件中为 Alexa 控制台上的插槽 {radio}
提供的收音机之一,我的意图就会被触发。但是,如果用户要求 Alexa 播放 "random_english_words",意图也有效。
为了简化这里发生的事情:
-User: Alexa play A better radio
-Alexa: I will play A better radio
=> Alexa does her job just fine.
-User: Alexa play what the Movie
-Alexa: I will play what the Movie
Alexa 应该发送错误,因为 "what the Movie" 不是 radio_slot
值中可能的收音机名称。但是等等,这变得更奇怪了。
User: Alexa play aenjaejfn
Alexa: There was a problem with the requested skill's response
Alexa 做得很好,因为 aenjaejfn 不是 radio_slot 值中可能的无线电名称。
所以我有两个问题:
- 难道只有当用户提供的 slot.value 有效时才应该触发使用插槽的意图吗?
- 为什么 Alexa 接受 "What the Movie" 而不是 "aenjaejfn" ,毕竟它们都不是 radio_name 并且一开始就不应该触发意图。
When you create a custom slot type, a key concept to understand is
that this is training data for Alexa’s NLP (natural language
processing). The values you provide are NOT a strict enum or array
that limit what the user can say. This has two implications
1) words and phrases not in your slot values will be passed to you,
2) your code needs to perform any validation you require if what’s said is
unknown.
既然您知道该插槽的可接受值,请始终对您的代码执行插槽值验证。这样当你得到类似 "aenjaejfn" 或你不支持的东西时,你总是可以礼貌地回复
"Sorry I didn't understand, can you repeat"
或
"Sorry we dont have aenjaejfn in our list. can you please select
something from [give some samples from your list]"
更多信息here
如果用户要求 Alexa 播放我在 JSON 文件中为 Alexa 控制台上的插槽 {radio}
提供的收音机之一,我的意图就会被触发。但是,如果用户要求 Alexa 播放 "random_english_words",意图也有效。
为了简化这里发生的事情:
-User: Alexa play A better radio
-Alexa: I will play A better radio
=> Alexa does her job just fine.
-User: Alexa play what the Movie
-Alexa: I will play what the Movie
Alexa 应该发送错误,因为 "what the Movie" 不是 radio_slot
值中可能的收音机名称。但是等等,这变得更奇怪了。
User: Alexa play aenjaejfn
Alexa: There was a problem with the requested skill's response
Alexa 做得很好,因为 aenjaejfn 不是 radio_slot 值中可能的无线电名称。
所以我有两个问题:
- 难道只有当用户提供的 slot.value 有效时才应该触发使用插槽的意图吗?
- 为什么 Alexa 接受 "What the Movie" 而不是 "aenjaejfn" ,毕竟它们都不是 radio_name 并且一开始就不应该触发意图。
When you create a custom slot type, a key concept to understand is that this is training data for Alexa’s NLP (natural language processing). The values you provide are NOT a strict enum or array that limit what the user can say. This has two implications
1) words and phrases not in your slot values will be passed to you,
2) your code needs to perform any validation you require if what’s said is unknown.
既然您知道该插槽的可接受值,请始终对您的代码执行插槽值验证。这样当你得到类似 "aenjaejfn" 或你不支持的东西时,你总是可以礼貌地回复
"Sorry I didn't understand, can you repeat"
或
"Sorry we dont have aenjaejfn in our list. can you please select something from [give some samples from your list]"
更多信息here