如何使用语音选择列表模板上的项目?
我现在可以通过点击回显点上的屏幕选择一个项目,然后创建一个ElementSelected
意图,然后提供一些话语,如{choice}
,select {choice}
,...
。并为该intent添加处理程序,该处理程序将记录一些测试字符串。
技能回应列表后,即使我将shouldEndSession
设置为true
,Alexa也不会再听。
答案 0 :(得分:0)
shouldEndSession
必须设置为false
。
https://developer.amazon.com/de/docs/custom-skills/request-and-response-json-reference.html#response-object
答案 1 :(得分:0)
我选择列表中的项目是:
.listen
发送:responseReady
之前添加this.response.listen('your reprompt speech here?
。 this.attributes
。choice
插槽添加到ElementSelected
意图。当用户说select {choice} on the list
时,Alexa会将{choice}
广告位转发给ElementSelected
处理程序,然后我会对广告位值进行进一步处理。
答案 2 :(得分:0)
我从 onIntent 返回了SpeechletResponse,如下面的代码所示。
SpeechletResponse response = new SpeechletResponse();
response.setShouldEndSession(false);
response.setOutputSpeech(outputSpeech);
response.setReprompt(reprompt);
return response;