Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a Slot that accepts a currency amount

I want to receive a dollar amount in my utterance. So, for example, if I ask Alexa:

Send $100.51 to Kroger.

(pronounced, One hundred dollars and fifty one cents) I want to receive the value 100.51 in a proper slot.

I have tried searching and I defined my utterance slots like this:

"slots": [
    {
        "name": "Amount",
        "type": "AMAZON.NUMBER"
    } 
]

But on JSON input I only get this result:

"slots": {
    "Amount": {
        "name": "Amount",
        "value": "?"
    }
}

How can I make Alexa accepts currency values?

like image 604
ewassef Avatar asked Feb 16 '17 03:02

ewassef


People also ask

How do I edit a sign up slot?

To edit a slot, log in to your account and go to the Created sign ups area. Click the pencil icon next to the sign up you wish to edit. From the Slots tab, locate the slot for which you wish to edit the quantity.

How to set up a slot machine?

As mentioned before, the SlotMachine component helps us to easily set up a slot machine. The main part to get a SlotMachine to work is to specify its model and delegate properties. The model is responsible for providing the data for filling the reels of the slot machine with items. We already used the SlotMachineModel to configure our symbols.

What does the number wanted mean for a slot?

When you enter the Number Wanted for a slot, you are choosing the number of people you want to sign up for the item. For example, if you want one person to bring 24 napkins, your slot should read "24 pack of napkins" with a Number Wanted of one selected.

Can you create your own currency?

You Can Create Your Own Currency. Here’s How You Can Create Your Own Currency. Here’s How Today I made a trillion dollars. Not bad for an investment of about $200. But I own 1 trillion of the clem token and it has a value of 1 USDc token, which is worth $1. QED I am a trillionaire.


2 Answers

I'm a bit confused by what you wrote in your last sentence and the code, but I'll confirm that there is no built-in intent or slot for handling currency.

So, you'll have to do it manually using AMAZON.NUMBER slot type as you seem to be trying.

I would imagine that you will want to create utterences with two AMAZON.NUMBER slots - one for dollars and one for cents.

like image 108
Tom Avatar answered Oct 05 '22 09:10

Tom


Easy, make a custom slot and just use $10.11, $.03, and $1003.84 as the sample's. It will work as currency now, accepting users dollars and cents utterances and converting them to a dollar $XX.XX format.

like image 24
BiTZOiD Avatar answered Oct 05 '22 11:10

BiTZOiD