-
Notifications
You must be signed in to change notification settings - Fork 217
create samTemplate Lex V2 interactive msg lambda hook #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
spenlep-amzn
wants to merge
1
commit into
master
Choose a base branch
from
spenlep/interactive-msg-lex-v2-assets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
efh365
reviewed
Mar 4, 2024
samTemplates/amazon-connect-interactive-messages-example-lex-v2/template.yaml
Show resolved
Hide resolved
samTemplates/amazon-connect-interactive-messages-example-lex-v2/packaged.yaml
Show resolved
Hide resolved
931a124
to
7f60e85
Compare
efh365
reviewed
Apr 7, 2025
...amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/app.js
Show resolved
Hide resolved
...active-messages-example-lex-v2/interactive-messaging-lex-codehook/util/user_input_handler.js
Show resolved
Hide resolved
...active-messages-example-lex-v2/interactive-messaging-lex-codehook/util/user_input_handler.js
Show resolved
Hide resolved
...amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/app.js
Show resolved
Hide resolved
...amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/app.js
Show resolved
Hide resolved
...ates/amazon-connect-interactive-messages-example-lex-v2/events/1_1_2_3-2020-10-31-T1800.json
Outdated
Show resolved
Hide resolved
samTemplates/amazon-connect-interactive-messages-example/events/1_1_2_3-2020-10-31-T1800.json
Outdated
Show resolved
Hide resolved
samTemplates/amazon-connect-interactive-messages-example/events/1_1_2_2-2020-10-15-T1600.json
Outdated
Show resolved
Hide resolved
...amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/app.js
Show resolved
Hide resolved
...amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/app.js
Show resolved
Hide resolved
9be498a
to
7ec9fa6
Compare
4080405
to
ec9cd60
Compare
efh365
reviewed
Apr 8, 2025
...ates/amazon-connect-interactive-messages-example-lex-v2/events/1_1_2_1-2020-10-15-T1300.json
Show resolved
Hide resolved
...ates/amazon-connect-interactive-messages-example-lex-v2/events/1_1_2_2-2020-10-15-T1600.json
Show resolved
Hide resolved
...ates/amazon-connect-interactive-messages-example-lex-v2/events/1_1_2_3-2020-10-31-T1800.json
Show resolved
Hide resolved
Notes: adding a new path
// lambda.diff
index dec63fe..7a7b60f 100644
--- a/samTemplates/amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/constants/interactive_options.js
+++ b/samTemplates/amazon-connect-interactive-messages-example-lex-v2/interactive-messaging-lex-codehook/constants/interactive_options.js
@@ -2,9 +2,8 @@
const TEMPLATE_TYPES = {
LISTPICKER: "ListPicker",
TIMEPICKER: "TimePicker",
+ QUICK_REPLY: "QuickReply",
+ CAROUSEL: "Carousel",
};
/*IMAGES USED FOR INTERACTIVE MESSAGES*/
@@ -31,6 +30,8 @@ const SLOTS = {
ACTION: "action",
INTERACTIVE_OPTION: "interactiveOption",
DEPARTMENT: "department",
+ QUICK_REPLY: "quickReply",
+ FLIGHT_OPTIONS_CAROUSEL: "flightOptions",
APPOINTMENT: "appointment"
};
@@ -52,6 +53,8 @@ const ACTIONS = {
/*SELF-SERVICE OPTIONS WHEN USER SELECTS "CHECK SELF-SERVICE OPTIONS" AS AN ACTION*/
const TEST_INTERACTIVE_OPTIONS = {
DEPARTMENT_WITH_MULTIPLE_IMAGES: "Choose a department",
+ SIMPLE_QUICK_REPLY_PICKER: "Rate my experience",
+ FLIGHT_OPTIONS_CAROUSEL_PICKER: "View flight options",
SIMPLE_TIMEPICKER: "Schedule a meeting with an agent"
};
@@ -59,6 +62,8 @@ const TEST_INTERACTIVE_OPTIONS = {
/*MAPPING SELF-SERVICE OPTIONS TO AMAZON LEX BOT SLOTS*/
const TEST_INTERACTIVE_OPTIONS_SLOTS = {
DEPARTMENT_WITH_MULTIPLE_IMAGES: SLOTS.DEPARTMENT,
+ SIMPLE_QUICK_REPLY_PICKER: SLOTS.QUICK_REPLY,
+ FLIGHT_OPTIONS_CAROUSEL_PICKER: SLOTS.FLIGHT_OPTIONS_CAROUSEL,
SIMPLE_TIMEPICKER: SLOTS.APPOINTMENT,
INVALID: SLOTS.DEPARTMENT,
DEPARTMENT_LISTPICKER: SLOTS.DEPARTMENT
@@ -147,6 +152,83 @@ const TEST_INTERACTIVE_OPTIONS_TEMPLATES = {
},
},
},
+ SIMPLE_QUICK_REPLY_PICKER: {
+ templateType: TEMPLATE_TYPES.QUICK_REPLY,
+ version: "1.0",
+ data: {
+ content: {
+ title: "How was your experience?",
+ subtitle: "Tap to select option",
+ buttons: [
+ {
+ text: "Good",
+ },
+ {
+ text: "Bad",
+ },
+ {
+ text: "Neutral",
+ },
+ ],
+ },
+ },
+ },
+ FLIGHT_OPTIONS_CAROUSEL_PICKER: {
+ "templateType": "Carousel",
+ "version": "1.0",
+ "data": {
+ "content": {
+ "title": "View our popular destinations",
+ "elements": [
+ {
+ "templateIdentifier": "template0",
+ "templateType": "Panel",
+ "version": "1.0",
+ "data": {
+ "content": {
+ "title": "California",
+ "subtitle": "Tap to select option",
+ "elements": [
+ {
+ "title": "Book flights"
+ },
+ {
+ "title": "Book hotels"
+ },
+ {
+ "title": "Talk to agent"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "templateIdentifier": "template1",
+ "templateType": "Panel",
+ "version": "1.0",
+ "data": {
+ "content": {
+ "title": "New York",
+ "subtitle": "Tap to select option",
+ "elements": [
+ {
+ "title": "Book flights"
+ },
+ {
+ "title": "Book hotels"
+ },
+ {
+ "title": "Talk to agent"
+ }
+ ]
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
}; |
078ad49
to
5d5d8cb
Compare
haomingli2020
approved these changes
Apr 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adding a new SAM template for chat interactive messages w/ Lex V2 support. The current template only supports Lex V1
I copy/pasted the existing template and made minor refactors to support Lex V2 (mainly
interactive-messaging-lex-codehook/app.js
). Since we don't have a blog post for this setup, I added detailed instructions to the README (preview it here).Background
Customers that use Amazon Connect chat (both Hosted Widget and Customer builder) want to enhance the chat experience with interactive messages and Lex bots. To configure this, they need to integrate a lambda code-hook to handle dynamic conversations (e.g. "help", "talk to agent", "view flight plans").
They can one-click deploy this AWS Lamba and follow instructions to configure interactive messages. They will add this to an Amazon Lex V2 bot and a chat-based Amazon Connect contact flow.
We already have a sample and blog article for Amazon Lex V1, but that will reach end of life on September 15, 2025. We want to support onboarding customers using Amazon Lex V2 (around since Jan 22, 2021)
Testing
Everything has been deployed+tested (on 4/7/2025)
Checklist
Links