aws-lex-web-ui icon indicating copy to clipboard operation
aws-lex-web-ui copied to clipboard

fix: enable to control to send initial utterance when history exists

Open tkashi opened this issue 3 years ago • 0 comments

Issue #, if available: N/A

Description of changes: Currently even if history exists (i.e. saveHistory=true), an initial utterance is sent every time a user refreshes a chat. However, saving history sometimes means the user wants to keep conversation and doesn't need the utterance sent. This PR introduces the config variable sendInitialUtteranceWhenSaveHistory which enables developers to control if the initial utterance should be sent at initialization when history exists. To decide if messages are saved, I am checking if the lenght of the message list is less than one, meaning the list includes at most an initial text pushed at the earlier stage of the initialization.

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

tkashi avatar Nov 14 '21 10:11 tkashi