【发布时间】:2018-04-27 17:58:34
【问题描述】:
我想填写slot 不是在意图调用的开始,而是在意图请求的后面部分。我想为用户提供一些选项,我希望他们从中选择一个。为此,我正在尝试使用Dialog.ElicitSlot,但不知何故我得到了一个错误:
“对技能端点的请求导致错误。”
当我需要用户从我的列表中选择一个选项时,我会返回它。
return {
"version": "1.0",
"sessionAttributes": {},
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "These are the multiplex" + ("es" if len(multi_list) > 1 else "") + " " + outputSpeech + ". Please select one out of these."
# outputSpeech contains the list of options I want the user to select from
},
"shouldEndSession": False,
"directives": [
{
"type": "Dialog.ElicitSlot",
"slotToElicit": "MULTIPLEX",
"updatedIntent": {
"name": "GetMovieDetails",
"confirmationStatus": "NONE",
"slots": {
"CITY" : {
"name" : "CITY",
"confirmationStatus" : "NONE",
"value" : city # this is already filled, it is just anti-capitalised
},
"NAME" : {
"name" : "NAME",
"confirmationStatus" : "NONE",
"value" : movie_name # this is already filled, it is just anti-capitalised
},
"MULTIPLEX" : {
"name" : "MULTIPLEX",
"confirmationStatus" : "NONE",
}
}
}
}
]
}
我正在使用python-lambda-local 测试我的技能,它在我的本地机器上运行良好(我只需手动将dialogState 更改为"COMPLETED",就像here 一样)。它返回上面写的所有内容。但是在 Skill Tester 上测试它时会出错。 Here 是技能测试器中返回的输出。
PS:我没有选中 Build Section 中的 Slot Filling 复选框。 (因为我需要稍后填充插槽),并且here 是完整的代码以防万一。
【问题讨论】:
-
如果有人愿意,我可以将我的赏金奖励给他们。不然就浪费了。
标签: alexa alexa-skill alexa-slot