4

I'm trying to use the AMAZON.LITERAL slot type in my Alexa skill, but when I try building, I see this error:

Build Failed
Slot name "{What}" is used in a sample utterance but not defined in the intent schema. Error code: UndefinedSlotName - Thursday, Apr 12, 2018, 2:08 PM

The slot is named What, and I'm 100% sure it is defined. It builds successfully if I change the slot type to anything except AMAZON.LITERAL.

Here is my entire model:

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "chores",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "Remember",
                    "slots": [
                        {
                            "name": "Who",
                            "type": "AMAZON.Person"
                        },
                        {
                            "name": "When",
                            "type": "AMAZON.DATE"
                        },
                        {
                            "name": "What",
                            "type": "AMAZON.LITERAL"
                        }
                    ],
                    "samples": [
                        "remember {Who} {What} {When}"
                    ]
                }
            ],
            "types": []
        }
    }
}

EDIT:

This is the response I got from Amazon when I submitted the bug:

We are not supporting AMAZON.Literal slot type anymore and we ask developer to use customer slot type is they have some set of values but if not then you can use AMAZON.SearchQuery where you will get the whole query which customer is looking for and same you can use it in you lambda function.

SimpleJ
  • 13,812
  • 13
  • 53
  • 93
  • 1
    What language is the skill targeting? AMAZON.LITERAL is not supported in anything other than en-US from what I understand. – Steve Tingiris Apr 14 '18 at 21:17

2 Answers2

6

I faced the same issue. Here's the solution.

You need to define your Sample Utterances as

Remember {Neil | Who} {died | What} {yesterday | When}

Amazon made it mandatory to provide the example inputs along with your Slot names as AMAZON.LITERAL can take in a wide variety of values.

For more information, refer here.

Arghya
  • 240
  • 1
  • 16
  • I don't think this is the case in the latest alexa dev console. This syntax also causes a failed build. – SimpleJ Apr 15 '18 at 18:01
  • Mine got built yesterday as soon as I made the above changes. I think in your case, you have put all the slots together, side by side. How will Alexa differentiate? – Arghya Apr 16 '18 at 05:26
1

add some sample utterances in below format and it should work:

remember {Jack|Who} {bring fruits|What} {tomorrow|When}
remember {Mark|Who} {pay bills|What} {today|When}