def filepath_to_data_uri(file_path: "Path") -> str:
    """Convert an image file to a base64 data URI string."""
    file_path = Path(file_path)
    if file_path.exists():
        with open(file_path, "rb") as image_file:
            img_str = base64.b64encode(image_file.read()).decode()
            mimetype = f"image/{file_path.suffix[1:]}"
            data_uri = f"data:{mimetype};base64,{img_str}"
    else:
        raise FileNotFoundError(f"File not found at {file_path}")

    return data_uri
Convert an image file to a base64 data URI string.
argilla/src/argilla/_helpers/_media.py