From e17fea3c0025b0384cfe95a544fc7db3aaa6abc5 Mon Sep 17 00:00:00 2001 From: Skylar Neff Date: Thu, 27 Nov 2025 08:29:48 -0800 Subject: [PATCH] Modified postTextMessage action to set previous question and answer as Lex session attributes --- lex-web-ui/src/store/actions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lex-web-ui/src/store/actions.js b/lex-web-ui/src/store/actions.js index ac4f2c93..4eee5941 100644 --- a/lex-web-ui/src/store/actions.js +++ b/lex-web-ui/src/store/actions.js @@ -572,6 +572,14 @@ export default { .then((response) => { if (context.state.chatMode === chatMode.BOT && context.state.liveChat.status != liveChatStatus.REQUEST_USERNAME) { + context.dispatch('setSessionAttribute', { + key: 'previousUtterance', + value: message.text + }); + context.dispatch('setSessionAttribute', { + key: 'previousLexResponse', + value: response.message + }); // check for an array of messages if (response.sessionState || (response.message && response.message.includes('{"messages":'))) { if (response.message && response.message.includes('{"messages":')) {