class RepeatIntentHandler(AbstractRequestHandler):
"""Handler for repeating the response to the user."""
def can_handle(self, handler_input):
# type: (HandlerInput) -> bool
return is_intent_name("AMAZON.RepeatIntent")(handler_input)
def handle(self, handler_input):
# type: (HandlerInput) -> Response
#logger.info("In RepeatHandler")
attr = handler_input.attributes_manager.session_attributes
response_builder = handler_input.response_builder
#if "recent_response" in attr:
cached_response_str = json.dumps(attr["recent_response"])
cached_response = DefaultSerializer().deserialize(cached_response_str, Response)
#return cached_response
return cached_response
I have used this code for repeat intent. when the user said to repeat it will repeat the question, but after repeating, when the user will give a response(give an answer to that repeated question), the flow will not return back to the pervious intent. and my skill was stopped.
I also tried UpdateIntent.
return cached_response.handler_input.response_builder.speak(speak_output).add_directive(delegate_directive.DelegateDirective(updated_intent=Intent(name="QuestionIntent"))).response
but it will show an error like
AttributeError: 'Response' object has no attribute 'add_directive'
so how to solve this issue?