def speech_output(text, speech_type='SSML'):
    """
    This function is used for setting both the outputSpeech and the reprompt properties.

    :param (str) text: Text which will be returned to the user.
    :param (str) speech_type: Type in which text is formatted. Choices: [SSML, PlainText]. Default: SSML
    :return: Alexa parsable dictionary.
    :rtype: dict

    Alexa API Reference:
        https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html#outputspeech-object
    """
    if speech_type == 'SSML':
        return {'type': 'SSML', 'ssml': '<speak>' + text + '</speak>'}
    else:
        return {'type': 'PlainText', 'text': text}
