エコーショーのスキルを開発中です。しかし、私はすべての表示テンプレートとpythonラムダスキルからものを表示することができません。私はアレクサのスキルを完璧に行い、うまく動作するイメージURLを追加することができます。しかし、表示テンプレートを追加すると、無効な応答が表示されています。エコー表示pythonスキルが表示テンプレートを生成しない
私はこのチュートリアル https://medium.freecodecamp.org/how-to-design-and-code-alexa-skills-for-amazons-echo-show-c5716da8fee5
を踏襲しており、これはJSONレスポンスに追加する追加のパラメータでした。
directives: [
{
type: “Display.RenderTemplate”,
template: {
type: “BodyTemplate1”,
token: “T123”,
backButton: “HIDDEN”,
backgroundImage: {
contentDescription: “StormPhoto”,
sources: [
{
url: “https://s3.amazonaws.com/hurricane-data/hurricaneBackground.png”
}
]
},
title: “Hurricane Center”,
textContent: {
primaryText: {
text: output,
type: “PlainText”
}
}
}
}],
これは私の修正されたレンダリングテンプレートメソッドの外観です。 デフbuild_speechlet_response(タイトル、出力、reprompt_text、should_end_session): imgurl = "https://thesweetsetup.com/wp-content/uploads/2014/10/scanbot_ico_1024.png"
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
},
'card': {
'type': 'Standard',
'title': title,
'text': output,
"image": {
"smallImageUrl": imgurl,
"largeImageUrl": imgurl
}
},
'reprompt': {
'outputSpeech': {
'type': 'PlainText',
'text': reprompt_text
}
},
directives: [
{
type: “Display.RenderTemplate”,
template: {
type: “BodyTemplate1”,
token: “T123”,
backButton: “HIDDEN”,
backgroundImage: {
contentDescription: “StormPhoto”,
sources: [
{
url: “https://s3.amazonaws.com/hurricane-data/hurricaneBackground.png”
}
]
},
title: “Hurricane Center”,
textContent: {
primaryText: {
text: output,
type: “PlainText”
}
}
}
}],
'shouldEndSession': should_end_session
}
しかし、これは私を与えます無効な応答形式としてのエラー。私はここで間違っています。