alexa-skills-kit

AudioPlayer “PlaybackNearlyFinished” Request of Alexa Skills Kit, Not Working

狂风中的少年 提交于 2019-12-07 13:48:45
问题 I've written an Alexa Skill that uses a Lambda Function to play unique audio from a given URL. The Intent called "PlayAudio" is working and plays the first audio item from our JSON-formatted API. The Intent called "PlaybackNearlyFinished" does not work, aka, does not play the audio file I am feeding it. Can anybody crack exactly why this doesn't work? Here is a section from my Lambda Function, which contains the two Intents: Fact.prototype.intentHandlers = { "PlayAudio": function (event,

Amazon Alexa - How to create Generic Slot

浪尽此生 提交于 2019-12-07 06:54:53
问题 How can I create a generic slot for an Alexa skill? So that I can create my own Todo app and it will recognise the free form text. 回答1: The Alexa blog announced a List Skill API. As mentioned above, the literal slot type is no longer supported for new skills. If you create a custom slot with a number of values - depending on your expected response values with a single word or 2+ words - Alexa will catch also spoken words not on the list and pass them to your skill. Transcription of these

How to return Dialog.Delegate directive to Alexa Skill model?

假如想象 提交于 2019-12-07 06:04:03
问题 I want to create a simple multi-turn dialog with the Alexa Skill model. My intent consists of 3 slots, each of which are required to fulfill the intent. I prompt every slot and defined all of the needed utterances. Now I want to handle the request with a Lambda function. This is my function for this specific Intent: function getData(intentRequest, session, callback) { if (intentRequest.dialogState != "COMPLETED"){ // return a Dialog.Delegate directive with no updatedIntent property. } else {

How to implement a next intent in alexa

吃可爱长大的小学妹 提交于 2019-12-06 16:09:46
How do you implement an 'AMAZON.NextIntent' in an alexa skill. suppose I have 3 audios(a1, a2, a3) enqueued and a1 is playing. If the user sends the request using 'nextIntent', what should be the response so that alexa plays a2? Alexa SDK provides you ability to keep the state in session attributes. For Node.js it's this.attributes . You can read more about here in Skill State Management section. You can keep the current step in that attribute. Once your skill is started you can set the current step to "first" (or 1, or whatever). Once the AMAZON.NextIntent is triggered, you check the state of

How to handle synonyms in intents in Alexa?

我的梦境 提交于 2019-12-06 07:21:39
问题 In the following example: If the user says toffee, shouldn't that be translated to candy? I ask because the value handed to my intent is 'toffee'. So not sure what I have incorrect. types":[ { "name":"SHOPPING_LIST", "values":[ { "id":null, "name":{ "value":"candy", "synonyms":[ "toffee" ] } }, { "name":"GetPrice", "samples":[ "Get me the price of {item}", "tell me the price of {item}", ], "slots":[ { "name":"item", "type":"SHOPPING_LIST" } ] } 回答1: We need to handle the entity resolution in

Alexa input validation for type AMAZON.NUMBER using dialog model

安稳与你 提交于 2019-12-06 04:11:25
I am using the ASK SDK 2.0 for Node.js. I have a skill that uses a dialog model to prompt the user for a series of inputs, all of which are required slots with the type AMAZON.NUMBER. When a user gives a numerical response, everything works fine. However, if the user gives a non-numeric response, such as "yellow", the slot value is filled in with: "value": "?" and moves on to propmpt the user for the input for the next slot. How can I get it to reprompt the user for that slot again if they provide an invalid response? I've poured over the documentation and can't find anything. Ideally I would

Returning handler.ResponseBuilder from promise.then() method

空扰寡人 提交于 2019-12-05 19:02:38
In one of the intent handler for my Alexa skill I have to return response once my promise is resolved. Code looks like this : var rcvPromise = receiveMsgQ(); rcvPromise.then(function(speechText) { console.log('rcv Promise resolved with ',speechText); return handlerInput.responseBuilder .speak(speechText) .withSimpleCard('skill_name', speechText) .withShouldEndSession(false) .getResponse(); }); Skill returns with ERROR message with no additional details about error. Is there any way to fix this problem? PS: I need to use promise as receiveMsgQ() is asynchronous function call. The error you're

AudioPlayer “PlaybackNearlyFinished” Request of Alexa Skills Kit, Not Working

瘦欲@ 提交于 2019-12-05 18:46:50
I've written an Alexa Skill that uses a Lambda Function to play unique audio from a given URL. The Intent called "PlayAudio" is working and plays the first audio item from our JSON-formatted API. The Intent called "PlaybackNearlyFinished" does not work, aka, does not play the audio file I am feeding it. Can anybody crack exactly why this doesn't work? Here is a section from my Lambda Function, which contains the two Intents: Fact.prototype.intentHandlers = { "PlayAudio": function (event, context, response) { fetchEnseParse("/latest", function(body) { if(body == "error") { } else { var

How to get an Alexa userId?

房东的猫 提交于 2019-12-05 13:11:54
问题 I'm building an Alexa Skill, and it requires that I store the userId of a user. I've tried to retrieve it with event.session.user.userId . However, when I call console.log(event.session.user.userId) the output is literally amzn1.ask.account.[unique-value-here] . I've looked at several similar questions, and none of them provide a clear enough answer for me. I'm not sure if this is a bug, a developer-only thing, or if the userId is simply anonymized. If so, is there a way to get the actual

ASK CLI to deploy to different environments?

笑着哭i 提交于 2019-12-05 12:14:13
Is it possible to use Alexa Skill Kit's ASK CLI deploy command to build, for example, a debug version of the app that deploys a development environment and a release version of the app that deploys to a test environment? My team and I are trying to deploy the same skill to two different environments, so our testing team can do their thing in the test environments and development can do their thing in the development environment. This will be a private skill so using http://developer.amazon.com separation of test and "prod" via publishing the application is not an option. There are probably a