Migrate Slot Types that Used AMAZON.LITERAL
AMAZON.LITERAL
is deprecated as of October 22, 2018. Older skills built with AMAZON.LITERAL
do continue to work, but you must migrate away from AMAZON.LITERAL
when you update those older skills, and for all new skills.- Migrate AMAZON.LITERAL to a custom slot type
- Example of AMAZON.LITERAL converted to a custom slot type
- Related Topics
Migrate AMAZON.LITERAL to a custom slot type
Custom slot types provide a better way to define possible values and use them within utterances. They also reduce the number of sample utterances you need, since the values are not defined within the utterances.
- Go to https://developer.amazon.com/alexa/console/ask.
-
Click Skills.
The developer console opens and displays any skills you have already created.
- Edit the skill to update.
- Create a new custom slot type for the slot that currently uses
AMAZON.LITERAL
. -
Add all your sample values from your
LITERAL
slot to the new custom slot type.The sample slot values are in your utterances, to the left of the
|
character. - Edit the intent that uses the slot with
LITERAL
and change the slot type to the new custom slot type. - Remove the sample values within the utterances.
- Remove any duplicate sample utterances.
- Save and build your model.
You can also use the JSON Editor to make the changes directly to the interaction model JSON.
Example of AMAZON.LITERAL converted to a custom slot type
The following example shows the difference between AMAZON.LITERAL
and a custom slot type for a simple interaction model.
This model uses the custom slot type LIST_OF_SIGNS
as the type for the Sign
slot.
{
"interactionModel": {
"languageModel": {
"intents": [
{
"name": "GetHoroscope",
"slots": [
{
"name": "Sign",
"type": "LIST_OF_SIGNS"
}
],
"samples": [
"give me the horoscope for {Sign}",
"what is the horoscope for {Sign}",
"...additional unique utterances showing different phrasing"
]
}
],
"types": [
{
"name": "LIST_OF_SIGNS",
"values": [
{"name":{"value":"sagittarius"}},
{"name":{"value":"scorpio"}},
{"name":{"value":"libra"}},
{"name":{"value":"virgo"}},
{"name":{"value":"leo"}},
{"name":{"value":"cancer"}},
{"name":{"value":"gemini"}},
{"name":{"value":"taurus"}},
{"name":{"value":"aries"}},
{"name":{"value":"pisces"}},
{"name":{"value":"aquarius"}},
{"name":{"value":"capricorn"}}
]
}
]
}
}
}
This model uses the deprecated AMAZON.LITERAL
slot type. Note the need for duplicate sample utterances to specify the different values for the Sign
slot.
{
"interactionModel": {
"languageModel": {
"intents": [
{
"name": "GetHoroscope",
"slots": [
{
"name": "Sign",
"type": "AMAZON.LITERAL"
}
],
"samples": [
"give me the horoscope for {capricorn|Sign}",
"give me the horoscope for {aquarius|Sign}",
"give me the horoscope for {pisces|Sign}",
"give me the horoscope for {aries|Sign}",
"give me the horoscope for {taurus|Sign}",
"give me the horoscope for {gemini|Sign}",
"give me the horoscope for {cancer|Sign}",
"give me the horoscope for {leo|Sign}",
"give me the horoscope for {virgo|Sign}",
"give me the horoscope for {libra|Sign}",
"give me the horoscope for {scorpio|Sign}",
"give me the horoscope for {sagittarius|Sign}",
"what is the horoscope for {capricorn|Sign}",
"what is the horoscope for {aquarius|Sign}",
"...ten more instances of this phrase, one for each sample value",
"...more phrasing varieties, each repeated 12 times to include each value"
]
}
]
}
}
}
For more about custom slot types, see Create and Edit Custom Slot Types.
Related Topics
- Create the Interaction Model for Your Skill
- Create Intents, Utterances, and Slots
- Create and Edit Custom Slot Types
- Define the Dialog to Collect and Confirm Required Information
- Test Your Utterances as You Build Your Model
- Batch Test Your NLU Model
- Validate Slot Values
- Alexa Design Guide
- About the Alexa Developer Console
- Build Skills in the Alexa Developer Console
Last updated: Nov 28, 2023