Feature end live chat utterance - Send an utterance to the bot when the user disconnects from Amazon Connect live chat #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
No Issue
Description of changes:
This pull request allows the lex-web-ui to send an utterance to the configured bot on completion of a live chat. The standard use case would be to kick off a post live chat survey by sending an utterance to the bot. On receipt of the utterance, the bot, for example AWS QnABot, could ask the user for feedback in the form of one or more survey questions. When the utterance is sent, several session attributes are set that provide Amazon Connect context for processing in bot: connect_initial_contact_id, connect_contact_id, and connect_participant_id. The handlers in the bot would typically store this information along with post live chat survey responses.
In addition, to sending the utterance, this pull request allows transcript entries to be redacted before sending to the agent during live chat startup. The use case here is that amazon connect supports reconnecting to an agent after live chat has completed. Without this change, the full transcript would be sent on the new request including any past survey results. Sometimes agents might be upset with seeing past poor survey responses. This feature allows a regex to be defined that when matched will redact those survey results.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.