def build_speechlet_response(output, should_end_session):
    """ Return a speech output after an Alexa function is executed.

    Builds a simple speech response after the user invokes a particular Alexa
    function. The response used here is a simple, plain text response but can be
    enhanced by customizing the card that shows to users that have graphical displays
    (like the Echo Show or the Alexa app). See 
    https://developer.amazon.com/docs/custom-skills/include-a-card-in-your-skills-response.html
    for more details about customizing the response.

    You can also specify whether the session should be ended after this response is heard,
    or whether Alexa should prompt for another input from the user using the should_end_session
    parameter.

    Args:
        output: A string that Alexa will read to the user as the output.
        should_end_session: True if the session should end after hearing this response.
                            False if the session should say open for another input from
                                  the user.

    Returns:
        Dictionary containing the output speech and whether or not the session should end.
    """

    return {
        'outputSpeech': {
            'type': 'PlainText',
            'text': output
        },
        'shouldEndSession': should_end_session
    }