I am just playing around and thought why not creating a simple Alexa Skill. I created a Skill hosted by Alexa. Added the intent handler like this
class ShutdownPCIntentHandler(AbstractRequestHandler):
"""Handler for Hello World Intent."""
def can_handle(self, handler_input):
return ask_utils.is_intent_name("ShutdownPCIntent")(handler_input)
def handle(self, handler_input):
speak_output = "test"
return (
handler_input.response_builder
.speak(speak_output)
.response
)
and of course added the handler down in the skill builder
sb = SkillBuilder()
sb.add_request_handler(LaunchRequestHandler())
sb.add_request_handler(ShutdownPCIntentHandler())
sb.add_request_handler(HelloWorldIntentHandler())
sb.add_request_handler(HelpIntentHandler())
sb.add_request_handler(CancelOrStopIntentHandler())
sb.add_request_handler(FallbackIntentHandler())
sb.add_request_handler(SessionEndedRequestHandler())
sb.add_request_handler(IntentReflectorHandler())
these are the only changes I made to the code
I also added the intent
buf for some reason alexa does not answere
can somebody help me?
I tried changing the code and intents but nothing really did something good. Now I am clueless. Thanks in advance
I can see that the JSON input/output stays empty on the picture you attached, this means that the answer you see in the simulator is not coming from your skill.
This could be happening because your intent handlers are not keeping the session open, you can do it by setting the shouldEndSession parameter to true, or by sending a .reprompt().
I recommend you the course we have called "from zero to hero" in our Youtube channel, please see the first video of this course that will help you to create your skill:
https://www.youtube.com/watch?v=CzTKDu7Qgjs
Additional guides can be found on the Alexa GitHub page here: https://github.com/alexa/