我想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"
手动更改为,就像这里的那个)。它返回上面写的所有内容。但是在 Skill Tester 上测试它时会出错。这是技能测试器中返回的输出。PS:我没有选中 Build Section 中的 Slot Filling 复选框。(因为我需要稍后填充插槽),这是完整的代码以防万一。