def METHOD_NAME(ctx, actor):
    # consider N_UTTERANCES_CONTEXT last utterances
    context = int_ctx.get_utterances(ctx, actor)[-N_UTTERANCES_CONTEXT:]
    context = [uttr.get("text", "") for uttr in context]
    if context:
        context = [re.sub(FIX_PUNCTUATION, "", x) for x in context]
    # drop the dialog history when prompt changes
    last_uttr = int_ctx.get_last_human_utterance(ctx, actor)
    # get prompt from the current utterance attributes
    given_prompt = last_uttr.get("attributes", {}).get("prompt", DEFAULT_PROMPT)
    history = int_ctx.get_utterances(ctx, actor)
    for i in range(1, len(history) + 1, 2):
        curr_prompt = history[-i].get("attributes", {}).get("prompt", DEFAULT_PROMPT)
        # checking only user utterances
        if curr_prompt != given_prompt:
            # cut context on the last user utterance utilizing the current prompt
            context = context[-i + 2 :]
            break
    return context