Back to Parent

02. Tapping into Session Attributes

In order to construct a query that could be passed through the Spoonacular API, I first had to take advantage of the sessions functionality built into Alexa. This allowed me to collect information via the built-in slots and then track this data across multiple intents. The Code below is representative of one of these intents. Whereas ingredients are pulled in via the slot "ingredients" and assigned to a session_attribute. Once all of the six session_attributes that I defined were filled I passed this information through the Spoonacular API.

Throughout the conversation following data points were collected and carried throughout the process

The users name via  session_attributes[:userName]

The provided ingredients via session_attributes[:ingredients]

The provided cuisine via session_attributes[:cuisine]

The provided dislikes via session_attributes[:dislikes]

The provided intolerances via session_attributes[:intolerances]

The provided dietary preferences via session_attributes[:diet]


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0