Skip to content

Latest commit

 

History

History
44 lines (23 loc) · 4.85 KB

File metadata and controls

44 lines (23 loc) · 4.85 KB

Build An Alexa Decision Tree Skill

Voice User InterfaceLambda FunctionConnect VUI to CodeTestingCustomizationPublication

Customize the Skill to be Yours

At this point, you should have a working copy of our Decision Tree skill. In order to make it your own, you will need to customize it with questions and conclusions that you create. Open the index_templates.js file, copy and paste it directly into Lambda, or into a text editor/IDE to make the customizations. Here are the things you will need to change:

  1. New data. You will need to create a new set of messages, questions, answers, and descriptions for your skill.

    1. Open a copy of index_template.js. If you haven't already downloaded the code for this project, you can find a copy of index_template.js here on GitHub. You can use a simple, lightweight code editor like Atom, Sublime Text, or VSCode, but you also have the option to edit the code directly in your Lambda function.

    2. Search for the comment "TODO: Replace this data with your own." These are the placeholders for our skill. You can see that there are questions, answers & descriptions, and messages or prompts. Here's some things to consider:

      1. You can provide questions, answers, messages and prompts to customize your decision tree.

      2. A Quick Explanation of How it Works Take a look at the code in index_template.js at line 20. Each "yes" or "no" answer maps to a different node in the nodes array. The resulting node may be a another question, in which case Alexa will expect another "yes" or "no" answer from the user before progressing to the next node. This will continue procedurally until an "answer" node is reached (nodes with 0 values for yes and no object properties). Once at an exit node, the programmatic end of the decision tree has been reached. Alexa will read the description to the user.

      3. There are three states in this implementation. Each state has its own set of handlers. Take a look at the comments in the code to understand what they do in greater detail.

    3. When you have replaced the placeholders in index_template.js, copy the contents of your file to your Lambda function. This should be as simple as copying the text, and pasting it into the code box for your Lambda.

  2. Once you have made the updates listed on this page, you can click "Next" to move on to Publishing and Certification of your skill.