2017-09-11 12 views
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'); 
    } 
} 
+0

サンプルの代わりにサンプルを入力できますか? –

答えて

0

私は起動スキルビルダーアレクサは、相互作用モデルのために利用できる持っている BETAのオプトアウト。私はBETAを入力してその上でクリックした

enter image description here

、私はその後、苦しみの数時間後にダッシュボードに行き、BETAを残しました。

これですべてが機能します。