def METHOD_NAME(
    from_user: str,
    chat_history: t.List,
    max_gen_len: int,
    top_p: float,
    temperature: float,
) -> t.Tuple[str, t.List]:
    dialog = []
    for _user, _assistant in chat_history:
        dialog.append({"role": "user", "content": _user})
        if _assistant:
            dialog.append({"role": "assistant", "content": _assistant})
    dialog.append({"role": "user", "content": from_user})
    from_assistant = assistant_completion(
        dialog,
        typ="dialog",
        max_gen_len=max_gen_len,
        top_p=top_p,
        temperature=temperature,
    )
    chat_history.append((from_user, from_assistant))
    return "", chat_history