garak.generators.test
Test generators
These give simple system responses, intended for testing.
- class Blank(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis generator always returns the empty string.
- generator_family_name = 'Test'
- name = 'Blank'
- supports_multiple_generations = True
- class BlankVision(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis text+image input generator always returns the empty string.
- generator_family_name = 'Test'
- name = 'BlankVision'
- supports_multiple_generations = True
- class Lipsum(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorLorem Ipsum generator, so we can get non-zero outputs that vary
- Configurable parameters:
- unit: str - content unit to generate per output.
Must be one of “sentence”, “paragraph”, or “text”.
count: int - How many of the specified unit to join per output.
Configurable parameters:
DEFAULT_PARAMScontents:max_tokens=150temperature=Nonetop_k=Nonecontext_len=Noneskip_seq_start=Noneskip_seq_end=Noneunit='sentence'count=1
Default values are listed
See also Configuring garak for how to set these values.
Other attributes:
- generator_family_name = 'Test'
- name = 'Lorem Ipsum'
- supports_multiple_generations = False
- class Nones(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis generator always returns a None for every generation.
- generator_family_name = 'Test'
- name = 'Nones'
- supports_multiple_generations = True
- class ReasoningLipsum(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
LipsumLorem Ipsum generator with a simulated reasoning trace, for testing probe/detector behavior with long structured outputs.
- Generates output in the format:
{skip_seq_start}{reasoning text}{skip_seq_end}{output text}
- Configurable parameters:
skip_seq_start: str - Opening delimiter for the reasoning trace.
skip_seq_end: str - Closing delimiter for the reasoning trace.
reasoning_length: int - Target character count for the reasoning trace.
output_length: int - Target character count for the output text.
- variance: float - Fraction (0.0–1.0) by which reasoning_length and
output_length may deviate from configured values. 0.1 means ±10%.
- respect_max_tokens: bool - Cap the output text (not the
reasoning trace) to approximately max_tokens * 1.4 characters.
Configurable parameters:
DEFAULT_PARAMScontents:max_tokens=150temperature=Nonetop_k=Nonecontext_len=Noneskip_seq_start='<think>'skip_seq_end='</think>'unit='sentence'count=1reasoning_length=2000output_length=500variance=0.1respect_max_tokens=False
Default values are listed
See also Configuring garak for how to set these values.
Other attributes:
- generator_family_name = 'Test'
- name = 'Reasoning Lipsum'
- supports_multiple_generations = False
- class Repeat(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis generator returns the last message from input that was posed to it.
- generator_family_name = 'Test'
- name = 'Repeat'
- supports_multiple_generations = True
- class Single(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source
Bases:
GeneratorThis generator returns the a fixed string and does not support multiple generations.
- generator_family_name = 'Test'
- name = 'Single'
- supports_multiple_generations = False
- test_generation_string = 'ELIM'