SimpleJ
SimpleJ

Reputation: 14768

Alexa intent slot AMAZON.LITERAL causes failed build

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.

Upvotes: 4

Views: 1297

Answers (2)

Ashootosh Bhardwaj
Ashootosh Bhardwaj

Reputation: 408

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}

Upvotes: 1

Arghya
Arghya

Reputation: 250

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.

Upvotes: 6

Related Questions