I am developing a skill for echo show. However i am not able to display all the display templates and stuff from python lambda skill. I am able to do the alexa skill perfectly and able to add image url's which works fine. But when display template is added,it is showing invalid response.
I have followed this tutorial https://medium.freecodecamp.org/how-to-design-and-code-alexa-skills-for-amazons-echo-show-c5716da8fee5
And this was the extra parameter to be added to the json response.
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”
}
}
}
}],
This is how my modified render template method looks like. def build_speechlet_response(title, output, 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
}
But this gives me error as invalid response format.What am i doing wrong here.
This worked for me in python. But not able to render the list template.
The text_response,speech_response,secondary_text,teritary_text are all string parameters added.