Length Guardrail • Rust AI Agent SDK
LengthGuardrail: Content length guardrail.
LengthGuardrail
Defined in the guardrails module.
Rust AI Agent SDK
Content length guardrail.
Fields
| Name | Type | Description |
|---|---|---|
min_length | Option<usize> | Minimum length |
max_length | Option<usize> | Maximum length |
Methods
new
fn new() -> SelfCreate a new length guardrail
min
fn min(mut self, length: usize) -> SelfSet minimum length
Parameters:
| Name | Type |
|---|---|
length | usize |
max
fn max(mut self, length: usize) -> SelfSet maximum length
Parameters:
| Name | Type |
|---|---|
length | usize |
Source
View on GitHubpraisonai/src/guardrails/mod.rs at line 267