Alexa YESNO意图

问题描述 投票:-2回答:1

我之前也曾问过这个问题,但没有运气,所以我再次发帖。我正在研究amazon alexa技能,我希望当我称之为'YESNOIntent'时,它应该在不同意图下回答不同。

'FirstIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech1'
this.emit(":ask", speechOutput)
},

'SecondIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech2'
this.emit(":ask", speechOutput)
},

'ThirdIntent': function () {
speechoutput = 'bla bla, would you like to know anything else?'
this.emit(":ask", speechOutput)
},

'YESNOIntent': function (){
speechoutput = 'speech3'
this.emit(":ask", speechOutput)
},

......等等

alexa alexa-skills-kit alexa-skill
1个回答
2
投票

是和否是两件不同的事情。你不能将这两个合并为一个YesNoIntent。正如我在previous answer中所说,你应该使用AMAZON.YesIntentAMAZON.NoIntent

利用sessionAttributes来跟踪“你在谈话中的位置”,以便在触发AMAZON.YesIntentAMAZON.NoIntent处理程序时给出正确的响应。

© www.soinside.com 2019 - 2024. All rights reserved.