pub struct RedactSecrets { /* private fields */ }Expand description
Replaces secrets in tool results before the model reads them, and before they are stored.
It sits at on_outcome because that is the one place a secret enters the conversation that
a hook can still stop: the request patch cannot edit messages, and a dispatch hook cannot
rewrite arguments, so what the user types and what the model writes in a call are not
scanned.
Implementations§
Trait Implementations§
Source§impl LoopHook for RedactSecrets
impl LoopHook for RedactSecrets
fn on_outcome<'life0, 'life1, 'async_trait>(
&'life0 self,
ev: Outcome<'life1>,
) -> Pin<Box<dyn Future<Output = OutcomeAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_settled<'life0, 'life1, 'async_trait>(
&'life0 self,
ev: Settled<'life1>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_run_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: RunStart<'life1>,
) -> Pin<Box<dyn Future<Output = RunStartAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_completion_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: CallEvent<'life1>,
) -> Pin<Box<dyn Future<Output = CallAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_model_turn_finished<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Turn<'life1>,
) -> Pin<Box<dyn Future<Output = TurnAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_dispatch<'life0, 'life1, 'async_trait>(
&'life0 self,
_ev: Dispatch<'life1>,
) -> Pin<Box<dyn Future<Output = DispatchAction> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl !Freeze for RedactSecrets
impl !RefUnwindSafe for RedactSecrets
impl !UnwindSafe for RedactSecrets
impl Forget for RedactSecrets
impl Move for RedactSecrets
impl Send for RedactSecrets
impl Sync for RedactSecrets
impl Unpin for RedactSecrets
impl UnsafeUnpin for RedactSecretswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ArcInner<dyn Fn(&str) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&str) + Sync + Send>>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<(String, usize)>: UnsafeUnpin,
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