Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyrit/prompt_converter/ask_to_decode_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, template: Optional[str] = None, encoding_name: str = "cipher"
If None, a random template is selected. Defaults to None.
encoding_name (str, optional): Name of the encoding scheme (e.g., "Base64",
"ROT13", "Morse"). Used in encoding_name_templates to provide context
about the encoding type. Defaults to empty string.
about the encoding type. Defaults to "cipher".
"""
self._encoding_name = encoding_name
self._template = template
Expand Down
11 changes: 6 additions & 5 deletions pyrit/prompt_converter/image_compression_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ def __init__(
Initialize the converter with specified compression settings.

Args:
output_format (str, optional): Output image format. If None, keeps original format (if supported).
quality (int, optional): General quality setting for JPEG and WEBP formats (0-100).\n
For JPEG format, it represents the image quality, on a scale from 0 (worst) to 95 (best).\n
output_format (str, optional): Output image format. Must be one of 'JPEG', 'PNG', or 'WEBP'.
If None, keeps original format (if supported).
quality (int, optional): General quality setting for JPEG and WEBP formats (0-100).
For JPEG format, it represents the image quality, on a scale from 0 (worst) to 95 (best).
For WEBP format, the value ranges from 0 to 100; for lossy compression: 0-smallest file size and
100-largest; for ``lossless``: 0-fastest/less efficient, and 100 gives the best compression.
optimize (bool, optional): Whether to optimize the image during compression. \n
For JPEG: makes the encoder perform an extra pass over the image to select optimal settings.\n
optimize (bool, optional): Whether to optimize the image during compression.
For JPEG: makes the encoder perform an extra pass over the image to select optimal settings.
For PNG: instructs the PNG writer to make the output file as small as possible.
progressive (bool, optional): Whether to save JPEG images as progressive.
compress_level (int, optional): ZLIB compression level (0-9): 1=fastest, 9=best, 0=none.
Expand Down
6 changes: 3 additions & 3 deletions pyrit/prompt_converter/negation_trap_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def __init__(
Initialize the Negation Trap Converter.

Args:
wrong_value: A deliberately wrong value to use in the trap. The target
may reveal the correct value when correcting this.
trap_template: A custom template string. Must include {prompt} and {wrong_value}
wrong_value (str): A deliberately wrong value to use in the trap. The target
may reveal the correct value when correcting this. Defaults to "incorrect_guess".
trap_template (str): A custom template string. Must include {prompt} and {wrong_value}
placeholders. If None, uses the default denial template.

Raises:
Expand Down
Loading