Why is my Alexa Skill not reactiong with my intents?

61 Views Asked by At

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

intents for the skill

buf for some reason alexa does not answere

test environment

can somebody help me?

I tried changing the code and intents but nothing really did something good. Now I am clueless. Thanks in advance

2

There are 2 best solutions below

0
Ilyt_A On

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/

0
Craig Walls On

I've had this happen to me when I accidentally invoke someone else's skill that has the same (or very similar) invocation name. The way this usually happens:

  1. I create a new skill with some invocation name that might be used by other skill. "Hello World" for example.
  2. I either forget to deploy my skill or for some reason skill deployment is slow or fails and I don't notice. If it's an Alexa-hosted skill, for example, it might take a moment for the changes to be picked up and deployed after I push them into Git.
  3. For whatever reason (slowness, deployment error, I simply forgot to deploy it, etc) the skill isn't yet available when I say "Alexa, open Hello World". So, instead of invoking my skill, it invokes someone else's skill.
  4. Now that skill is the one attached to my account and no amount of changes to my skill will change that. No matter what code I change, it will still use someone else's skill and not mine.

If that's the case, how do you fix it? You'll need to go into the Alexa app on your phone/tablet, tap the "More" button on the bottom right, then tap the "Skills & Games" button near mid-screen, swipe up to go all the way to the bottom of that screen, tap on "Your Skills", find the skill that's causing you trouble in the list and top on it, then tap on "Settings", then tap on "Disable Skill". This will detach it from your account and now (assuming that your skill has been deployed successfully) your skill will be used when you invoke it with your chosen invocation name.