Alexa Adapter - Session Attributes
See original GitHub issueHi,
I would like to ask for clarification. In documentation Session Attributes, it isn’t quite clear if TurnContext parameters are mapped into Session Attributes automatically.
When bot gets request from Alexa then new attributes are added into TurnContext, like here:
When this is send back to Alexa these parameters are not mapped into session attributes:
{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "TEXT_TO_SPEECH"
},
"card": {
"type": "Standard",
"title": "TITLE",
"text": "TEXT",
"image": {
"smallImageUrl": "https://....................jpg",
"largeImageUrl": "https://....................jpg"
}
},
"directives": [],
"shouldEndSession": true,
"type": "_DEFAULT_RESPONSE"
},
"sessionAttributes": {}
}
}
Does it means that I need to add code to map parameters from TurnContext and then it will be added as to Session Attributes? My first thought was that all TurnContext parameters are mapped automatically. Could you please clarify?
Regards
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Managing Attributes | Alexa Skills Kit
Session attributes persist throughout the lifespan of the current skill session. Session attributes are available for use with any in-session request.
Read more >Need a beginner lesson for Sessions Attribute in Alexa skill ...
Can someone please guide me to a very basic beginners tutorial for Sessions attribute in Alexa skill development. I want to understand how...
Read more >How to store data in your Alexa skills - Medium
So as I mentioned previously, there are two main ways to store data for Alexa skills when using the NodeJS SDK. Those are...
Read more >ask-sdk-v1adapter and Saving Session Attributes #414
I have two skills that use DynamoDB via the dynamoDBTableName property to save session attributes. If using the V1 SDK via require('alexa-sdk') ...
Read more >Persistence Adapter in a self hosted alexa skill - Forums
Currently I'm implementing a self hosted skill with NodeJS and everything went fine. But now I would like to use session attributes and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
Yes, I’m using Virtual Assistant template which uses OnTurnAsync. Solution for this problem was to run “SaveChangesAsync” on states objects:
Regards
Hi @BeigeBadger
Please download source code for ‘RouterDialog’ then you will see that this functionality is defined there. I made extension to that class but you can have a different solution based on your needs.
Regards