pub struct SessionIdHook {
pub session_id: String,
}Expand description
Session-aware hook that logs tool calls and completions with session context
Fields§
§session_id: StringImplementations§
Trait Implementations§
Source§impl Clone for SessionIdHook
impl Clone for SessionIdHook
Source§fn clone(&self) -> SessionIdHook
fn clone(&self) -> SessionIdHook
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M: CompletionModel> StreamingPromptHook<M> for SessionIdHook
impl<M: CompletionModel> StreamingPromptHook<M> for SessionIdHook
Source§async fn on_tool_call(
&self,
tool_name: &str,
_tool_call_id: Option<String>,
args: &str,
_cancel_sig: CancelSignal,
)
async fn on_tool_call( &self, tool_name: &str, _tool_call_id: Option<String>, args: &str, _cancel_sig: CancelSignal, )
Called before a tool is invoked.
Source§async fn on_tool_result(
&self,
tool_name: &str,
_tool_call_id: Option<String>,
_args: &str,
result: &str,
_cancel_sig: CancelSignal,
)
async fn on_tool_result( &self, tool_name: &str, _tool_call_id: Option<String>, _args: &str, result: &str, _cancel_sig: CancelSignal, )
Called after a tool is invoked (and a result has been returned).
Source§async fn on_completion_call(
&self,
_prompt: &Message,
_history: &[Message],
_cancel_sig: CancelSignal,
)
async fn on_completion_call( &self, _prompt: &Message, _history: &[Message], _cancel_sig: CancelSignal, )
Called before the prompt is sent to the model
Source§async fn on_text_delta(
&self,
_text_delta: &str,
_aggregated_text: &str,
_cancel_sig: CancelSignal,
)
async fn on_text_delta( &self, _text_delta: &str, _aggregated_text: &str, _cancel_sig: CancelSignal, )
Called when receiving a text delta
Source§async fn on_tool_call_delta(
&self,
_tool_call_id: &str,
_tool_name: Option<&str>,
_tool_call_delta: &str,
_cancel_sig: CancelSignal,
)
async fn on_tool_call_delta( &self, _tool_call_id: &str, _tool_name: Option<&str>, _tool_call_delta: &str, _cancel_sig: CancelSignal, )
Called when receiving a tool call delta.
tool_name is Some on the first delta for a tool call, None on subsequent deltas.Source§async fn on_stream_completion_response_finish(
&self,
_prompt: &Message,
_response: &M::StreamingResponse,
_cancel_sig: CancelSignal,
)
async fn on_stream_completion_response_finish( &self, _prompt: &Message, _response: &M::StreamingResponse, _cancel_sig: CancelSignal, )
Called after the model provider has finished streaming a text response from their completion API to the client.
Auto Trait Implementations§
impl Freeze for SessionIdHook
impl RefUnwindSafe for SessionIdHook
impl Send for SessionIdHook
impl Sync for SessionIdHook
impl Unpin for SessionIdHook
impl UnwindSafe for SessionIdHook
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