File size: 392 Bytes
7948ff4
 
 
 
e5c2fd4
7948ff4
 
 
 
 
1
2
3
4
5
6
7
8
9
10

// 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.VC_MODERATION_FILTER_PATTERN}`)

export const hasBadWords = (userPrompt: string) => {
  const normalized = userPrompt.trim().toLowerCase()
  return !!config[normalized]
}