def METHOD_NAME(context, context_lengths, context_depth=3, encode=False, tokenizer=None):
    """
    THE LAST UTTERANCE IN THE CONTEXT IS TARGET BOT'S UTTERANCE
    context: List(dict)
    context = [
        {"text": "speaker": "human"},
        {"text": "hi there", "speaker": "bot"},
        {"text": "how are you", "speaker": "human"},
        {"text": "great how are u", "speaker": "bot"},
    ]
    OR
    context = [
        "hi",
        "hi there",
        "how are you",
        "great how are u"
    ]
    """
    if len(context) > 0 and isinstance(context[0], str):
        context_len = len(context)
        # the last uttr is from BOT
        inputs = [{"text": uttr, "speaker": (context_len - uttr_id) % 2} for uttr_id, uttr in enumerate(context)]
        inputs = inputs[-context_depth:]
    else:
        inputs = [{"text": uttr["text"], "speaker": 1 if uttr["speaker"] == "bot" else 0} for uttr in context]
        inputs = inputs[-context_depth:]
    inputs_text = "".join([inputs_by_length(input_, inp_len) for input_, inp_len in zip(inputs, context_lengths)])
    if encode:
        # if encode, return encoded context
        inputs_token_ids = tokenizer.encode(inputs_text, return_tensors="pt")
        return inputs_token_ids
    return inputs_text