Java Alexa询问回应onLaunch:演讲和重新演讲的预期行为是什么?
在使用echo测试我的技能时,我经历了以下行为: 由非意图请求和此响应调用时:Java Alexa询问回应onLaunch:演讲和重新演讲的预期行为是什么?,java,alexa,alexa-skills-kit,Java,Alexa,Alexa Skills Kit,在使用echo测试我的技能时,我经历了以下行为: 由非意图请求和此响应调用时: public SpeechletResponse onLaunch(LaunchRequest request, Session session) throws SpeechletException { PlainTextOutputSpeech speech = new PlainTextOutputSpeech(); speech.setText("Welcome"); PlainTex
public SpeechletResponse onLaunch(LaunchRequest request, Session session) throws SpeechletException {
PlainTextOutputSpeech speech = new PlainTextOutputSpeech();
speech.setText("Welcome");
PlainTextOutputSpeech repromtSpeech = new PlainTextOutputSpeech();
speech.setText("Repromt");
Reprompt reprompt = new Reprompt();
reprompt.setOutputSpeech(repromtSpeech);
SimpleCard card = new SimpleCard();
card.setTitle("Welcome");
card.setContent("Test");
return SpeechletResponse.newAskResponse(speech, reprompt, card);
}
Alexa只输出repromt文本
实际的互动是:
- 用户:alexa询问“技能”
- Alexa:重述“等待回答”
- 用户:alexa询问“技能”
- 欢迎“等待回答”
- 用户:“没有正确响应”
- Alexa:重述“等待回答”
我怎样才能获得预期的行为?如果响应中没有(从来没有?)包含语音文本,那么语音文本的作用是什么?我认为您的代码中有错误。您正在设置speech.setText两次。我想你是想第二次设置repromptSpeech.setText。哦,不,真的是那个打字错误;-)我甚至把它复制到这里简化的示例中。