pub struct PluginManager { /* private fields */ }Expand description
Manages an ordered list of plugins, running them in sequence.
On each hook, plugins run in order. The first non-Continue result short-circuits the remaining plugins.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub async fn run_before_agent(&self, ctx: &InvocationContext) -> PluginResult
pub async fn run_before_agent(&self, ctx: &InvocationContext) -> PluginResult
Run before_agent hooks. Returns first non-Continue result, or Continue.
Sourcepub async fn run_after_agent(&self, ctx: &InvocationContext) -> PluginResult
pub async fn run_after_agent(&self, ctx: &InvocationContext) -> PluginResult
Run after_agent hooks. Returns first non-Continue result, or Continue.
Sourcepub async fn run_before_tool(
&self,
call: &FunctionCall,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_before_tool( &self, call: &FunctionCall, ctx: &InvocationContext, ) -> PluginResult
Run before_tool hooks. Returns first non-Continue result, or Continue.
Sourcepub async fn run_after_tool(
&self,
call: &FunctionCall,
value: &Value,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_after_tool( &self, call: &FunctionCall, value: &Value, ctx: &InvocationContext, ) -> PluginResult
Run after_tool hooks. Returns first non-Continue result, or Continue.
Sourcepub async fn run_on_event(
&self,
event: &Event,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_on_event( &self, event: &Event, ctx: &InvocationContext, ) -> PluginResult
Run on_event hooks. Returns first non-Continue result, or Continue.
Sourcepub async fn run_on_user_message(
&self,
message: &str,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_on_user_message( &self, message: &str, ctx: &InvocationContext, ) -> PluginResult
Run on_user_message hooks.
Sourcepub async fn run_before_run(&self, ctx: &InvocationContext) -> PluginResult
pub async fn run_before_run(&self, ctx: &InvocationContext) -> PluginResult
Run before_run hooks.
Sourcepub async fn run_after_run(&self, ctx: &InvocationContext) -> PluginResult
pub async fn run_after_run(&self, ctx: &InvocationContext) -> PluginResult
Run after_run hooks.
Sourcepub async fn run_before_model(
&self,
request: &LlmRequest,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_before_model( &self, request: &LlmRequest, ctx: &InvocationContext, ) -> PluginResult
Run before_model hooks.
Sourcepub async fn run_after_model(
&self,
response: &LlmResponse,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_after_model( &self, response: &LlmResponse, ctx: &InvocationContext, ) -> PluginResult
Run after_model hooks.
Sourcepub async fn run_on_model_error(
&self,
error: &str,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_on_model_error( &self, error: &str, ctx: &InvocationContext, ) -> PluginResult
Run on_model_error hooks.
Sourcepub async fn run_on_tool_error(
&self,
call: &FunctionCall,
error: &str,
ctx: &InvocationContext,
) -> PluginResult
pub async fn run_on_tool_error( &self, call: &FunctionCall, error: &str, ctx: &InvocationContext, ) -> PluginResult
Run on_tool_error hooks.
Trait Implementations§
Source§impl Clone for PluginManager
impl Clone for PluginManager
Source§fn clone(&self) -> PluginManager
fn clone(&self) -> PluginManager
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 Default for PluginManager
impl Default for PluginManager
Source§fn default() -> PluginManager
fn default() -> PluginManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PluginManager
impl !RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin for PluginManager
impl !UnwindSafe for PluginManager
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