使用语音选择列表模板上的项目

时间:2018-04-25 02:33:23

标签: alexa alexa-skills-kit alexa-skill

如何使用语音选择列表模板上的项目?

我现在可以通过点击回显点上的屏幕选择一个项目,然后创建一个ElementSelected意图,然后提供一些话语,如{choice}select {choice}...。并为该intent添加处理程序,该处理程序将记录一些测试字符串。

技能回应列表后,即使我将shouldEndSession设置为true,Alexa也不会再听。

3 个答案:

答案 0 :(得分:0)

如果您希望Alexa进一步倾听,

shouldEndSession必须设置为falsehttps://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;