Add Persistence to Your Skill (SDK v1)
Learn how to persist values during and between Alexa skills.
StartSession Attributes
Lesson 1 of 2
- 1In this lesson, we’re going to build a Codecademy Flashcards skill and look at how you can program Alexa to remember details about your conversation within a session — the time between when y…
- 2Before we build the Lambda function logic for our flashcards skill, we want to build the interaction model. To do so, we’ll navigate to developer.amazon.com and use the Alexa Skill Builder. If …
- 3Let’s take a look at how we access session attributes from a Lambda function. Session attributes are stored in the response that your skill receives from Alexa as a JSON. We can create and edit a…
- 4Like variables, session attributes hold values that we can change after we’ve created them. For example, if any of our session attributes are numbers, we can set their initial values and use numbe…
- 5One good use of session attributes is to capture and store user input through slots so you can use that information at a later time. This information is sent to your Lambda function as part of the …
- 6Often, you want to combine session attribute values with another string to generate a custom speech output. Let’s consider our movie genre skill. If we wanted Alexa to respond with the current ge…
- 7In the last exercise, we used interpolation to create a speech output. Though, accessing session attributes and slot values can get messy. In this exercise we’ll see how variables can help us clean…
- 8Now that we’ve added all of the functionality of session attributes, let’s create our Lambda function. We’ve detailed the steps below, but if you need a refresher, check out this video on creatin…
- 9Now that we’ve completed our skill, let’s test it out. We’ve included our version of the service simulator to let you see how the requests and responses should appear. Try out the following utter…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory