question

Ed avatar image
Ed asked

Is it possible to exend AMAZON.NUMBER?

Is it possible to extend AMAZON.NUMBER with synonyms or new values?

I'm asking, "How many guests?" for a hotel room and trying to collect the answer using the AMAZON.NUMBER slot type. Numeric answers (1, 2, 3 ...) appear in the slot as expected. I've tried to extend AMAZON.NUMBER with non-numeric synonyms for 1 - "just me", "i'm solo", and so on but can only get "?" as the value of my filled slot.

Specifically, I'm defining the interaction model in the ASK console. I've created a slot, guestCount of type AMAZON.NUMBER. Under AMAZON.NUMBER, I've created a slot value=1 with synonyms "just me", "i'm solo". The Lambda function receives:

"guestCount": { "name": "guestCount", "value": "?", "confirmationStatus": "NONE"},

I get the same thing when I change the slot value from 1 to "solo". I've also tried adding synonyms as user utterances to the guestCount user utterances with no luck:

{
"name": "guestCount",
"type": "AMAZON.NUMBER",
"samples": [
"Only me.",
"I'm alone.",
"I'm solo.",
"Just me.",
"{guestCount}"
]
},

I get the same results whether I'm using the simulator and or speaking through an Echo.

I realize that I can make note of the "?" and reprompt for a number, but that's no fun.

Thanks in advance.

alexa skills kitslotsinteraction model
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image
Andy Whitworth answered

Can't you define an intent which has utterances like "I'm solo", "just me" etc etc in addition to an utterance of a single slot {guestCount} with guestCount being an AMAZON.NUMBER ? So rather than extend the numeric slot, you cope with the non-numeric options via the Intent utterances route. You could then determine how many guests you think the customer meant and send a confirm slot response to get the customer to confirm the number which you've either inferred or picked up from the guestCount slot value if populated.

Another approach would be to define a custom slot which had example values of numerics + the "solo", "just me" etc etc values. Your skill code would then parse the slot value and infer the customer number - again using the confirm slot response to get the customer to confirm what you've inferred.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ed avatar image
Ed answered

First of all, thanks!

What I'm hoping to accomplish is to designate the required slots and then hand data collection off to Alexa using Dialog.Delegate or elicitSlot. That should work if I can extend the AMAZON.NUMBER slot type.

If that can't be made to work, then I'm sure I can make it work using your suggestions or similar, possibly with trapping guestCount = "?" and using a custom slot and slot type. I've just tried defining a new slot, {solo}, of slot type soloType, with values "I'm solo" etc. and then tried to sneak {solo} in as an utterance for my {guestCount} slot. Nope.

Again, thanks.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Andy Whitworth avatar image
Andy Whitworth answered

I think my second suggestion is worth exploring, define a custom slot with example numeric values + "solo", "just me" etc. The Alexa AI will (should!) then accept all numeric values and also the textual variances you're also looking to cover. Your skill code would need to parse the slot values/synonyms, infer the number and seek confirmation via the confirm slot repsonse or the elicitslot response if you can't infer a number.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.