ToneValidator

org.llm4s.agent.guardrails.builtin.ToneValidator
See theToneValidator companion class
object ToneValidator

Attributes

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

Members list

Value members

Concrete methods

A validator that accepts every tone in Tone.all, so validate always returns Right.

A validator that accepts every tone in Tone.all, so validate always returns Right.

Attributes

def apply(allowedTones: Set[Tone]): ToneValidator

Create a tone validator that accepts the given tones.

Create a tone validator that accepts the given tones.

Value parameters

allowedTones

the tones that pass; see ToneValidator for how a text's tone is detected

Attributes

Returns

a validator equivalent to new ToneValidator(allowedTones)

A validator that accepts Tone.Casual or Tone.Friendly output, and rejects the rest.

A validator that accepts Tone.Casual or Tone.Friendly output, and rejects the rest.

Attributes

A validator that accepts only Tone.Professional output.

A validator that accepts only Tone.Professional output.

Output with no professional keyword, such as plain factual text, is Neutral and is rejected; add Tone.Neutral through ToneValidator(Set(Tone.Professional, Tone.Neutral)) to let it through.

Attributes

A validator that accepts Tone.Professional or Tone.Friendly output, and rejects the rest.

A validator that accepts Tone.Professional or Tone.Friendly output, and rejects the rest.

Attributes