问题描述
我是Alexa开发的新手。我已经使用AWS lambda函数和Node.js代码成功创建了Alexa技能。这是我的意图架构。
I am new in Alexa development. I have successfully create an Alexa skill with AWS lambda function and Node.js code. This is my intent schema.
{
"intents": [
{
"slots": [
{
"name": "locationName",
"type": "LOCATION_LIST"
}
],
"intent": "locationIntent"
}
]
}
我已使用具有以下值的自定义广告位类型 LOCATION_LIST。
Also I have used custom slot type "LOCATION_LIST" with following values.
kitchen
bedroom
bathroom
dining area
工作正常。但是我需要从我自己的服务中动态添加更多位置值。
It's working fine. But I need to add more location values dynamically from my own service. Is it possible?
根据我的系统架构,我们无法预定义位置名称。那我该怎么办?
Based on my system architecture, we cant pre-defined the location names. Then what should i do?
推荐答案
是的,也许有可能完成您的要求。
Yes, it may be possible to accomplish what you are asking.
首先,让我们澄清一下广告位的工作原理。如 Alexa博客文章:
First, let's clear something up about how slots work. As described in this Alexa blog post:
这意味着您可以在插槽中接收单词您没有在SLOT定义中明确列出。因此,您只需要在SLOT列表中提供足够的单词示例即可帮助Alexa NLP引擎。
What this means is that you CAN receive words in the slot that you did not specifically list in the SLOT definition. So you just need to provide enough word examples in the SLOT list to help the Alexa NLP engine.
我建议您尝试使用当前的实现,并尝试替代其他实现位置,看看Alexa是否可以识别并退回它。尝试将插槽值写入日志并查看。您可能会感到惊喜。
I suggest that you experiment with your current implementation, and try substituting a different location and see if Alexa can recognize and return it. Try writing the slot value to the log and see. You may be pleasantly surprised.
这篇关于如何为Alexa技能动态添加广告位值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!