pub struct OutrigPromptHook { /* private fields */ }Expand description
Per-request hook that traces every tool call to stderr and stops the agent
loop after max calls. Cloned by rig per request; shared atomics keep a
single turn’s calls counting against the same max.
Implementations§
Trait Implementations§
Source§impl Clone for OutrigPromptHook
impl Clone for OutrigPromptHook
Source§fn clone(&self) -> OutrigPromptHook
fn clone(&self) -> OutrigPromptHook
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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> PromptHook<M> for OutrigPromptHook
impl<M: CompletionModel> PromptHook<M> for OutrigPromptHook
Source§async fn on_completion_call(
&self,
_prompt: &Message,
_history: &[Message],
) -> HookAction
async fn on_completion_call( &self, _prompt: &Message, _history: &[Message], ) -> HookAction
Called before the prompt is sent to the model
Source§async fn on_tool_call(
&self,
tool_name: &str,
_tool_call_id: Option<String>,
_internal_call_id: &str,
args: &str,
) -> ToolCallHookAction
async fn on_tool_call( &self, tool_name: &str, _tool_call_id: Option<String>, _internal_call_id: &str, args: &str, ) -> ToolCallHookAction
Called before a tool is invoked. Read more
Source§fn on_completion_response(
&self,
_prompt: &Message,
_response: &CompletionResponse<<M as CompletionModel>::Response>,
) -> impl Future<Output = HookAction> + WasmCompatSend
fn on_completion_response( &self, _prompt: &Message, _response: &CompletionResponse<<M as CompletionModel>::Response>, ) -> impl Future<Output = HookAction> + WasmCompatSend
Called after the prompt is sent to the model and a response is received.
Source§fn on_invalid_tool_call(
&self,
_context: &InvalidToolCallContext,
) -> impl Future<Output = InvalidToolCallHookAction> + WasmCompatSend
fn on_invalid_tool_call( &self, _context: &InvalidToolCallContext, ) -> impl Future<Output = InvalidToolCallHookAction> + WasmCompatSend
Called when a model-emitted tool call is unknown or disallowed by the
current request’s tool choice. Read more
Source§fn on_tool_result(
&self,
_tool_name: &str,
_tool_call_id: Option<String>,
_internal_call_id: &str,
_args: &str,
_result: &str,
) -> impl Future<Output = HookAction> + WasmCompatSend
fn on_tool_result( &self, _tool_name: &str, _tool_call_id: Option<String>, _internal_call_id: &str, _args: &str, _result: &str, ) -> impl Future<Output = HookAction> + WasmCompatSend
Called after a tool is invoked (and a result has been returned).
Source§fn on_text_delta(
&self,
_text_delta: &str,
_aggregated_text: &str,
) -> impl Future<Output = HookAction> + Send
fn on_text_delta( &self, _text_delta: &str, _aggregated_text: &str, ) -> impl Future<Output = HookAction> + Send
Called when receiving a text delta (streaming responses only)
Source§fn on_tool_call_delta(
&self,
_tool_call_id: &str,
_internal_call_id: &str,
_tool_name: Option<&str>,
_tool_call_delta: &str,
) -> impl Future<Output = HookAction> + Send
fn on_tool_call_delta( &self, _tool_call_id: &str, _internal_call_id: &str, _tool_name: Option<&str>, _tool_call_delta: &str, ) -> impl Future<Output = HookAction> + Send
Called when receiving a tool call delta (streaming_responses_only).
tool_name is Some on the first delta for a tool call, None on subsequent deltas.Source§fn on_stream_completion_response_finish(
&self,
_prompt: &Message,
_response: &<M as CompletionModel>::StreamingResponse,
) -> impl Future<Output = HookAction> + Send
fn on_stream_completion_response_finish( &self, _prompt: &Message, _response: &<M as CompletionModel>::StreamingResponse, ) -> impl Future<Output = HookAction> + Send
Called after the model provider has finished streaming a text response from their completion API to the client.
Auto Trait Implementations§
impl Freeze for OutrigPromptHook
impl RefUnwindSafe for OutrigPromptHook
impl Send for OutrigPromptHook
impl Sync for OutrigPromptHook
impl Unpin for OutrigPromptHook
impl UnsafeUnpin for OutrigPromptHook
impl UnwindSafe for OutrigPromptHook
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