Exemple #1
0
    def handle(self, handler_input, exception):
        # type: (HandlerInput, Exception) -> Response
        logger.error(exception, exc_info=True)

        speak_output = "Sorry, I had trouble doing what you asked."

        return (handler_input.response_builder.speak(speak_output).response)


# The SkillBuilder object acts as the entry point for your skill, routing all request and response
# payloads to the handlers above. Make sure any new handlers or interceptors you've
# defined are included below. The order matters - they're processed top to bottom.

sb = SkillBuilder()

sb.skill_id = os.environ['SKILL_ID']

sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(ConditionsIntentHandler())
sb.add_request_handler(TemperatureIntentHandler())
sb.add_request_handler(HumidityIntentHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())
sb.add_request_handler(
    IntentReflectorHandler()
)  # make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers

sb.add_exception_handler(CatchAllExceptionHandler())

handler = sb.lambda_handler()
Exemple #2
0
        return (
            handler_input.response_builder
                .speak(speak_output)
                .ask(speak_output)
                .response
        )

# The SkillBuilder object acts as the entry point for your skill, routing all request and response
# payloads to the handlers above. Make sure any new handlers or interceptors you've
# defined are included below. The order matters - they're processed top to bottom.


sb = SkillBuilder()

# Set the skill id
sb.skill_id = "amzn1.ask.skill.2d62eb22-4646-47f1-ba03-295dbfacf8c9"

sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(InternInformationHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())
sb.add_request_handler(IntentReflectorHandler()) # make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers

sb.add_exception_handler(CatchAllExceptionHandler())

def handler(event, context):
    
    return sb.lambda_handler()(event, context)
Exemple #3
0
        return (
            handler_input.response_builder
                .speak(speak_output)
                .ask(speak_output)
                .response
        )

# The SkillBuilder object acts as the entry point for your skill, routing all request and response
# payloads to the handlers above. Make sure any new handlers or interceptors you've
# defined are included below. The order matters - they're processed top to bottom.


sb = SkillBuilder()

sb.skill_id = "amzn1.ask.skill.ea567276-e1e5-4f4f-9544-adbec87dcc2d"

sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(PickThreeIntentHandler())
sb.add_request_handler(PickTwoIntentHandler())
sb.add_request_handler(OneFavIntentHandler())
sb.add_request_handler(TwoFavIntentHandler())
sb.add_request_handler(ThreeFavIntentHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())
sb.add_request_handler(IntentReflectorHandler()) # make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers

sb.add_exception_handler(CatchAllExceptionHandler())

lambda_handler = sb.lambda_handler()