LLMGuardrail

org.llm4s.agent.guardrails.LLMGuardrail
See theLLMGuardrail companion trait
object LLMGuardrail

Attributes

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

Members list

Value members

Concrete methods

def apply(client: LLMClient, prompt: String, passThreshold: Double, guardrailName: String, guardrailDescription: Option[String]): LLMGuardrail

Builds a judge guardrail from a prompt, without defining a class.

Builds a judge guardrail from a prompt, without defining a class.

Value parameters

client

the client that makes the judge call

guardrailDescription

the description; when absent it is LLM-based validation: <prompt> (threshold: <t>)

guardrailName

the name shown in failure messages (default CustomLLMGuardrail)

passThreshold

the lowest score that passes (default 0.7); it must be between 0.0 and 1.0, or validate fails with a ValidationError on field threshold before calling the judge

prompt

the evaluation criteria, as for evaluationPrompt

Attributes

Returns

a guardrail that uses the default completion options