I am attempting to implement the Built-In YesIntent and NoIntent...
HelpIntent works, and I've copied the Function I call for the HelpIntent and just customizing it i.e:
HelpIntent function (NOTE - this works) :
def get_help_response():
session_attributes = {}
card_title = "Help"
speech_output = "<speak>You can say something like ... </speak>"
caption = None
sm_img = None
lg_img = None
reprompt_text = "You can say something like ...."
should_end_session = False
return build_response(session_attributes, build_speechlet_response(
card_title, speech_output, caption, sm_img, lg_img, reprompt_text, should_end_session))
I do the same exact thing for YesIntent and NoIntent function but customize the answer a bit:
def get_yes_response():
session_attributes = {}
card_title = "Yes"
speech_output = "<speak> Yes response speech output</speak>"
caption = None
sm_img = None
lg_img = None
reprompt_text = "Yes response speech output."
should_end_session = False
return build_response(session_attributes, build_speechlet_response(
card_title, speech_output, caption, sm_img, lg_img, reprompt_text, should_end_session))
Whenever I test "Yes" or "No" - I can see that the Intent is correctly identified and Lambda attempts to come back with a response but I get the following error:
An error occurred during JSON serialization of response: <function get_yes_response at 0x7f4743de0848> is not JSON serializable
Traceback (most recent call last): File "/usr/lib64/python2.7/json/__init__.py", line 250, in dumps sort_keys=sort_keys, **kw).encode(obj)
File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode return _iterencode(o, 0)
File "/var/runtime/awslambda/bootstrap.py", line 41, in decimal_serializer raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function get_yes_response at 0x7f4743de0848> is not JSON serializable
I dont see why there would be a problem with the JSON. Any idea what's going on here?