I am building a bot in amazon lex, which will be used to collect app ratings from the user. To collect these ratings I'm using Elicit_slot so the bot will prompt the user for rating. Problem is if user doesn't input after 30s I want the bot to reprompt it again (only for 1 try). I couldn't find any doc for the timeout feature.
This is the only doc I found out, but even after adding this in session attributes it didn't work
Here's my code for slot elicitation:
def elicit_slot(intent_request, session_attributes, slot_name, message):
# Set a timeout for the slot
session_attributes["x-amz-lex:text:start-timeout-ms:RequestForRating:rating"] = '5000' #set for 5s for testing
return {
"lex_data":{
"sessionState": {
"sessionAttributes": session_attributes,
"dialogAction": {
"type": "ElicitSlot",
"slotToElicit": slot_name
},
"intent": intent_request["sessionState"]["intent"]
},
"messages": [
{
"contentType": "PlainText",
"content": message
}
]
}
}