Skip to content

Instantly share code, notes, and snippets.

@babakc babakc/chatbot4.py Secret
Created Dec 18, 2017

Embed
What would you like to do?
def confirmIntent(slots, sessionAttributes, confirmation, outputDialogMode):
if(confirmation == "None"):
endData = {
"dialogAction": {
"type": "ConfirmIntent",
"message": {
},
"intentName": "ResetPW",
"slots": slots
}
}
if(outputDialogMode == "Voice"):
endData["dialogAction"]["message"]["contentType"] = "SSML"
endData["dialogAction"]["message"]["content"] = "<speak>Just to confirm, your user id is <say-as interpret-as=\"digits\">" + slots["UserID"] + \
"</say-as>, your date of birth is " + \
slots["DOB"] + " and the month of your start date is " + \
slots["MonthStarted"] + ". Is that correct?</speak>"
else:
endData["dialogAction"]["message"]["contentType"] = "PlainText"
endData["dialogAction"]["message"]["content"] = "Just to confirm, your user id is " + slots["UserID"] + \
", your date of birth is " + \
slots["DOB"] + " and the month of your start date is " + \
slots["MonthStarted"] + ". Is that correct?"
elif((confirmation == "Denied")):
endData = {
"dialogAction": {
"type": "Close",
"fulfillmentState": "Failed",
"message": {
"contentType": "PlainText",
"content": "Please call back and try again."
}
}
}
else:
endData = delegate_slot(slots, "confirmed")
return endData
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.