【发布时间】:2017-12-09 07:19:17
【问题描述】:
当 Alexa 收到来自用户的“未处理意图”时。如何处理“我不太确定如何帮助您”的错误消息?
【问题讨论】:
标签: alexa alexa-skills-kit alexa-voice-service alexa-app
当 Alexa 收到来自用户的“未处理意图”时。如何处理“我不太确定如何帮助您”的错误消息?
【问题讨论】:
标签: alexa alexa-skills-kit alexa-voice-service alexa-app
第 1 步: 如果您的交互模型缺少示例语句,您可能会收到很多未处理的事件。您添加的更多示例会将您的 alexa 技能重定向到正确的功能...
请参阅此链接以正确设置您的交互模型https://developer.amazon.com/docs/custom-skills/define-the-interaction-model-in-json-and-text.html#h2_sample_utterances
第 2 步:在 index.js 中定义未处理的函数来处理异常并重新提示用户输入正确的单词
'Unhandled': function () {
this.attributes.speechOutput = this.t('HELP_MESSAGE');
this.attributes.repromptSpeech = this.t('HELP_REPROMPT');
this.emit(':ask', this.attributes.speechOutput, this.attributes.repromptSpeech);
},
【讨论】: