From 7c4f7f6dc03e0374ea71a078f436433b96c9481a Mon Sep 17 00:00:00 2001 From: Nabeel Chhatriwala Date: Fri, 22 Nov 2024 16:28:01 -0500 Subject: [PATCH] fix: corrected unaligned attacks enum to match promptfoo --- deepeval/red_teaming/types.py | 39 ++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/deepeval/red_teaming/types.py b/deepeval/red_teaming/types.py index 029f2deab..e7c16e69e 100644 --- a/deepeval/red_teaming/types.py +++ b/deepeval/red_teaming/types.py @@ -174,23 +174,24 @@ class LLMRiskCategories(Enum): } unaligned_vulnerability_to_api_code_map = { - Vulnerability.VIOLENT_CRIME: "Violent Crimes", - Vulnerability.NON_VIOLENT_CRIME: "Non-Violent Crimes", - Vulnerability.SEX_CRIME: "Sex Crimes", - Vulnerability.CHILD_EXPLOITATION: "Child Exploitation", - Vulnerability.INDISCRIMINATE_WEAPONS: "Indiscriminate Weapons", - Vulnerability.HATE: "Hate", - Vulnerability.SELF_HARM: "Self-Harm", - Vulnerability.SEXUAL_CONTENT: "Sexual Content", - Vulnerability.CYBERCRIME: "Cybercrime & Unauthorized Intrusion - Hacking and Malware", - Vulnerability.CHEMICAL_BIOLOGICAL_WEAPONS: "Chemical & Biological Weapons", - Vulnerability.ILLEGAL_DRUGS: "Illegal Drugs", - Vulnerability.COPYRIGHT_VIOLATIONS: "Copyright Violations - Copyrighted text", - Vulnerability.HARASSMENT_BULLYING: "Harassment & Bullying", - Vulnerability.ILLEGAL_ACTIVITIES: "Illegal Activities - Fraud & scams", - Vulnerability.GRAPHIC_CONTENT: "Graphic & age-restricted content", - Vulnerability.UNSAFE_PRACTICES: "Promotion of unsafe practices", - Vulnerability.RADICALIZATION: "Radicalization", - Vulnerability.PROFANITY: "Requests containing profanity", - Vulnerability.INSULTS: "Insults and personal attacks", + Vulnerability.VIOLENT_CRIME: "harmful:violent-crime", + Vulnerability.NON_VIOLENT_CRIME: "harmful:non-violent-crime", + Vulnerability.SEX_CRIME: "harmful:sex-crime", + Vulnerability.CHILD_EXPLOITATION: "harmful:child-exploitation", + Vulnerability.INDISCRIMINATE_WEAPONS: "harmful:indiscriminate-weapons", + Vulnerability.HATE: "harmful:hate", + Vulnerability.SELF_HARM: "harmful:self-harm", + Vulnerability.SEXUAL_CONTENT: "harmful:sexual-content", + Vulnerability.CYBERCRIME: "harmful:cybercrime", + Vulnerability.CHEMICAL_BIOLOGICAL_WEAPONS: "harmful:chemical-biological-weapons", + Vulnerability.ILLEGAL_DRUGS: "harmful:illegal-drugs", + Vulnerability.COPYRIGHT_VIOLATIONS: "harmful:copyright-violations", + Vulnerability.HARASSMENT_BULLYING: "harmful:harassment-bullying", + Vulnerability.ILLEGAL_ACTIVITIES: "harmful:illegal-activities", + Vulnerability.GRAPHIC_CONTENT: "harmful:graphic-content", + Vulnerability.UNSAFE_PRACTICES: "harmful:unsafe-practices", + Vulnerability.RADICALIZATION: "harmful:radicalization", + Vulnerability.PROFANITY: "harmful:profanity", + Vulnerability.INSULTS: "harmful:insults", } +