In this exercise, you will learn how to test synonyms in your Alexa skill.
Make a dummy endpoint
- In the Amazon Developer Console, click on the Build tab, then select the Endpoint section in the left sidebar. In this section, select HTTPS, and type in
https://example.comin the Default Region only. (We will be creating a real endpoint on AWS Lambda later, but for now, we don’t really need it).
- For the SSL Certificate Type, select the second option: “My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority”
- Click Save Endpoints button at the top of your screen.
Testing our Synonyms
Try matching a synonym to the slot value using the steps below.
- Click on the Test tab in the header.
- Make sure testing is enabled for your skill by selecting the toggle in the top left corner of the web page.
- In the Alexa Test Simulator panel — type,
ask movie match to find me a combat movieand press enter. Remember we had added combat, battle, fight, war as the synonyms for the slot value of action.
- Alexa will respond with “There was a problem with the requested skill’s response”, and the JSON Output would be ‘null’. This is expected behavior since our endpoint (
https://example.com) isn’t real.
- More importantly, you will see JSON Input, that was generated for your skill (similar to one on the right) based on the user request. Let’s inspect this JSON to check if the synonym was resolved successfully.
Inspecting the JSON Input
If you scroll down to the request property in the JSON input, you will see that there is an object called
resolutions which contains some additional information relevant to our slots. The value that we used,
combat, successfully resolved to the slot value
action. We know this because the
resolutions node contains the status code of
ER_SUCCESS_MATCH stands for Entity Resolution. The status code indicates the skill successfully matched the synonym (
combat) to the slot value (
Additionally, in the
values node, you can see that the IntentRequest still passes
action as the value.
Inspect the JSON input for the example above. Notice the genre value is
combat and the resolved value a few lines below it is