Skip to content

Commit

Permalink
Update lambda_handler to include slots in sessionState
Browse files Browse the repository at this point in the history
  • Loading branch information
FloRul committed Feb 3, 2024
1 parent 2388746 commit 52c4ea8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion list_collections/src/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ def lambda_handler(event, context):
# Format the sessionAttributes as a map of string to string
sessionAttributes = {f"option{i}": option for i, option in enumerate(rows)}

# Format the slots as a map of slot names to slot objects
slots = {
f"option{i}": {"shape": "Scalar", "value": json.dumps(option)}
for i, option in enumerate(rows)
}

return {
"sessionState": {
"intent": {
"name": "ListCollections",
"state": "Fulfilled",
"confirmationState": "None",
"slots": sessionAttributes,
"slots": slots,
},
"sessionAttributes": sessionAttributes,
},
Expand Down

0 comments on commit 52c4ea8

Please sign in to comment.