Alexa doesnt send request with AMAZON.StopIntent - alexa

Alexa doesnt send an IntentRequest containing the AMAZON.StopIntent if i try to invoke it using my echo device or the service simulator. I tried to invoke it using the common utterances listed here, but i never get a request. It only makes my echo device stop listening. Instead i would like to send out a response containing an outputSpeech saying 'Good Bye' and shouldEndSession set 'true'.
However, as soon as i start a new Session, my skill receives a SessionEndedRequest with the reason saying "USER_INITIATED".
It also doesnt work using the Service Simulator, typing in the common utterances i provided.
It also doesnt make a difference if i put sample utterances equals the common utterances.
Any ideas?
[edit] the skill is in german

It sounds like you don't have AMAZON.StopIntent defined in your interaction model. Did you confirm that you have something like the following your interaction model?
{
"name": "AMAZON.StopIntent",
"samples": []
}

Related

Why does my Alexa Skill stop with an error sound?

First, I should clarify that I have the built-in Fallback intent set up properly and it triggers every time when I try to issue a rubbish command.
The problem occurs when I issue a command that is defined in a custom slot. For example, I have a custom slot type with the following slot values defined: apple, tomato, onion.
This slot type is added in a custom intent with the following utterances: Information about {food}, info about {food}.
So, in the intent utterances, I have not defined an utterance for the slot alone, i.e. just {food}.
Now, when Alexa is expecting a command, if I say just "apple", it gives an error tone and stops the skill without any error information. I realized that this happens when Alexa can't map the utterance to any intent, but I cannot figure out why it is not triggering the Fallback intent when this happens.
I opened the Utterance Profiler and tried the command there and all I get is that no intents have been triggered with that utterance. For other utterances, in this case if I use "orange" which is not defined in the slot types, it will map to the Fallback intent.
Does anyone have any ideas how I can solve this?

Porting an Alexa Skill - completing or continuing the dialog

I have a skill in Alexa, Cortana and Google and in each case, there is a concept of terminating the flow after speaking the result or keeping the mic open to continue the flow. The skill is mostly in an Http API call that returns the information to speak, display and a flag to continue the conversation or not.
In Alexa, the flag returned from the API call and passed to Alexa is called shouldEndSession. In Google Assistant, the flag is expect_user_response.
So in my code folder, the API is called from the Javascript file and returns a JSON object containing three elements: speech (the text to speak - possibly SSML); displayText (the text to display to the user); and shouldEndSession (true or false).
The action calls the JavaScript code with type Search and a collect segment. It then outputs the JSON object mentioned above. This all works fine except I don't know how to handle the shouldEndSession. Is this done in the action perhaps with the validate segment?
For example, "Hi Bixby, ask car repair about changing my tires" would respond with the answer and be done. But something like "Hi Bixby, ask car repair about replacing my alternator". In this case, the response may be "I need to know what model car you have. What model car?". The user would then say "Toyota" and then Bixby would complete the dialog with the answer or maybe ask for more info.
I'd appreciate some pointers.
Thanks
I think it can easily be done in Bixby by input prompt when a required input is missing. You can build input-view to better enhance the user experience.
To start building the capsule, I would suggest the following:
Learn more about Bixby on https://bixbydevelopers.com/dev/docs/dev-guide
Try some sample capsules and watch some tutorial videos on https://bixbydevelopers.com/dev/docs/sample-capsules
If you have a Bixby enabled Samsung device, check our marketplace for ideas and inspirations.

Can't respond to Alexa Unhandled Intent

My Unhandled Intent is specified as follows:
'Unhandled': function() {
console.log('#Unhandled');
console.log('The skill will crash now :(');
this.emit(':tell', this.t('UNHANDLED_MESSAGE'));
}
I can see in my logs that this function is called. However the emit-Call is completely ignored by Alexa. Instead I get a sound like "dudu" and the skill closes.
Can someone explain to me how I can use this function to tell something to the user, instead of closing the skill?
I'm not sure, but is this.t maybe not matching something? If you just emit text like this.emit(':tell', 'this is unhandled'); does it respond?
I had similar experience, but in my case 'Unhandled' is not called, and my skill is closed with "dudu" sound.
I could not find official document to explain it, but 'Unhandled' is called when you use "state" in your script.
If I use state in my script, then 'Unhandled' is called.
This is a blog refering state in Alexa skills.
https://developer.amazon.com/blogs/alexa/post/Tx213D2XQIYH864/announcing-the-alexa-skills-kit-for-node-js

IntentRequest triggered by Response - without user-invocation

lets say i have a skill with 2 custom intents, 'FirstIntent' and 'SecondIntent'. SecondIntent also has a required slot, 'reqSlot'.
Now, i would like to sequence my intents. After my skill sent the FirstIntent-response, i would like Alexa to send a request with SecondIntent and a directive to elicit reqSlot, without the user to invoke it.
They say here, at the parameter 'updatedInted':
"Note that you cannot change intents when returning a Dialog directive, so the intent name and set of slots must match the intent sent to your skill."
Is this generally possilbe or did anyone figure out a workaround for this scenario?
Thanks :)
There are ways to handle this.
You can try:
When you send your first response it must set the shouldEndSession flag to false.
The end of your first response's output speech should lead the user into invoking the second response. For example: 'Say telephone number followed by your number'.
This way the user doesn't need to explicitly invoke your skill to get to the next intent.
It is not currently possible to cause Alexa to start speaking without a user first having spoken to it.
So for example, I cannot create a skill that will announce to my wife that "Ron is on his way home" whenever I leave work.
I can however, create a skill that my wife can ask "Is Ron on his way home", and it can respond with the answer.
Also, the new notifications allow a skill to post a notification, but this just causes the Alexa to light up its circular ring to indicate that a notification is waiting. A user must still ask Alexa to read it. In the example I cite above, that might be ok.
A lot of us would love for Alexa to be able to spontaneously start talking, but Amazon has not enabled that. Can you just imagine the opportunity for advertising abuse that functionality might enable? Nothing like sitting down watching TV and having Alexa start talking, "Hey, wouldn't some Wonder Popcorn taste great about now? We're having a sale..."

Alexa skill 2 intents and open slot

Is it possible that Alexa reacts right when I have in a sample utterances something like this, opened slots?
MyNameIsIntent {firstname}
ProjektIntent {projekt}
Right now she always goes back to MyNameIsIntent even if she ask a question for a ProjektIntent
The bad conversation:
Alexa: Welcome, what is your name?
Me: Frank
Alexa Hi Frank, Tell me what project is interesting for you?
Me: Teleshoping
Alexa: Hi Teleshoping, Tell me what project is interesting for you?
Im totally new to Alexa, could you give me please a tip if it is possible that Alexa answers the right question? I tried to do it with a session atributes but it doesn't work
An utterance file like that won't work. Alexa uses the text of the utterance - the stuff aside from the slot name, of which you have none - to choose an intent.
So, unfortunately you can't design your interactions to allow for a response of just 'Teleshoping'. Instead, the user would have to say something like 'I'm interested in Teleshoping' (you would need to tell them to say it like that), and the sample utterance would be 'I'm interested in {projekt}'.
You can use States do react differently on the same intents depending on the state of your application.
See https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs#making-skill-state-management-simpler for the official documentation.
You create a dictionary of StateHandlers like this (in Node.js 4.3):
var askNameStateHandlers = Alexa.CreateStateHandler("askNameState",
{
"MyIntent": function () { /* ... */ }
// more handlers ...
});
Then you register your handlers like this, assuming you have a dictionary of handlers without states defaultHandlers and two with handlers for a specific state askNameStateHandlers and askProjectStateHandlers:
exports.handler = function(event, context, callback) {
var alexa = Alexa.handler(event, context);
alexa.registerHandlers(defaultHandlers, askNameStateHandlers, askProjectStateHandlers);
alexa.execute();
};
To change the state of your application, simply assign it like this inside a handler function:
this.handler.state = "askNameState";
The alexa-sdk will then take care of calling the right handler depending on your application state.
There is also a full example implementation at https://github.com/alexa/skill-sample-nodejs-highlowgame
Note that this way, you will only have one intent MyIntent who accepts the answers to both questions, deciding which of your functions should handle the result based on the application state only.
And just to add a little further clarification to Tom's answer, Alexa can't tell if the word "teleshoping" is your first name or project.
If you use longer utterances as Tom mentions, such as "my name is {firstname}" and "I want to {projekt}" then Alexa will have no trouble discerning.
You can also help Alexa tell the difference by filling in the slot values, but this assumes that you know what the possible projekt values will be.
firstname can use the builtin AMAZON.US_FIRST_NAME slottype.

Resources