pub struct DefaultGuard { /* private fields */ }Expand description
Default guard implementation
Does not manage its own state; uses RunState information from GuardCtx.
Implementations§
Source§impl DefaultGuard
impl DefaultGuard
pub fn new(config: DefaultGuardConfig) -> Self
Sourcepub fn with_llm_client(
config: DefaultGuardConfig,
llm_client: Arc<dyn LlmProvider>,
) -> Self
pub fn with_llm_client( config: DefaultGuardConfig, llm_client: Arc<dyn LlmProvider>, ) -> Self
Create a new DefaultGuard with LLM client for judge functionality
Trait Implementations§
Source§impl ReactLoopGuard for DefaultGuard
impl ReactLoopGuard for DefaultGuard
Source§fn on_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 GuardCtx,
) -> Pin<Box<dyn Future<Output = GuardDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_turn<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 GuardCtx,
) -> Pin<Box<dyn Future<Output = GuardDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unified entry point — guard judges the scene and returns a decision.
Source§fn on_tool_call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 GuardCtx,
) -> Pin<Box<dyn Future<Output = GuardDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_tool_call<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 GuardCtx,
) -> Pin<Box<dyn Future<Output = GuardDecision> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Callback when model calls a tool (new) Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultGuard
impl !UnwindSafe for DefaultGuard
impl Freeze for DefaultGuard
impl Send for DefaultGuard
impl Sync for DefaultGuard
impl Unpin for DefaultGuard
impl UnsafeUnpin for DefaultGuard
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