Pattern Guardrail • Rust AI Agent SDK
PatternGuardrail: Regex pattern guardrail.
PatternGuardrail
Defined in the guardrails module.
Rust AI Agent SDK
Regex pattern guardrail.
Fields
| Name | Type | Description |
|---|---|---|
must_match | Option<String> | Pattern to match (must match for success) |
must_not_match | Option<String> | Pattern to not match (must not match for success) |
Methods
new
fn new() -> SelfCreate a new pattern guardrail
must_match
fn must_match(mut self, pattern: impl Into<String>) -> SelfSet must match pattern
Parameters:
| Name | Type |
|---|---|
pattern | impl Into<String> |
must_not_match
fn must_not_match(mut self, pattern: impl Into<String>) -> SelfSet must not match pattern
Parameters:
| Name | Type |
|---|---|
pattern | impl Into<String> |
Source
View on GitHubpraisonai/src/guardrails/mod.rs at line 404