Skip to content

Set session attributes for previous question and answer#853

Merged
atjohns merged 1 commit intoaws-samples:developmentfrom
sneff91:previous-qna-as-attributes
Jan 6, 2026
Merged

Set session attributes for previous question and answer#853
atjohns merged 1 commit intoaws-samples:developmentfrom
sneff91:previous-qna-as-attributes

Conversation

@sneff91
Copy link
Contributor

@sneff91 sneff91 commented Nov 27, 2025

Issue #, if available:

Description of changes:
Modified postTextMessage action to assign previous question and answer as Lex session attributes so that they can be easily referenced by the parent page via iFrame loader event based API (onUpdateLexState) as well as on the destination side. QnABot deployments can then reference these attributes on utterances like "thumbs up"/"thumbs down" to like feedback ratings to the appropriate question-answer pair.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sneff91
Copy link
Contributor Author

sneff91 commented Dec 31, 2025

Hi @atjohns - wondering if you've had a chance to review this PR. I've made this change to 0.23.0 source and compiled and tested with plain text/markdown/card responses from Lex and haven't been able to identify any functional issues. I've found a lot of value in this specifically around usage with QnABot for Lambda hooks and parsing responses based on the previous user question and/or answer, as well as with OpenSearch Dashboard reporting that comes with QnABot. I've also found value in it when adding client side logic that interacts with Lex-Web-UI via the iFrame API.

@atjohns
Copy link
Contributor

atjohns commented Jan 6, 2026

Hey @sneff91 yes I am pulling this in now for release in the next version. I just did not have the bandwidth to properly test before the last release. Thanks again for contributing!

@atjohns atjohns merged commit 2b2f453 into aws-samples:development Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants