Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (22 sloc) 890 Bytes
def handler(event, context):
"""
Entry-point for Serverless Function.
:param event: request payload.
:param context: information about current execution context.
:return: response to be serialized as JSON.
"""
text = 'Hello! I\'ll repeat anything you say to me.'
if 'request' in event and \
'original_utterance' in event['request'] \
and len(event['request']['original_utterance']) > 0:
text = event['request']['original_utterance']
return {
'version': event['version'],
'session': event['session'],
'response': {
# Respond with the original request or welcome the user if this is the beginning of the dialog and the request has not yet been made.
'text': text,
# Don't finish the session after this response.
'end_session': 'false'
},
}
You can’t perform that action at this time.