私はこれで自分自身に苦労していて、今は動作させています。 アマゾンが提供するサンプルのAlexaSkill.jsモジュールを使用している場合は、 にピクチャカードを扱うためにいくつかのセクションを追加する必要があります。
buildSpeechletResponseセクションは、同様のタイプ 「シンプル」セクションの後にこれを追加して:さらに下askWithCard定義の後に続いて
if (options.cardSmallImageURL && options.cardLargeImageURL) {
alexaResponse.card = {
type: "Standard",
title: options.cardTitle,
text: options.cardContent,
image: {
smallImageUrl: options.cardSmallImageURL,
largeImageUrl: options.cardLargeImageURL
}
};
}
すると、この追加:今、あなたはそれを呼び出すことができます
askWithPictureCard: function(speechOutput, repromptSpeech, cardTitle, cardContent, smallImageURL, largeImageURL) {
this._context.succeed(buildSpeechletResponse({
session: this._session,
output: speechOutput,
reprompt: repromptSpeech,
cardTitle: cardTitle,
cardContent: cardContent,
cardSmallImageURL: smallImageURL,
cardLargeImageURL: largeImageURL,
shouldEndSession: false
}));
を、おそらく定数ではなく変数を使用しています。 は、
response.askWithPictureCard(「これは、音声出力は」、「これはカードのタイトルである」「これは 再プロンプトで」「これは、カードのテキストがあり、 フィールドはテキストcardContentないと呼ばれて注意してください」 [0123]
次に、同様のプロセスに従ってtellWithPictureCard関数を追加します。