【发布时间】:2018-05-26 02:14:08
【问题描述】:
我正在使用alexa-sdk 在节点中构建 Alexa 技能。我正在使用dialog model 来处理用户交互。我在将流程传递给新的request types 时遇到了一些问题,例如从启动请求到意图请求。
以下是我的处理程序的示例以及我想要的理想情况。我的具体用例是我想问用户一些问题,然后根据他们的回答将它们发送到不同的意图。在意图中,我希望能够访问请求对象,就好像它们最初输入了该意图一样,因此对话模型可以完成它的工作。
const handlers = {
'LaunchRequest': function () {
this.emit('Entry'); // this does not do what I want
},
'Entry': function () {
let request = this.event.request; // this is the launch request object.
// I would like to get the request object for Entry, like if the user started here
// ask some questions, potentially passing the torch to a new intent based on the answers
}
};
那么,有没有办法像用户最初向该意图发出请求一样“调用”意图?抱歉,如果我遗漏了文档中的一些明显内容,我认为我进行了相当彻底的搜索,但是有很多文档。 ps:我当然可以手动构造请求对象,但我觉得我真的不应该。
【问题讨论】:
标签: node.js alexa alexa-skills-kit alexa-skill