pub struct GuardrailsConfig {
pub filter_input: bool,
pub filter_output: bool,
pub keyword_rules: Vec<FilterRule>,
pub pattern_rules: Vec<FilterRule>,
pub enable_pii_detection: bool,
pub check_pii_input: bool,
pub check_pii_output: bool,
pub sanitize_replacement: String,
pub pii_replacement: String,
pub stop_on_first_block: bool,
}Expand description
Configuration for the Guardrails system
Fields§
§filter_input: boolWhether to filter input content
filter_output: boolWhether to filter output content
keyword_rules: Vec<FilterRule>Keyword-based filter rules
pattern_rules: Vec<FilterRule>Regex pattern-based filter rules
enable_pii_detection: boolEnable PII (Personally Identifiable Information) detection
check_pii_input: boolCheck PII in input
check_pii_output: boolCheck PII in output
sanitize_replacement: StringReplacement string for sanitization
pii_replacement: StringReplacement string for PII
stop_on_first_block: boolStop checking on first block
Implementations§
Source§impl GuardrailsConfig
impl GuardrailsConfig
Sourcepub fn builder() -> GuardrailsConfigBuilder
pub fn builder() -> GuardrailsConfigBuilder
Create a builder for GuardrailsConfig
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive configuration (no filtering)
Trait Implementations§
Source§impl Clone for GuardrailsConfig
impl Clone for GuardrailsConfig
Source§fn clone(&self) -> GuardrailsConfig
fn clone(&self) -> GuardrailsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GuardrailsConfig
impl Debug for GuardrailsConfig
Source§impl Default for GuardrailsConfig
impl Default for GuardrailsConfig
Source§impl<'de> Deserialize<'de> for GuardrailsConfig
impl<'de> Deserialize<'de> for GuardrailsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GuardrailsConfig
impl RefUnwindSafe for GuardrailsConfig
impl Send for GuardrailsConfig
impl Sync for GuardrailsConfig
impl Unpin for GuardrailsConfig
impl UnwindSafe for GuardrailsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more