Skip to content

Commit

Permalink
Update intent name and state in lambda_handler function
Browse files Browse the repository at this point in the history
Update intent name in intent_lambda_mapping
  • Loading branch information
FloRul committed Feb 3, 2024
1 parent e47261f commit e9b35c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions list_collections/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def lambda_handler(event, context):
return {
"sessionState": {
"intent": {
"name": "ListCollections",
"state": "Fulfilled",
"name": "SelectCollections",
"state": "ReadyForFulfillment",
"confirmationState": "None",
"slots": slots,
},
Expand All @@ -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": {},
}
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit e9b35c2

Please sign in to comment.