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.
GuardrailConfig
Defined in the guardrails module.
Rust AI Agent SDK
Configuration for guardrails.
Fields
| Name | Type | Description |
|---|
on_failure | GuardrailAction | Action to take on failure |
max_retries | usize | Maximum retries if action is Retry |
fallback_response | Option<String> | Fallback response if action is Fallback |
log_results | bool | Whether to log validation results |
error_template | Option<String> | Custom error message template |
Methods
new
Create new config
on_failure
fn on_failure(mut self, action: GuardrailAction) -> Self
Set failure action
Parameters:
| Name | Type |
|---|
action | GuardrailAction |
max_retries
fn max_retries(mut self, retries: usize) -> Self
Set max retries
Parameters:
fallback_response
fn fallback_response(mut self, response: impl Into<String>) -> Self
Set fallback response
Parameters:
| Name | Type |
|---|
response | impl Into<String> |
log_results
fn log_results(mut self, log: bool) -> Self
Set log results
Parameters:
error_template
fn error_template(mut self, template: impl Into<String>) -> Self
Set error template
Parameters:
| Name | Type |
|---|
template | impl Into<String> |
Source
View on GitHub
praisonai/src/guardrails/mod.rs at line 199