Ing*_*rid 6 alexa aws-lambda alexa-skills-kit
我正在开发一个带有一个Intent的Alexa技能,其中包含一个带有几个可能值的Slot.
我的槽与所定义"name" : "Channel"
,"type" : "LIST_OF_CHANNELS"
和值
如何检索要在Lambda函数中使用的发出的槽值?这是"从话语部分检索插槽的价值"我希望得到回答.非常感谢.
// retrieve value of slot from utterance
var c = intent.slots.Channel.value;
// append value to end of URL that references API
fetchEnseParse("/channel/" + c, function(body) {
// continuation of this function is below
Run Code Online (Sandbox Code Playgroud)
小智 12
var c = this.event.request.intent.slots.slotname.value
这应该会给你你想要的东西.
如果您的 lambda 收到,您可以在此处找到它...
{
"request": {
"type": "IntentRequest",
"intent": {
"name": "YourIntentName",
"slots": {
"slotname": {
"name": "slotname",
"value": "HERE!"
}
}
},
"locale": "en-US"
},
}
Run Code Online (Sandbox Code Playgroud)
该事件将传递给您的 lambda 处理程序。
归档时间: |
|
查看次数: |
8804 次 |
最近记录: |