def get_response(dialog_context, emotion):
    """
    :param dialog_context: list of dialog utterances
    :param emotion: emotion to condition response
    :return: dialog response conditioned on input emotion
    """
    tokenized_dialog_context = list(map(get_tokens_sequence, dialog_context))
    tokenized_dialog_contexts = [tokenized_dialog_context]
    context_tokens_ids = transform_contexts_to_token_ids(tokenized_dialog_contexts, _cakechat_model.token_to_index,
                                                         INPUT_SEQUENCE_LENGTH, INPUT_CONTEXT_SIZE)

    condition_ids = transform_conditions_to_ids([emotion], _cakechat_model.condition_to_index, n_dialogs=1)

    if PREDICTION_MODE == PREDICTION_MODES.sampling:  # Different strategy here for better performance.
        return _get_non_offensive_response_using_fast_sampling(context_tokens_ids, condition_ids)
    else:
        return _get_non_offensive_response(context_tokens_ids, condition_ids)

    :param dialog_context: list of dialog utterances
    :param emotion: emotion to condition response
    :return: dialog response conditioned on input emotion
    
cakechat/api/response.py