question

jvgough avatar image
jvgough asked

Alexa Service not returning custom slot value

Hello! Hopefully someone can help me with this because I've been stumped for a week.

I am creating a simple Alexa skill from one of the samples. It's the color picker skill - you tell Alexa your favorite color, and then you ask her your favorite color. I'm using Custom Slots, and the Skill Service doesn't want to return a value for the color. It launches successfully, and then loads the correct intent, however it doesn't send the correct value. Instead, there's not even a value parameter in the output, just name and confirmation status.

Here's my skill's JSON, followed by the request JSON output after I tell the skill: "My color is red." I want the skill to pass "red" into the value parameter.

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "color picker",
            "intents": [
                {
                    "name": "MyColorIsIntent",
                    "slots": [
                        {
                            "name": "color",
                            "type": "LIST_OF_COLORS"
                        }
                    ],
                    "samples": [
                        "my color is {color}",
                        "{color} is my color"
                    ]
                },
                {
                    "name": "WhatsMyColorIntent",
                    "slots": [],
                    "samples": [
                        "what's my color",
                        "what's my favorite color"
                    ]
                },
                {
                    "name": "AMAZON.NavigateHomeIntent",
                    "samples": []
                }
            ],
            "types": [
                {
                    "name": "LIST_OF_COLORS",
                    "values": [
                        {
                            "name": {
                                "value": "green"
                            }
                        },
                        {
                            "name": {
                                "value": "red"
                            }
                        },
                        {
                            "name": {
                                "value": "yellow"
                            }
                        },
                        {
                            "name": {
                                "value": "orange"
                            }
                        },
                        {
                            "name": {
                                "value": "black"
                            }
                        },
                        {
                            "name": {
                                "value": "blue"
                            }
                        }
                    ]
                }
            ]
        }
    }
}
	"request": {
		"type": "IntentRequest",
		"requestId": "amzn1.echo-api.request.918d6da6-cd7e-4bb8-a2a9-41fb1af8a354",
		"timestamp": "2018-10-01T01:53:56Z",
		"locale": "en-US",
		"intent": {
			"name": "MyColorIsIntent",
			"confirmationStatus": "NONE",
			"slots": {
				"Color": {
					"name": "Color",
					"confirmationStatus": "NONE"
				}
			}
		}
	}
alexa skills kitlambdaintentsslotsskill builder
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jvgough avatar image
jvgough answered

This is what happened:

I was working on different versions of the same skill, each with the same invocation name. When I typed in the invocation name, it actually opened an outdated version of the skill (I hadn't deleted the old skills - I had like 3 different ones - I like to start over). I didn't realize that when you click "test" you can test any of your saved skills, not just the one you have open.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jvgough avatar image
jvgough answered

bump bump bump

2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Albebach avatar image Albebach commented ·

Yeah I'm stumped too... looks like it should be functioning. There should be a "value" and a "resolutions" field under "slots:{"Color". The only thing I can think of -- it sounds dumb, but -- have you rebuilt your model lately? In the Developer Console under "Build", click on any of your intents, and you should see an icon that looks like a screwdriver and wrench that says "Build Model"... ?

1 Like 1 ·
Rokas avatar image Rokas commented ·

As Albebach said try to rebuild your model, because even though you described your slot as 'color' with lower case in the utterance, in the response it is with uppercase 'Color'. So this might be a leftover from the older model.
If you do any changes in the model, add new values, new utterance, change invocation name or whatever, you have to rebuild it.

0 Likes 0 ·