pyrit.models.ImagePathDataTypeSerializer#
- class ImagePathDataTypeSerializer(*, category: str, prompt_text: str | None = None, extension: str | None = None)[source]#
Bases:
DataTypeSerializerMethods
__init__(*, category[, prompt_text, extension])Returns True if the data is stored on disk.
get_data_filename([file_name])Generates or retrieves a unique filename for the data file.
get_extension(file_path)Get the file extension from the file path.
get_mime_type(file_path)Get the MIME type of the file path.
get_sha256()read_data()Reads the data from the storage.
read_data_base64()Reads the data from the storage.
save_b64_image(data[, output_filename])Saves the base64 encoded image to storage.
save_data(data[, output_filename])Saves the data to storage.
save_formatted_audio(data[, num_channels, ...])Saves the PCM16 of other specially formatted audio data to storage.
Attributes