def cast_image(image: Union["Image", str, Path]) -> str:
    """Convert a PIL image to a base64 data URI string.
    Parameters:
        image_object (Image): The PIL image to convert to a base64 data URI.
    Returns:
        str: The data URI string.
    """
    if isinstance(image, str):
        if image.startswith("data:") or image.startswith("http"):
            return image
        else:
            return filepath_to_data_uri(image)
    elif isinstance(image, Path):
        return filepath_to_data_uri(image)
    elif isinstance(image, Image.Image):
        return pil_to_data_uri(image)
    else:
        raise ValueError("The image must be a data URI string, a file path, or a PIL Image object.")
Convert a PIL image to a base64 data URI string.
    Parameters:
        image_object (Image): The PIL image to convert to a base64 data URI.
    Returns:
        str: The data URI string.
    
argilla/src/argilla/_helpers/_media.py