How to define a custom slot that can be any name orstring value?

887 views Asked by At

I am building a cricket stats alexa skill which requires the playerName to filter out information. I cannot use AMAZON.US_FIRST_NAME because of the following reasons:

  • It only detects the first name and not the whole name
  • There are playerName from around the globe, so AMAZON.US_FIRST_NAME isn't a good fit.

Even if I want to use AMAZON.LITERAL (which is not recommended by Amazon) I need to have slot values. But the slot values can be any player names, so the sample utterances will be huge.

One way to do this is to hard-code all playerName with slot values. But is it a best practice to do this since the slot values can be quite big in number?

Is there any workaround for this?

1

There are 1 answers

6
Amod Gokhale On

Use Custom slot https://developer.amazon.com/docs/custom-skills/custom-interaction-model-reference.html#custom-slot-type-values , currently you can have 50,000 custom slot values ( which i feel are sufficient for player names ). e.g.

Intent Schema

{
  "intents": [
    {
      "slots": [
        {
          "name": "PLAYER_NAME",
          "type": "PLAYERS"
        }
      ],
      "intent": "GetPlayerData"
    }
  ]
}

Custom_Slot_Value Type PLAYERS

Sachin,

Saurabh, ....