sb.add_request_handler(StarAgeIntentHandler()) # Planets sb.add_request_handler(PlanetDistanceHandler()) sb.add_request_handler(PlanetSizeHandler()) sb.add_request_handler(PlanetAgeIntentHandler()) # endregion sb.add_request_handler(YesLearnMoreIntentHandler()) sb.add_request_handler(NoLearnMoreIntentHandler()) sb.add_request_handler(YesReviewSolarSystem()) sb.add_request_handler(NoReviewSolarSystem()) sb.add_request_handler(YesPlayAgainHandler()) sb.add_request_handler(NoPlayAgainHandler()) sb.add_request_handler(RepeatHandler()) sb.add_global_request_interceptor(SetupRequestInterceptor()) sb.add_global_response_interceptor(SaveSessionAttributesResponseInterceptor()) sb.add_exception_handler(AllExceptionHandler()) sb.add_request_handler(FallbackHandler()) lambda_handler = sb.lambda_handler()
# type: (HandlerInput) -> None logger.info("Request Envelope: {}".format( handler_input.request_envelope)) class ResponseLogger(AbstractResponseInterceptor): """Log the response envelope.""" def process(self, handler_input, response): # type: (HandlerInput, Response) -> None logger.info("Response: {}".format(response)) sb = StandardSkillBuilder() sb.add_request_handler(LaunchRequestHandler()) sb.add_request_handler(InProgressHowMuchIntent()) sb.add_request_handler(InProgressHowManyIntent()) sb.add_request_handler(HowMuchIsCryptoInFiat()) sb.add_request_handler(HowManyCryptoCanIBuy()) sb.add_request_handler(HelpIntentHandler()) sb.add_request_handler(FallbackIntentHandler()) sb.add_request_handler(SessionEndedHandler()) sb.add_request_handler(RepeatHandler()) sb.add_exception_handler(CatchAllExceptionHandler()) sb.add_global_request_interceptor(RequestLogger()) sb.add_global_response_interceptor(ResponseLogger()) lambda_handler = sb.lambda_handler() #End of program
skill_builder.add_request_handler(ShuffleOnEpisodeHandler()) skill_builder.add_request_handler(ShuffleOffEpisodeHandler()) skill_builder.add_request_handler(StartOverEpisodeHandler()) skill_builder.add_request_handler(RepeatEpisodeHandler()) skill_builder.add_request_handler(PreviousEpisodeHandler()) skill_builder.add_request_handler(NextEpisodeHandler()) skill_builder.add_request_handler(LoopOnEpisodeHandler()) skill_builder.add_request_handler(LoopOffEpisodeHandler()) skill_builder.add_request_handler(HelpHandler()) skill_builder.add_request_handler(FallbackHandler()) # Event Handlers skill_builder.add_request_handler(PlaybackNearlyFinishedHandler()) skill_builder.add_request_handler(PlaybackFailedHandler()) skill_builder.add_request_handler(PlaybackStartedHandler()) skill_builder.add_request_handler(PlaybackStoppedHandler()) skill_builder.add_request_handler(PlaybackFinishedHandler()) # Request Interceptors skill_builder.add_global_request_interceptor(RequestLogger()) skill_builder.add_global_request_interceptor(LoadStateRequestInterceptor()) # Response Interceptors skill_builder.add_global_response_interceptor(ResponseLogger()) skill_builder.add_global_response_interceptor(SaveStateResponseInterceptor()) # Exception Handler skill_builder.add_exception_handler(CatchAllExceptionHandler()) lambda_handler = skill_builder.lambda_handler()
return personClass sb = StandardSkillBuilder() sb.add_request_handler(LaunchRequestHandler()) sb.add_request_handler(WishAddInIntentHandler()) sb.add_request_handler(WishListIntentHandler()) sb.add_request_handler(WishDeleteIntentHandler()) sb.add_request_handler(AnswerClassIntentHandler()) sb.add_request_handler(PremiumInfoIntentHandler()) sb.add_request_handler(ShoppingIntentHandler()) sb.add_request_handler(BuyIntentHandler()) sb.add_request_handler(CancelSubscriptionIntentHandler()) sb.add_request_handler(HelpIntentHandler()) sb.add_request_handler(CancelIntentHandler()) sb.add_request_handler(StopIntentHandler()) sb.add_request_handler(YesIntentHandler()) sb.add_request_handler(NoIntentHandler()) sb.add_request_handler(SessionEndedRequestHandler()) sb.add_request_handler(BuyResponseHandler()) sb.add_request_handler(CancelResponseHandler()) # make sure IntentReflectorHandler is last so it doesn't override your custom intent handlers sb.add_request_handler(IntentReflectorHandler()) sb.add_global_request_interceptor(LocalizationInterceptor()) sb.add_exception_handler(CatchAllExceptionHandler()) handler = sb.lambda_handler()
# Need to explicitly register each one sb.request_handlers.extend([ LaunchRequestHandler(), FactNumberIntentHandler(), StartOverIntentHandler(), HelpIntentHandler(), StopOrCancelIntentHandler(), SessionEndedRequestHandler(), YesIntentHandler(), NoIntentHandler(), FallbackIntentHandler(), WriteCodeIntentHandler(), ListUpgradesIntentHandler(), BuyUpgradeIntentHandler(), LinesPerSecondIntentHandler(), TheBestIntentHandler(), DemoCheatIntentHandler(), ResetIntentHandler(), CodebaseIntentHandler(), QuickMenuIntentHandler(), SuggestionIntentHandler() ]) sb.add_exception_handler(AllExceptionHandler()) sb.add_global_request_interceptor(LoggingRequestInterceptor()) sb.add_global_response_interceptor(LoggingResponseInterceptor()) handler = sb.lambda_handler()
sb.add_request_handler(PreviousCommandHandler()) sb.add_request_handler(PausePlaybackHandler()) sb.add_request_handler(PauseCommandHandler()) sb.add_request_handler(LoopOnHandler()) sb.add_request_handler(LoopOffHandler()) sb.add_request_handler(ShuffleOnHandler()) sb.add_request_handler(ShuffleOffHandler()) sb.add_request_handler(StartOverHandler()) sb.add_request_handler(CancelOrStopIntentHandler()) sb.add_request_handler(PlaybackStartedEventHandler()) sb.add_request_handler(PlaybackFinishedEventHandler()) sb.add_request_handler(PlaybackStoppedEventHandler()) sb.add_request_handler(PlaybackNearlyFinishedEventHandler()) sb.add_request_handler(PlaybackStartedEventHandler()) sb.add_request_handler(PlaybackFailedEventHandler()) # Exception handlers sb.add_exception_handler(CatchAllExceptionHandler()) # Interceptors sb.add_global_request_interceptor(RequestLogger()) sb.add_global_request_interceptor( LoadPersistenceAttributesRequestInterceptor()) sb.add_global_response_interceptor(ResponseLogger()) sb.add_global_response_interceptor( SavePersistenceAttributesResponseInterceptor()) # AWS Lambda handler lambda_handler = sb.lambda_handler()
# type: (HandlerInput) -> bool return is_intent_name("AMAZON.NoIntent")(handler_input) def handle(self, handler_input): # type: (HandlerInput) -> Response speech_text = "O.K." handler_input.response_builder.speak(speech_text).set_should_end_session(False) return handler_input.response_builder.response sb.add_request_handler(LaunchRequestHandler()) sb.add_request_handler(GetSpeeds()) sb.add_request_handler(GetToll()) sb.add_request_handler(GetTollHoursHandler()) sb.add_request_handler(GetDetailsHandler()) sb.add_request_handler(HelpIntentHandler()) sb.add_request_handler(CancelAndStopIntentHandler()) sb.add_request_handler(SessionEndedRequestHandler()) sb.add_exception_handler(AllExceptionHandler()) sb.add_global_request_interceptor(SkillInitializer()) sb.add_request_handler(SaveTrip()) sb.add_request_handler(GetFavs()) sb.add_request_handler(ListInterchanges()) sb.add_request_handler(GetSpecificHelp()) sb.add_request_handler(YesIntentHandler()) sb.add_request_handler(NoIntentHandler()) handler = sb.lambda_handler()