简体   繁体   English

Alexa自定义意图接受未存储在可能的插槽中的值。应该触发它的值

[英]Alexa custom intent accepts values which are not stored in the possible slot.values that should trigger it

I have an intent that gets triggered if the user asks Alexa to play one of the radios that I have provided in the JSON file for the slot {radio} on the Alexa console. 如果用户要求Alexa播放我在JSON文件中为Alexa控制台上的{radio}插槽提供的电台之一,就会触发我的意图。 However, if the user asks Alexa to play "random_english_words", the intent works too. 但是,如果用户要求Alexa播放“ random_english_words”,则该意图也有效。
To simplify here's what happens: 为简化起见,将发生以下情况:

-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 should send an error because "what the Movie" is not a possible radio name in the radio_slot values. Alexa应该发送错误,因为在radio_slot值中“ what the Movie”不是一个可能的无线电名称。 But wait this gets even weirder. 但是等等,这变得更加奇怪。

User: Alexa play aenjaejfn  
Alexa: There was a problem with the requested skill's response 

Alexa does her job fine since aenjaejfn is NOT a possible radio name in the radio_slot values. Alexa的工作很好,因为aenjaejfn在radio_slot值中不是一个可能的无线电名称。

So I have two questions: 所以我有两个问题:

  1. Aren't intents which use slots supposed to be triggered only if a slot.value provided by the user is valid? 仅当用户提供的slot.value有效时,才会触发使用使用插槽的意图吗?
  2. Why is Alexa accepting "What the Movie" and not "aenjaejfn" , after all both of them are not radio_name and should not trigger the intent in the first place. 为什么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). 创建自定义插槽类型时,要理解的关键概念是这是Alexa NLP(自然语言处理)的训练数据。 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, 1)不在您的广告位值中的单词和短语会传递给您,

2) your code needs to perform any validation you require if what's said is unknown. 2)如果未知,您的代码需要执行所需的任何验证。

Since you know the acceptable values for that slot, always perform a slot-value validation on your code. 由于您知道该插槽的可接受值,因此请始终对代码执行插槽值验证。 In this way when you get something like "aenjaejfn" or something which you dont support, you can always politely respond back like 这样,当您收到类似“ aenjaejfn”之类的内容或不支持的内容时,您总是可以礼貌地回覆

"Sorry I didn't understand, can you repeat" “对不起,我听不懂,你能再说一遍吗”

or 要么

"Sorry we dont have aenjaejfn in our list. can you please select something from [give some samples from your list]" “很抱歉,我们的清单中没有aenjaejfn。能否请您从[提供清单中的一些示例]中进行选择?”

More info here 更多信息在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有什么方法可以在Alexa Lambda函数中创建自定义插槽值? - Any way to create custom slot values in Alexa Lambda function? 是否可以在Lambda ASK代码中向自定义插槽类型添加值? - Is it possible to add values to a custom slot type in Lambda ASK code? Amazon Alexa自定义插槽备忘录 - Amazon Alexa custom slot memo 如何在Alexa中以编程方式清除自定义插槽值? - How to clear custom slot value programmatically in Alexa? 将存储的值附加到Twitter意图URL - Appending stored values to a twitter intent URL Alexa 自定义槽不明(仅适用于不正确的槽词) - Alexa custom slot is unidentified (Only for incorrect slot words) 为什么我的代码没有在 Alexa 开发控制台模拟器上运行 if 语句,即使我说出/输入我的插槽中存在的值? - Why is my code not running the if statement on the Alexa Development Console simulator, even if I utter/type the values that are present in my slot? 值是否应该存储在组件实例上? - Should values ever be stored on the instance of a component? 即使JSON文件中不存在slot.value,Alexa也会激活意图 - Alexa activates intent even though the slot.value does not exist in the JSON file 文本框是否在Javascript中接受以下值? - textbox accepts the following values in Javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM