def dispatch()

in src/lambda/meaningful-conversations-lex-lambda.py [0:0]


def dispatch(intent_request):
    """
    Called when the user specifies an intent for this bot.
    """
    print("Intent Request is: " + str(intent_request))
    logger.debug('dispatch userId={}, intentName={}'.format(intent_request['userId'], intent_request['currentIntent']['name']))

    intent_name = intent_request['currentIntent']['name']

    # Dispatch to your bot's intent handlers
    if intent_name == 'GetInvoiceSummary':
        return get_summary(intent_request)
    elif intent_name == 'GetInvoiceDetails':
        return get_details(intent_request)
    elif intent_name == 'GetInvoiceNotes':
        return get_notes(intent_request)

    raise Exception('Intent with name ' + intent_name + ' not supported')