Created
June 26, 2020 15:29
-
-
Save thiagoavadore/c64620b646e0a041b824447215800667 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_demo(intent_request): | |
caller_id = get_call_id(intent_request['sessionAttributes']) | |
output_session_attributes = intent_request['sessionAttributes'] if intent_request[ | |
'sessionAttributes'] is not None else {} | |
content = "Sorry, we couldn't find your Darius MLOps platform demo." | |
if caller_id is not '': | |
response = table.query( | |
KeyConditionExpression=Key('phoneNumber').eq(caller_id) | |
) | |
if len(response['Items']) > 0: | |
timeslot = response['Items'][0]['appointment'] | |
content = "You have a Darius demo with us at " + timeslot | |
return close( | |
output_session_attributes, | |
'Fulfilled', | |
{ | |
'contentType': 'PlainText', | |
'content': content | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment