Skip to main content

PatternGuardrail

Defined in the guardrails module.
Rust AI Agent SDK Regex pattern guardrail.

Fields

NameTypeDescription
must_matchOption<String>Pattern to match (must match for success)
must_not_matchOption<String>Pattern to not match (must not match for success)

Methods

new

fn new() -> Self
Create a new pattern guardrail

must_match

fn must_match(mut self, pattern: impl Into<String>) -> Self
Set must match pattern Parameters:
NameType
patternimpl Into&lt;String&gt;

must_not_match

fn must_not_match(mut self, pattern: impl Into<String>) -> Self
Set must not match pattern Parameters:
NameType
patternimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/guardrails/mod.rs at line 404