Guard
A configured guardrail ready to be attached to a ChatBot.
Usage
Guard()Parameter Attributes
name: strfunc: Callable[[str], GuardResult]phase: GuardPhase = GuardPhase.BOTHstates: list[str] | None = None
Attributes
name: str-
Human-readable guard name (used in telemetry and error messages).
func: Callable[[str], GuardResult]-
The guard function: takes a string, returns a GuardResult.
phase: GuardPhase- When this guard runs (input, output, or both).