def get_prompt_template(
    input_query: str,
    history: List[Dict] = None,
    roles: list = ["", "Human", "Assistant"],
) -> str:
    """
    Generates a prompt template for chat models based on input and history.

    Args:
        input_query (str): User's current input query.
        history (List[Dict], optional): List of past conversations, each a dict with 'role' and 'message'.
        roles (list): Specifies the roles in the conversation, defaults to ["", "Human", "Assistant"].

    Returns:
        str: A formatted prompt including the input query and history.
    """
    prompt = ""
    if history is None:
        new_history = []
    else:
        new_history = deepcopy(history)

    new_history.append({"role": roles[1], "message": input_query.strip()})
    new_history.append({"role": roles[2], "message": None})

    for _, item in enumerate(new_history):
        role = item.get("role")
        message = item.get("message")
        if role == roles[0]:
            prompt += f"<s>{message}\n\n"
        else:
            if message:
                prompt += f"{role}: <s>{message}</s>"
            else:
                prompt += f"{role}: <s>"
    return prompt

    Generates a prompt template for chat models based on input and history.

    Args:
        input_query (str): User's current input query.
        history (List[Dict], optional): List of past conversations, each a dict with 'role' and 'message'.
        roles (list): Specifies the roles in the conversation, defaults to ["", "Human", "Assistant"].

    Returns:
        str: A formatted prompt including the input query and history.
    
train/colossalai_llm4decompile/colossal_llama/utils/stream_chat_patch.py