0
私はAlexa
スキルを書いており、AMAZON.CancelIntent
インテントに問題があります。呼び出されないインテントをキャンセルするAlexa
「quit」または「help」と言うと、それに応じて他のインテントが呼び出されます。しかし、スロットを埋めていないので、私のカスタムインテント「NutriFactsIntent
」を「取り消す」と言っても問題はありません。
これはどうしてですか?
テントスキーマ
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": [
"Cancel",
"Never mind",
"forget it"
]
},
{
"name": "AMAZON.HelpIntent",
"samples": [
"Open",
"Start",
"what can I say",
"help me"
]
},
{
"name": "AMAZON.StopIntent",
"samples": [
"Quit",
"Exit",
"Leave",
"Off",
"Stop"
]
},
{
"name": "NutriFactsIntent",
"samples": [
"give me the facts on a {Food}",
"give me the facts on an {Food}",
"give me the facts for a {Food}",
"give me the facts for an {Food}",
"give me the facts of a {Food}",
"give me the facts of an {Food}",
"give me the facts for {Food}",
"give me the facts of {Food}",
...
}
キャッチ意図
function onIntent(intentRequest, session, callback) {
//console.log(`onIntent requestId=${intentRequest.requestId}, sessionId=${session.sessionId}`);
const intent = intentRequest.intent;
const intentName = intentRequest.intent.name;
// Dispatch to your skill's intent handlers
if (intentName === 'NutriFactsIntent') {
getFactsFromSession(intent, session, callback);
} else if (intentName === 'AMAZON.HelpIntent') {
getWelcomeResponse(callback);
} else if (intentName === 'AMAZON.StopIntent' || intentName === 'AMAZON.CancelIntent') {
handleSessionEndRequest(callback);
} else {
throw new Error('Invalid intent');
}
}
サンプルの代わりにサンプルを入力できますか? –