LLMFactualityGuardrail

org.llm4s.agent.guardrails.builtin.LLMFactualityGuardrail
See theLLMFactualityGuardrail 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, referenceContext: String, threshold: Double): LLMFactualityGuardrail

Builds a factuality guardrail for a reference text.

Builds a factuality guardrail for a reference text.

Value parameters

client

the client that makes the judge call

referenceContext

the text the content is checked against

threshold

the lowest score that passes (default 0.7)

Attributes

def lenient(client: LLMClient, referenceContext: String): LLMFactualityGuardrail

Builds a factuality guardrail with a threshold of 0.5.

Builds a factuality guardrail with a threshold of 0.5.

The lower threshold is the only difference from apply; it does not guarantee that claims the context does not cover pass. The rubric scores 0.5 only for content that mixes supported and unverifiable claims, so content none of whose claims the context supports may still score below 0.5 and fail (see the class documentation).

Value parameters

client

the client that makes the judge call

referenceContext

the text the content is checked against

Attributes

def strict(client: LLMClient, referenceContext: String): LLMFactualityGuardrail

Builds a factuality guardrail with a threshold of 0.9.

Builds a factuality guardrail with a threshold of 0.9.

Value parameters

client

the client that makes the judge call

referenceContext

the text the content is checked against

Attributes