Open mickster04 opened 7 years ago
Hi Mick,
I haven't gotten around to figuring out how the new slot elicitation APIs work due to busyness at work and some visa expiration issues. (This project is a bit old now). Your API design looks good. Send a PR if you get the chance otherwise I will implement it once I have some free time.
Right, so basically your reponse object seems to be missing enough https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/dialog-interface-reference
the bits below in Bold are what you have already, the directives are what is missing it seems. I actually have very little experience with python so I'm not sure I can help!
I think the updated intent will be provided in the request object. so we probably just need a way to access that slot in the request to check it and a way to request an elicit slot message, so the API should be almost identical to what you already have but we just need to be able to specific a dialog directive
{
**"version": "1.0",**
"sessionAttributes": {},
**"response": {
"outputSpeech": {
"type": "PlainText",
"text": "From where did you want to start your trip?"
},
"shouldEndSession": false**,
"directives": [
{
"type": "Dialog.ElicitSlot",
"slotToElicit": "fromCity",
"updatedIntent": {
"name": "PlanMyTrip",
"confirmationStatus": "NONE",
"slots": {
"toCity": {
"name": "toCity",
"confirmationStatus": "NONE"
},
"travelDate": {
"name": "travelDate",
"confirmationStatus": "NONE",
"value": "2017-04-21"
},
"fromCity": {
"name": "fromCity",
"confirmationStatus": "NONE"
},
"activity": {
"name": "activity",
"confirmationStatus": "NONE"
},
"travelMode": {
"name": "travelMode",
"confirmationStatus": "NONE"
}
}
}
}
]
}
}
Sounds good. I'll take a look at it in a few days now that I have some time :) It's time to build a new skill and make sure everything is working smoothly.
The create response method doesn't seem documented in terms of how to do things like elicitSlot/ElicityIntent etc. if the create response method should not be responsible for this, I can't find how else to create responses back to alexa.
I would have anticipated it to look something like
alexa.elicit_slot(slot='myMissingSlot', message='can you please provide the missing detail about "missingSlot"') the reason I do this is because the slot value may be present in the session (and so I shouldn't make it manditory), but not until it has been submitted the first time. Not sure how to do this with this library.