Help Your Skill Remember with Attributes Manager
You learned how to make your skill remember things for a skill session and longer. You learned how to read and write skill data, both temporarily and persistently. You also learned how to view your persistent data in the DynamoDB service.
If your skill isn't working or you're getting some kind of syntax error, download the code sample in Node.js or Python from the following links. Then, go to the Code tab in the Alexa developer console, and copy and paste the code into the
index.js file or the
lambda_function.py file. Make sure to save and deploy the code before you test it.
Now that you've finished, try a self-test to see how much you remember. Click to expand to see the answer.
1: Items stored in skill memory are called:
- A. Variables
- B. Attributes
- C. Fields
The correct answer is "B." Attributes are stored for the length of an exchange (Request Attributes), a contiguous series of exchanges (Session Attributes), multiple sessions (Persistent Attributes).
2: To store attributes, you use the:
- A. Attributes Manager
- B. Attribute Connector
- C. Relational Mapper
The correct answer is "A." Attributes Manager provides methods to manage all three types of attributes.
3: Interceptors are for:
- A. Preventing bad data from getting to handlers
- B. Catching requests that don't map to known intents
- C. Running pre-and-post processing functions
The correct answer is "C." Request and response interceptors let you run functions before and after processing on every exchange, within the scope of the exchange. While you can use interceptors to prevent bad data )from getting to handlers, they are much more flexible and capable, so answer "C" is the most accurate answer.
Continue to Module 6 to learn how to use the Alexa Settings API to make sure your skill greeting is a little more personal.