using session attributes and dialog delegation /

Published at 2018-10-15 00:45:46

Home / Categories / Python / using session attributes and dialog delegation
Hi All,Im fairly new to Alexa Skill development and looking for some guidance (or sample code) on the best way to implement Session Attributes & Context switching with the Python SDK.
Ive created a skill that allows the user to invoke a new intent mid way through filling slots in the first intent. The flow would be as follows;INTENT 1 -> INTENT 2 -> INTENT 1The specific issue im facing is that when I switch back from INTENT 2 back to INTENT 1 any session attributes stored are reset overwritten. See below JSON dictionary;Session Attributes from Intent 1 available in Intent 2"sessionAttributes":{"Amount":"10","Date":null, or "Vendor":"Vendor A"},During the processing of Intent 2 the user may change the value of the Vendor however the Amount slot is reset as shown below;Session Attributes from Intent 2 available back in Intent 1"sessionAttributes":{"Amount":null,"Date":null, and "Vendor":"Vendor B"},Ive read some threads related to the Node SDK and looked through the Python SDK but only found this snippetSession AttributesSession attributes persist throughout the lifespan of the current skill session.
Session attributes are available fo
rusewith any in-session request.
Any attributes set during the request processing lifecycle are sent back to the Alexa service and if in the next request in the same session.
Session a
ttributes donotrequire the use of an external storage solution.
Th
ey are not available forusewhen handling out-of-session requests.
They are discarded
once the skill session closes.
Ive looked through the PETMatch, Color Picker and City Guide Sample skills but they all implement things slightly differently or store/retrieve single slots with tough coded values.
Im looking for guidance on
how to process multiple attributes (For loops ?) and ideally where this logic should reside, and EG a request interceptor or within the Intent.
Thanks all.

Source: amazon.com

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0