raj10071997 / Alexa-Voice-Service

MIT License
15 stars 10 forks source link

how to get my own intent #3

Closed kangshifu closed 7 years ago

kangshifu commented 7 years ago

eg:define a custom skills ,i speak alexa,please turn left,how can i get intent,them i can control my device to turn left,now i get the following json: { "directive":{ "header":{ "namespace":"SpeechSynthesizer", "name":"Speak", "messageId":"40099ed0-acff-42d4-b398-92f8ae0f1e16", "dialogRequestId":"dialogRequest-321" }, "payload":{ "url":"cid:ValidatedSpeakDirective_amzn1.ask.skill.3088929e-d56b-4b22-a246-67d28fe2aaf7_819da5fe-ac4f-40ea-9025-f799536207dd_698848474", "format":"AUDIO_MPEG", "token":"amzn1.as-ct.v1.ThirdPartySdkSpeechlet#ACRI#ValidatedSpeakDirective_amzn1.ask.skill.3088929e-d56b-4b22-a246-67d28fe2aaf7_819da5fe-ac4f-40ea-9025-f799536207dd" } } }

i can not get useable field to judge my intent

but when i say set a alarm,i get: { "directive":{ "header":{ "namespace":"Alerts", "name":"SetAlert", "messageId":"f8c02ddb-b0a3-45f7-bbce-c2725bedb8fb" }, "payload":{ "type":"ALARM", "scheduledTime":"2017-07-31T16:00:00+0000", "token":"amzn1.as-ct.v1.Domain:Application:Notifications#DNID#7f9c588c-64cf-3802-96da-b562cf6b2267" } } } so we can get the filed like "type".so i can set alarm in my project

so,how can i define a skills let amazon web service respone useable filed to judge my intent

look forward for your replay thanks

raj10071997 commented 7 years ago

Sorry for the late reply. You can't get your custom skill intent in json response. If you try to invoke your skill then you have to say "Alexa ask " and then the words set to invoke your skill . For instance, "Alexa ask turn off the light" and in response to that you will get the same response as the first one and not like the second one in which the type will be equal to your intent. As far as I think this is done to maintain the implementation process easy. You can get an expect speech directive if you have set you session to be continuous in your code while building your skill. And after that ask that question in your skill in which you have set the session to be ended.