adk_agent/
guardrails.rs

1//! Guardrail integration for LlmAgent
2//!
3//! This module provides guardrail support when the `guardrails` feature is enabled.
4
5#[cfg(feature = "guardrails")]
6pub use adk_guardrail::{
7    ContentFilter, ContentFilterConfig, Guardrail, GuardrailExecutor, GuardrailResult,
8    GuardrailSet, PiiRedactor, PiiType, Severity,
9};
10
11#[cfg(feature = "guardrails")]
12pub use adk_guardrail::SchemaValidator;
13
14/// Placeholder type when guardrails feature is disabled
15#[cfg(not(feature = "guardrails"))]
16pub struct GuardrailSet;
17
18#[cfg(not(feature = "guardrails"))]
19impl GuardrailSet {
20    pub fn new() -> Self {
21        Self
22    }
23    pub fn is_empty(&self) -> bool {
24        true
25    }
26}
27
28#[cfg(not(feature = "guardrails"))]
29impl Default for GuardrailSet {
30    fn default() -> Self {
31        Self::new()
32    }
33}