2017-05-18 6 views
0

ROR APIでアカウントをリンクしてAlexaスキルを開発しています。 LaunchRequestが動作していますが、IntentRequest(3つのスロットを持つ)を作成しようとすると、私はdialogStateを取得せず、Alexaは自分の応答に問題があると言っています。私はAmazonのスキルビルダーベータを使ってスキルモデルを構築しました。ダイアログはコンソールやシミュレータでテスト可能ではないので、何が起きているのかを理解することはほとんど不可能です。ここではモデルです:カスタムalexaスキルのダイアログを作成してテストするにはどうすればよいですか?

{ 
"intents": [ 
{ 
    "name": "AMAZON.CancelIntent", 
    "samples": [] 
}, 
{ 
    "name": "AMAZON.HelpIntent", 
    "samples": [] 
}, 
{ 
    "name": "AMAZON.StopIntent", 
    "samples": [] 
}, 
{ 
    "name": "RateWineIntent", 
    "samples": [...] 
    , 
    "slots": [ 
    { 
     "name": "wine", 
     "type": "AMAZON.NUMBER", 
     "samples": [ 
     "{wine}", 
     "wine {wine}", 
     "wine number {wine}" 
     ] 
    }, 
    { 
     "name": "rating", 
     "type": "AMAZON.NUMBER", 
     "samples": [ 
     "{rating}", 
     "a rating of {rating}", 
     "rate it a {rating}", 
     "give it a rating of {rating}" 
     ] 
    }, 
    { 
     "name": "taster", 
     "type": "AMAZON.NUMBER", 
     "samples": [ 
     "{taster}", 
     "taster number {taster}", 
     "taster {taster}", 
     "for taster {taster}", 
     "for taster number {taster}" 
     ] 
    } 
    ] 
}], 
"prompts": [ 
{ 
    "id": "Confirm.Intent-RateWineIntent", 
    "promptVersion": "1.0", 
    "definitionVersion": "1.0", 
    "variations": [ 
    { 
     "type": "PlainText", 
     "value": "I have a rating of {rating} on wine {wine} for taster {taster}. Is that correct." 
    } 
    ] 
}, 
{ 
    "id": "Elicit.Intent-RateWineIntent.IntentSlot-wine", 
    "promptVersion": "1.0", 
    "definitionVersion": "1.0", 
    "variations": [ 
    { 
     "type": "PlainText", 
     "value": "OK, which wine number?" 
    } 
    ] 
}, 
{ 
    "id": "Elicit.Intent-RateWineIntent.IntentSlot-rating", 
    "promptVersion": "1.0", 
    "definitionVersion": "1.0", 
    "variations": [ 
    { 
     "type": "PlainText", 
     "value": "And what rating for this wine?" 
    } 
    ] 
}, 
{ 
    "id": "Elicit.Intent-RateWineIntent.IntentSlot-taster", 
    "promptVersion": "1.0", 
    "definitionVersion": "1.0", 
    "variations": [ 
    { 
     "type": "PlainText", 
     "value": "Great. And for which taster number?" 
    } 
    ] 
} 
], 
"dialog": { 
"version": "1.0", 
"intents": [ 
    { 
    "name": "RateWineIntent", 
    "confirmationRequired": true, 
    "prompts": { 
     "confirm": "Confirm.Intent-RateWineIntent" 
    }, 
    "slots": [ 
     { 
     "name": "wine", 
     "type": "AMAZON.NUMBER", 
     "elicitationRequired": true, 
     "confirmationRequired": false, 
     "prompts": { 
      "elicit": "Elicit.Intent-RateWineIntent.IntentSlot-wine" 
     } 
     }, 
     { 
     "name": "rating", 
     "type": "AMAZON.NUMBER", 
     "elicitationRequired": true, 
     "confirmationRequired": false, 
     "prompts": { 
      "elicit": "Elicit.Intent-RateWineIntent.IntentSlot-rating" 
     } 
     }, 
     { 
     "name": "taster", 
     "type": "AMAZON.NUMBER", 
     "elicitationRequired": true, 
     "confirmationRequired": false, 
     "prompts": { 
      "elicit": "Elicit.Intent-RateWineIntent.IntentSlot-taster" 
     } 
     } 
    ] 
    } 
] 
} 
} 

、ここでは、応答は次のとおりです。

{ 
"session": { 
"sessionId": "MY-SESSION-ID", 
"application": { 
    "applicationId": "MY-APPLICATION-ID" 
}, 
"attributes": {}, 
"user": { 
    "userId": "MY-USER-ID" 
}, 
"new": true 
}, 
"request": { 
"type": "IntentRequest", 
"requestId": "REQUEST-ID", 
"locale": "en-US", 
"timestamp": "2017-05-18T06:41:56Z", 
"intent": { 
    "name": "RateWineIntent", 
    "slots": { 
    "taster": { 
     "name": "taster" 
    }, 
    "rating": { 
     "name": "rating" 
    }, 
    "wine": { 
     "name": "wine" 
    } 
    } 
} 
}, 
"version": "1.0" 
} 

私はスロットを埋めることができますが、それはdialogStateを生成しません。何か案は?誰でもあなたのドットで叫ぶことなくこれをテストするより良い方法を見つけ出すでしょうか?

+0

echosim.ioで叫んでいますか? –

+0

ちょうど冗談です。私は興奮したときに、ダイアログとオプションのスロットを導入した。私はこのようなもののために自分自身の有限状態マシンを開発していました。私はunittestを使って適切にテストすることができるので、自分の実装を依然として好んでいることが分かりました。興味があれば:https://github.com/josepvalls/ask.py –

+0

ありがとう@ジョセフ、しかし私はバックエンドのためにRORを使用しています。私は結局それを理解した。私は完全な応答JSONを返していませんでした。私は、ドキュメントに基づいて、ダイアログではレスポンスを省略したと考えました。実際にはうまくいき、手作業でスロットを埋めるのに多くの時間を節約できます。 – BrainstormWilly

答えて

0

問題は私の反応でした。私はAmazonのドキュメントで読んでいた内容に基づいて、回答の一部分を<Directive/>に戻していました。問題がどこにあるのか。 Alexaで作業したいプログラマーに私の提案はhereです。間違いはテストするのが難しいので、リクエスト/レスポンスJSONを学んでください。 Amazonのドキュメントは、プログラミングの前に声のデザインについて学習するように強制しているようだが、これは馬の前にカートを置いていると思う。

関連する問題