ProfanityFilter

org.llm4s.agent.guardrails.builtin.ProfanityFilter
See theProfanityFilter companion class

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

Create a profanity filter with the built-in word list, case-insensitive.

Create a profanity filter with the built-in word list, case-insensitive.

Attributes

Returns

a filter equivalent to new ProfanityFilter()

def caseSensitive(customWords: Set[String]): ProfanityFilter

Create a case-sensitive profanity filter.

Create a case-sensitive profanity filter.

Text and word-list entries are compared without case folding (after the same Unicode normalisation), so the lower-case built-in words do not match their upper-case spellings.

Value parameters

customWords

single words to reject in addition to the built-in list; empty by default

Attributes

Returns

a filter equivalent to new ProfanityFilter(customWords, caseSensitive = true)

def withCustomWords(customWords: Set[String]): ProfanityFilter

Create a case-insensitive profanity filter that also rejects customWords.

Create a case-insensitive profanity filter that also rejects customWords.

Value parameters

customWords

single words to reject in addition to the built-in list

Attributes

Returns

a filter equivalent to new ProfanityFilter(customBadWords = customWords)