pyrit.models.get_all_harm_definitions#
- get_all_harm_definitions() Dict[str, HarmDefinition][source]#
Load all harm definitions from the standard harm_definition directory.
This function scans the HARM_DEFINITION_PATH directory for all YAML files and loads each one as a HarmDefinition.
- Returns:
- A dictionary mapping category names to their
HarmDefinition objects. The keys are the category names from the YAML files (e.g., “violence”, “hate_speech”).
- Return type:
Dict[str, HarmDefinition]
- Raises:
ValueError – If any YAML file in the directory is invalid.