javascript - 是否可以在 Lambda ASK 代码中向自定义槽类型添加值?

标签 javascript alexa slots

我正在制作一个自定义插槽类型,该类型根据每个技能用户的特定产品列表而有所不同。有没有办法定义一个名为“userProducts”的空槽,然后使用 Alexa Skills 套件将其填充到我的 NodeJS 代码中?

最佳答案

我一直在寻找同样的东西,但不幸的是没有办法在运行时更新槽值列表。但是,Alexa 将填充槽的值并不限于您输入的示例值,因此您可以尝试在运行时将给定值与您的列表进行匹配,并不断询问用户他们想要什么,直到您得到一个可接受的值。

Note that a custom slot type is not the equivalent of an enumeration. Values outside the list are still returned if recognized by the spoken language understanding system. Although input to a custom slot type is weighted towards the values in the list, it is not constrained to just the items on the list. Define the Interaction Model in JSON and Text

关于javascript - 是否可以在 Lambda ASK 代码中向自定义槽类型添加值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44850549/

相关文章:

alexa - 我可以在Alexa语音服务中动态创建自定义插槽类型吗?

java - 关于数组列表中已定义的槽

javascript - polymer - 应用程序存储 : Remove entry and update storage

javascript - 我想通过ajax调用从 map 获取json数据

javascript - 如何在 JavaScript 中使用撇号和逗号连接数组

python - 如何将 SSML 合并到 Python 中

javascript - 那么 `OnIntent: function` 在 Alexa 中做了什么?

Python、__slots__、继承和类变量==>属性是只读的bug

python - 如何获取输入 gtk.entry 字段的值并在按钮信号之外使用它

JavaScript 迭代二维数组并返回不匹配项