Read more about here.
Funny looking at some of the code as eg prevent user to use bad word in Prompt,
good old Regex👀 is used(so i guess AI🫣 is not good for all).
Here is the Function from
Funny looking at some of the code as eg prevent user to use bad word in Prompt,
good old Regex👀 is used(so i guess AI🫣 is not good for all).
Here is the Function from
userPromptKeywords.ts rewritten in Python.import re
NEGATIVE_PATTERN = re.compile(
r"\b("
r"wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|"
r"piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|"
r"fucking? (broken|useless|terrible|awful|horrible)|fuck you|"
r"screw (this|you)|so frustrating|this sucks|damn it"
r")\b"
)
def matches_negative_keyword(text: str) -> bool:
lower_input = text.lower()
return bool(NEGATIVE_PATTERN.search(lower_input))Test.>>> word = 'damn it' >>> matches_negative_keyword(word) True >>> # Can bypass with a typo or other words usage >>> word = 'dammn it' >>> matches_negative_keyword(word) False >>> word = 'screw you' >>> matches_negative_keyword(word) True >>> word = 'screw all' >>> matches_negative_keyword(word) False
