LLMSafetyGuardrail

org.llm4s.agent.guardrails.builtin.LLMSafetyGuardrail
See theLLMSafetyGuardrail companion class

Attributes

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

Members list

Value members

Concrete methods

def apply(client: LLMClient, threshold: Double): LLMSafetyGuardrail

Builds a safety guardrail with the five built-in criteria.

Builds a safety guardrail with the five built-in criteria.

Value parameters

client

the client that makes the judge call

threshold

the lowest score that passes (default 0.8)

Attributes

Builds a guardrail for child audiences: a threshold of 0.95 and three extra criteria, numbered 6 to 8, for age-inappropriate themes, scary or disturbing content, and complex adult topics.

Builds a guardrail for child audiences: a threshold of 0.95 and three extra criteria, numbered 6 to 8, for age-inappropriate themes, scary or disturbing content, and complex adult topics.

Value parameters

client

the client that makes the judge call

Attributes

Builds a safety guardrail with a threshold of 0.95, which passes only content the judge rates as safe.

Builds a safety guardrail with a threshold of 0.95, which passes only content the judge rates as safe.

Value parameters

client

the client that makes the judge call

Attributes

def withCustomCriteria(client: LLMClient, customCriteria: String, threshold: Double): LLMSafetyGuardrail

Builds a safety guardrail whose prompt carries extra criteria after the five built-in ones.

Builds a safety guardrail whose prompt carries extra criteria after the five built-in ones.

Value parameters

client

the client that makes the judge call

customCriteria

the extra criteria, appended verbatim under Additional criteria:

threshold

the lowest score that passes (default 0.8)

Attributes