I have an alexa skill and I'm using Dialog Management for dynamically elicit slot.
For example I have one Intent that called OrderIntent with 3 slots: drink, coffeRoast, teaType.
When a user asks for a drink for example coffee, I'm using ELICITSLOT to stay in OrderIntent and asking the user for the coffee roast or tea type.
It works great.
The problem is that when I'm waiting for the second answer from user (tea type/ coffee roast)
Alexa doesn't recognize other intents like AMAZON.StopIntent or AMAZON.CancelIntent
So when Alexa waits for the tea type/ coffee roast and the user say "stop" I get in my code the value "stop" for "teatype" instead of invoking the AMAZON.StopIntent and stop the session.
Is there any solution for that in Alexa? to use the ELICITSLOT option and still recognize the other intents?
Thanks!
Related
I want to create a skill that's a simple game, where first the user launches the skill with its invocation name and then Alexa asks a question, "Shall I roll the dice?" If the user answers "Yes," it rolls the dice, and says the result. Then Alexa asks again, "Shall I roll the dice?" If "Yes," do the same thing. This is the main loop I'm talking about, and it'll continue until the user answers "No" or "Quit" to this question.
I just can't figure out how to add the loop, or where it should go. I've looked at tutorials and videos and whatnot and just nothing I've found mentions a loop which I find really odd. But I'm a noob at this.
Any help would be awesome. I've been wanting to do this skill for so long but just am stuck on this loop thing.
I recommend you to take some time to understand how a skill work and then I recommend you to develop a quiz skill from this doc
You will then have a better understanding of how a request is made to Alexa service and how a response is returned. The logic behind Intent, how does a slot work, ...
An Alexa Skill is like a card game. The player can select any card at any time. Each card has its own function and is triggered by a voice.
So when the skill first asks the user for Shall I roll the dice?, the user will say either yes or no.
If the user says yes, it will then go to your AMAZON.YesIntent,
If the user says no, it will then go to your AMAZON.NoIntent.
But you also need to make sure that the user can also say:
Stop > Amazon.StopIntent
Anything else, such as, cheese > FallbackIntent
By doing the quiz skill cited above, you will understand how to build your interaction model effectively.
A loop is straightforward. If the user replies yes, then in your intent handler for AMAZON.YesIntent, you will need to trigger the same function that will inject, in the response builder the prompt: Shall I roll the dice ?.
Keep in mind that a user can also ask to repeat. Imagine a skill being a personal assistant. It's not a voice mail. There are many other ways to say Shall I roll the dice? to not sound like a robot. Try implementing different response values possible to have a great customer experience overall.
I am trying to make a mock interview skill on Alexa where the skill asks the user a question for example: "tell me about your background and experiences".
The user would give an answer, and when the user is done answering, he/she can say "next question" to get the next question.
So "next question" is really the only intent the app is waiting to hear. The problem is when the user is giving an answer for example:
"My name is Bob, I am from New York, I studied biology, etc.",
the session is still live, and Alexa obviously doesn't understand the intent so AMAZON.FallbackIntent gets triggered.
Is there a way to just return an empty string when AMAZON.FallbackIntent gets called so the mock interview session doesn't get disrupted?
Thank you!
It sounds like you need to control the session and constrain the user.
IMO Alexa has a lot of trouble with long user utterances. The problem really stems from the interaction model and the unpredictability of what a user will say. This blog post sheds some light on VUI issues (https://medium.com/hackernoon/lessons-learned-moving-from-web-to-voice-development-35daa1d301db). tl;dr - you have to maintain state and context.
One approach you can take is to ask the user specific questions. "What is your name?" should map to one intent and update the session/persistence with the slot value. Then you respond with the next question you want the user to answer(i.e. "Where do you live", "what university did you attend") , having another intent ready to handle that slot value. You have to realize that users can say anything at any point in your Alexa Skill session and your skill has to handle it.
Here's an Amazon Developer blog post that can help you better understand dialog management and slot confirmation: https://developer.amazon.com/blogs/alexa/post/3a23c045-b568-4a6a-8a8c-fd5511a08053/build-advanced-alexa-skills-confirm-what-customers-want-with-dialog-management
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.
I'm looking for a way that Alexa responds with a question after I give her a command. My case:
My setup is an Alexa with Samsung SmartThings with a ton of devices. When I tell Alexa --> Good morning, she disables my alarm and tells me the weather forecast. Now, I also want her to ask me back, if I would like a coffee. (I have a Wemos D1 in my Jura Z5 and a custom device handler in SmartThings). I don't always want a coffee, that's why I don't want to add it to my standard good morning routine. So it would be really cool if she could ask: "Would you like a coffee?" and I just have to reply "yes" or "no" and she does her thing.
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..."