Struct WebhookAuditHook
pub struct WebhookAuditHook { /* private fields */ }Expand description
Sends an HTTP POST with a JSON audit payload for matching tool calls.
Arguments are not retained between the before and after phases: completion carries the arguments that were actually dispatched, they are scrubbed and truncated at export time, and a call that never completes therefore leaves nothing behind — including when the turn future is dropped by an outer timeout or cancellation.
Implementations§
Source§impl WebhookAuditHook
impl WebhookAuditHook
pub fn new(config: WebhookAuditConfig) -> Result<WebhookAuditHook, String>
Trait Implementations§
Source§impl HookHandler for WebhookAuditHook
impl HookHandler for WebhookAuditHook
fn name(&self) -> &str
fn priority(&self) -> i32
Source§fn before_tool_call_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
_context: &'life1 ToolCallHookContext,
name: String,
args: Value,
) -> Pin<Box<dyn Future<Output = HookResult<(String, Value)>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WebhookAuditHook: 'async_trait,
fn before_tool_call_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
_context: &'life1 ToolCallHookContext,
name: String,
args: Value,
) -> Pin<Box<dyn Future<Output = HookResult<(String, Value)>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
WebhookAuditHook: 'async_trait,
Inspect or modify a tool call with explicit correlation context. Read more
Source§fn on_after_tool_call_with_context_and_args<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 ToolCallHookContext,
tool: &'life2 str,
args: &'life3 Value,
result: &'life4 ToolResult,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
WebhookAuditHook: 'async_trait,
fn on_after_tool_call_with_context_and_args<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
context: &'life1 ToolCallHookContext,
tool: &'life2 str,
args: &'life3 Value,
result: &'life4 ToolResult,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
WebhookAuditHook: 'async_trait,
Observe tool completion with explicit correlation context and the
arguments that were actually dispatched. Read more
Source§fn on_after_tool_call_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 ToolCallHookContext,
tool: &'life2 str,
result: &'life3 ToolResult,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
WebhookAuditHook: 'async_trait,
fn on_after_tool_call_with_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 ToolCallHookContext,
tool: &'life2 str,
result: &'life3 ToolResult,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
WebhookAuditHook: 'async_trait,
Observe tool completion with explicit correlation context. Read more
fn on_after_tool_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
result: &'life2 ToolResult,
duration: Duration,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
WebhookAuditHook: 'async_trait,
fn on_gateway_start<'life0, 'life1, 'async_trait>(
&'life0 self,
_host: &'life1 str,
_port: u16,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_gateway_stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_session_start<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
_channel: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_session_end<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_session_id: &'life1 str,
_channel: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_llm_input<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_messages: &'life1 [ChatMessage],
_model: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_llm_output<'life0, 'life1, 'async_trait>(
&'life0 self,
_response: &'life1 ChatResponse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn on_tool_call_abandoned<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_context: &'life1 ToolCallHookContext,
_tool: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn on_tool_call_abandoned<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_context: &'life1 ToolCallHookContext,
_tool: &'life2 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Observe that a tool-call context will never reach its after phase. Read more
fn on_message_sent<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_channel: &'life1 str,
_recipient: &'life2 str,
_content: &'life3 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn on_heartbeat_tick<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn before_model_resolve<'life0, 'async_trait>(
&'life0 self,
model_provider: String,
model: String,
) -> Pin<Box<dyn Future<Output = HookResult<(String, String)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn before_prompt_build<'life0, 'async_trait>(
&'life0 self,
prompt: String,
) -> Pin<Box<dyn Future<Output = HookResult<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn before_llm_call<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_messages: &'life1 mut Vec<ChatMessage>,
_model: &'life2 mut String,
) -> Pin<Box<dyn Future<Output = HookResult<()>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn before_tool_call<'life0, 'async_trait>(
&'life0 self,
name: String,
args: Value,
) -> Pin<Box<dyn Future<Output = HookResult<(String, Value)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_message_received<'life0, 'async_trait>(
&'life0 self,
message: ChannelMessage,
) -> Pin<Box<dyn Future<Output = HookResult<ChannelMessage>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn on_message_sending<'life0, 'async_trait>(
&'life0 self,
channel: String,
recipient: String,
content: String,
) -> Pin<Box<dyn Future<Output = HookResult<(String, String, String)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for WebhookAuditHook
impl RefUnwindSafe for WebhookAuditHook
impl Send for WebhookAuditHook
impl Sync for WebhookAuditHook
impl Unpin for WebhookAuditHook
impl UnsafeUnpin for WebhookAuditHook
impl UnwindSafe for WebhookAuditHook
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more