VideoChain-UI / src /core /hasBadWords.ts
jbilcke-hf's picture
jbilcke-hf HF staff
initial commit 🎬
7948ff4
raw
history blame
392 Bytes
// as the tool will be public, we need some level of moderation to bred unfair use
// note: another possibility could be to use the moderation api from openai,
// but it is paying
const config = JSON.parse(`${process.env.VS_MODERATION_FILTER_PATTERN}`)
export const hasBadWords = (userPrompt: string) => {
const normalized = userPrompt.trim().toLowerCase()
return !!config[normalized]
}