def get_role(message: ChatMessage) -> str:
    """
    Get the role of the message.

    Args:
        message: The message.

    Returns:
        The role of the message.

    Raises:
        ValueError: If the message is of an unknown type.

    """
    if message.role == MessageRole.USER:
        return "User"
    elif message.role == MessageRole.CHATBOT or message.role == MessageRole.ASSISTANT:
        return "Chatbot"
    elif message.role == MessageRole.SYSTEM:
        return "System"
    elif message.role == MessageRole.TOOL:
        return "Tool"
    else:
        raise ValueError(f"Got unknown type {type(message).__name__}")

    Get the role of the message.

    Args:
        message: The message.

    Returns:
        The role of the message.

    Raises:
        ValueError: If the message is of an unknown type.

    
llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/utils.py