Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
GuardrailChain
Defined in the guardrails module.
Rust AI Agent SDK
Chain of guardrails to run in sequence.
Fields
| Name | Type | Description |
|---|
guardrails | Vec<Box<dyn Guardrail>> | - |
config | GuardrailConfig | - |
Methods
new
Create a new guardrail chain
add
fn add(mut self, guardrail: impl Guardrail + 'static) -> Self
Add a guardrail to the chain
Parameters:
| Name | Type |
|---|
guardrail | impl Guardrail + 'static |
config
fn config(mut self, config: GuardrailConfig) -> Self
Set config
Parameters:
| Name | Type |
|---|
config | GuardrailConfig |
validate
fn validate(&self, output: &str) -> GuardrailResult
Validate output through all guardrails
Parameters:
len
Get guardrail count
is_empty
fn is_empty(&self) -> bool
Check if empty
Source
View on GitHub
praisonai/src/guardrails/mod.rs at line 479