From 3708d4c93f0ba410160482570ca50d68a48ef7eb Mon Sep 17 00:00:00 2001 From: jbolor21 <86250273+jbolor21@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:21:33 -0700 Subject: [PATCH 1/5] doc string on one more converter --- pyrit/prompt_converter/image_compression_converter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyrit/prompt_converter/image_compression_converter.py b/pyrit/prompt_converter/image_compression_converter.py index a0d25d9390..3673c81a09 100644 --- a/pyrit/prompt_converter/image_compression_converter.py +++ b/pyrit/prompt_converter/image_compression_converter.py @@ -66,12 +66,12 @@ def __init__( 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 + 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. From 772e225359399db0902c31cc3e5cf69c1f391798 Mon Sep 17 00:00:00 2001 From: jbolor21 <86250273+jbolor21@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:22:10 -0700 Subject: [PATCH 2/5] doc string on one more converter --- pyrit/prompt_converter/image_compression_converter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrit/prompt_converter/image_compression_converter.py b/pyrit/prompt_converter/image_compression_converter.py index 3673c81a09..bcaa73f160 100644 --- a/pyrit/prompt_converter/image_compression_converter.py +++ b/pyrit/prompt_converter/image_compression_converter.py @@ -65,7 +65,8 @@ def __init__( Initialize the converter with specified compression settings. Args: - output_format (str, optional): Output image format. If None, keeps original format (if supported). + 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 From a19181be0730893244e50ca51779afeae299efaa Mon Sep 17 00:00:00 2001 From: jbolor21 <86250273+jbolor21@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:26:41 -0700 Subject: [PATCH 3/5] fixing docstring --- pyrit/prompt_converter/negation_trap_converter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrit/prompt_converter/negation_trap_converter.py b/pyrit/prompt_converter/negation_trap_converter.py index 30974ff57f..092f010fd0 100644 --- a/pyrit/prompt_converter/negation_trap_converter.py +++ b/pyrit/prompt_converter/negation_trap_converter.py @@ -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: From 7eeb693c7f014c4157d5286f87fe31c099fd3681 Mon Sep 17 00:00:00 2001 From: jbolor21 <86250273+jbolor21@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:30:28 -0700 Subject: [PATCH 4/5] one more docstring --- pyrit/prompt_converter/ask_to_decode_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrit/prompt_converter/ask_to_decode_converter.py b/pyrit/prompt_converter/ask_to_decode_converter.py index b1fe47bd47..847360e37f 100644 --- a/pyrit/prompt_converter/ask_to_decode_converter.py +++ b/pyrit/prompt_converter/ask_to_decode_converter.py @@ -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 From 6179663d95703efba903365663112face8a57296 Mon Sep 17 00:00:00 2001 From: jbolor21 <86250273+jbolor21@users.noreply.github.com> Date: Fri, 3 Apr 2026 11:21:05 -0700 Subject: [PATCH 5/5] address comments, precommit --- pyrit/prompt_converter/image_compression_converter.py | 2 +- pyrit/prompt_converter/negation_trap_converter.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrit/prompt_converter/image_compression_converter.py b/pyrit/prompt_converter/image_compression_converter.py index bcaa73f160..7761dd0b40 100644 --- a/pyrit/prompt_converter/image_compression_converter.py +++ b/pyrit/prompt_converter/image_compression_converter.py @@ -65,7 +65,7 @@ def __init__( Initialize the converter with specified compression settings. Args: - output_format (str, optional): Output image format. Must be one of 'JPEG', 'PNG', or 'WEBP'. + 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). diff --git a/pyrit/prompt_converter/negation_trap_converter.py b/pyrit/prompt_converter/negation_trap_converter.py index 092f010fd0..1b03a38dfc 100644 --- a/pyrit/prompt_converter/negation_trap_converter.py +++ b/pyrit/prompt_converter/negation_trap_converter.py @@ -41,9 +41,9 @@ def __init__( Initialize the Negation Trap Converter. Args: - wrong_value: (str) A deliberately wrong value to use in the trap. The target + 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} + trap_template (str): A custom template string. Must include {prompt} and {wrong_value} placeholders. If None, uses the default denial template. Raises: