Skip to content

Instantly share code, notes, and snippets.

@thiagoavadore
Created June 26, 2020 15:29
Show Gist options
  • Save thiagoavadore/c64620b646e0a041b824447215800667 to your computer and use it in GitHub Desktop.
Save thiagoavadore/c64620b646e0a041b824447215800667 to your computer and use it in GitHub Desktop.
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