I'm trying to build a custom Alexa skill for a gratitude diary. The goal is to have an interaction in which the Alexa device asks the user what they're grateful for, and repeats it back as confirmation.
I'm encountering a problem when it comes to repeating back what the user has said. I'd like the conversation to go like this:
Alexa: What are you grateful for today?
User I'm grateful for dogs
Alexa: You said you're grateful for dogs. Is that correct?
I've set this up as a single intent, as follows:
gratitude_object
as a required slot, of type AMAZON.SearchQuery- user utterances for this slot are
I'm grateful for {gratitude_object}
(and a few variations) - confirmation message for this slot is
You're feeling grateful for {gratitude_object}. Is that correct?
The problem I'm encountering is that when I test this model in the Utterance Profiler, it goes like this:
Alexa: What are you grateful for today?
User I'm grateful for dogs
Alexa: You said you're grateful for I'm grateful for dogs. Is that correct?
I'm guessing this is something to do with the fact that AMAZON.SearchQuery will accept anything as valid input, but I'm not sure how to go about resolving this.
I've also tried creating a custom slot for the I'm grateful for
phrase:
- slot name:
gratitude_phrase_initiator
- slot type: custom slot type
- slot values: "I'm grateful for", "I am grateful for" (etc)
However, if I then try to use this slot in my intent, by making the user utterance for the gratitude_object
slot:
{gratitude_phrase_initiator} {gratitude_object}
...then I get the following error:
Sample utterance "{gratitude_statement_initiator} {gratitude_object}" for slot "gratitude_object" in intent "NewEntryIntent" cannot include both a phrase slot and another intent slot. Error code: InvalidSlotSamplePhraseSlot
.
I'd really like to keep the interaction as it is currently, with the user starting by saying "I'm grateful for...". Any suggestions for how I could make this work using the interaction model, or is it just impossible? Is this something I could handle in the code instead of the interaction model?