From e9b35c262f61e69d5851904c20bbb3e125641cfd Mon Sep 17 00:00:00 2001 From: Florian Rumiel Date: Sat, 3 Feb 2024 12:37:20 -0500 Subject: [PATCH] Update intent name and state in lambda_handler function Update intent name in intent_lambda_mapping --- list_collections/src/index.py | 14 ++++---------- terraform/modules.tf | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/list_collections/src/index.py b/list_collections/src/index.py index 1d7bab4..c372987 100644 --- a/list_collections/src/index.py +++ b/list_collections/src/index.py @@ -52,8 +52,8 @@ def lambda_handler(event, context): return { "sessionState": { "intent": { - "name": "ListCollections", - "state": "Fulfilled", + "name": "SelectCollections", + "state": "ReadyForFulfillment", "confirmationState": "None", "slots": slots, }, @@ -62,14 +62,8 @@ def lambda_handler(event, context): "messages": [ { "contentType": "PlainText", - "content": "Voici les sources de données disponibles :", - }, - { - "contentType": "PlainText", - "content": "Please choose an option", - "messageType": "ElicitSlot", - "slotToElicit": "CollectionName", - }, + "content": f"Here are the collections: {', '.join(rows)}", + } ], "requestAttributes": {}, } diff --git a/terraform/modules.tf b/terraform/modules.tf index 9b2e3e0..2475ec3 100644 --- a/terraform/modules.tf +++ b/terraform/modules.tf @@ -83,7 +83,7 @@ module "lex_router" { lambda_function_name = local.lex_router_lambda_name aws_region = var.aws_region intent_lambda_mapping = { - ListCollections = local.list_collections_lambda_name - Inference = local.inference_lambda_name + SelectCollections = local.list_collections_lambda_name + Inference = local.inference_lambda_name } }