Skip to main content

SessionHooks

Trait SessionHooks 

Source
pub trait SessionHooks: Send + Sync {
    // Provided methods
    fn on_session_start(&self, _session_id: &str) { ... }
    fn on_turn_start(&self, _session_id: &str, _task: &str) { ... }
    fn on_tool_call(&self, _invocation: &ToolInvocation) { ... }
    fn on_tool_result(&self, _result: &ToolResult) { ... }
    fn on_turn_end(&self, _session_id: &str, _output: &str) { ... }
    fn on_session_end(&self, _session_id: &str) { ... }
}

Provided Methods§

Source

fn on_session_start(&self, _session_id: &str)

Source

fn on_turn_start(&self, _session_id: &str, _task: &str)

Source

fn on_tool_call(&self, _invocation: &ToolInvocation)

Source

fn on_tool_result(&self, _result: &ToolResult)

Source

fn on_turn_end(&self, _session_id: &str, _output: &str)

Source

fn on_session_end(&self, _session_id: &str)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§