Struct HookRunner
pub struct HookRunner { /* private fields */ }Implementations§
Source§impl HookRunner
impl HookRunner
pub fn from_config(hooks: &HooksConfig) -> Self
Sourcepub fn register(&mut self, handler: Box<dyn HookHandler>)
pub fn register(&mut self, handler: Box<dyn HookHandler>)
Register a handler and re-sort by descending priority.
pub async fn fire_gateway_start(&self, host: &str, port: u16)
pub async fn fire_gateway_stop(&self)
pub async fn fire_session_start(&self, session_id: &str, channel: &str)
pub async fn fire_session_end(&self, session_id: &str, channel: &str)
pub async fn fire_llm_input(&self, messages: &[ChatMessage], model: &str)
pub async fn fire_llm_output(&self, response: &ChatResponse)
pub async fn fire_after_tool_call( &self, tool: &str, result: &ToolResult, duration: Duration, )
pub async fn fire_message_sent( &self, channel: &str, recipient: &str, content: &str, )
pub async fn fire_heartbeat_tick(&self)
pub async fn run_before_model_resolve( &self, model_provider: String, model: String, ) -> HookResult<(String, String)>
pub async fn run_before_prompt_build( &self, prompt: String, ) -> HookResult<String>
pub async fn run_before_llm_call( &self, messages: &mut Vec<ChatMessage>, model: &mut String, ) -> HookResult<()>
pub async fn run_before_tool_call( &self, name: String, args: Value, ) -> HookResult<(String, Value)>
pub async fn run_on_message_received( &self, message: ChannelMessage, ) -> HookResult<ChannelMessage>
pub async fn run_on_message_sending( &self, channel: String, recipient: String, content: String, ) -> HookResult<(String, String, String)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookRunner
impl !RefUnwindSafe for HookRunner
impl Send for HookRunner
impl Sync for HookRunner
impl Unpin for HookRunner
impl UnsafeUnpin for HookRunner
impl !UnwindSafe for HookRunner
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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