pub struct PluginConfig {Show 16 fields
pub name: String,
pub on_user_message_callback: Option<OnUserMessageCallback>,
pub on_event_callback: Option<OnEventCallback>,
pub before_run_callback: Option<BeforeRunCallback>,
pub after_run_callback: Option<AfterRunCallback>,
pub before_agent_callback: Option<BeforeAgentCallback>,
pub after_agent_callback: Option<AfterAgentCallback>,
pub on_agent_error_callback: Option<OnAgentErrorCallback>,
pub before_model_callback: Option<BeforeModelCallback>,
pub after_model_callback: Option<AfterModelCallback>,
pub on_model_error_callback: Option<OnModelErrorCallback>,
pub before_tool_callback: Option<BeforeToolCallback>,
pub after_tool_callback: Option<AfterToolCallback>,
pub on_tool_error_callback: Option<OnToolErrorCallback>,
pub close: Option<CloseFn>,
pub state: Option<Arc<dyn Any + Send + Sync>>,
}Expand description
A plugin’s name and callbacks.
Fields§
§name: StringThe plugin’s name, unique among the registered plugins.
on_user_message_callback: Option<OnUserMessageCallback>§on_event_callback: Option<OnEventCallback>See OnEventCallback.
before_run_callback: Option<BeforeRunCallback>See BeforeRunCallback.
after_run_callback: Option<AfterRunCallback>See AfterRunCallback.
before_agent_callback: Option<BeforeAgentCallback>See BeforeAgentCallback.
after_agent_callback: Option<AfterAgentCallback>See AfterAgentCallback.
on_agent_error_callback: Option<OnAgentErrorCallback>See OnAgentErrorCallback.
before_model_callback: Option<BeforeModelCallback>See BeforeModelCallback.
after_model_callback: Option<AfterModelCallback>See AfterModelCallback.
on_model_error_callback: Option<OnModelErrorCallback>See OnModelErrorCallback.
before_tool_callback: Option<BeforeToolCallback>See BeforeToolCallback.
after_tool_callback: Option<AfterToolCallback>See AfterToolCallback.
on_tool_error_callback: Option<OnToolErrorCallback>See OnToolErrorCallback.
close: Option<CloseFn>Called when the plugin manager closes.
state: Option<Arc<dyn Any + Send + Sync>>Typed plugin state, read back with Plugin::state (e.g. the agent-analytics plugin
keeps its handle here).
Trait Implementations§
Source§impl Clone for PluginConfig
impl Clone for PluginConfig
Auto Trait Implementations§
impl !RefUnwindSafe for PluginConfig
impl !UnwindSafe for PluginConfig
impl Forget for PluginConfig
impl Freeze for PluginConfigwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send>>: Freeze,
*const ArcInner<dyn Any + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Any + Sync + Send>>: Freeze,
impl Move for PluginConfig
impl Send for PluginConfigwhere
RawVecInner: Send,
Arc<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send>: Send,
Arc<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send>: Send,
Arc<dyn Any + Sync + Send>: Send,
impl Sync for PluginConfigwhere
RawVecInner: Sync,
Arc<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send>: Sync,
Arc<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send>: Sync,
Arc<dyn Any + Sync + Send>: Sync,
impl Unpin for PluginConfigwhere
*const u8 is !null: Unpin,
Arc<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send>: Unpin,
Arc<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send>: Unpin,
Arc<dyn Any + Sync + Send>: Unpin,
impl UnsafeUnpin for PluginConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(InvocationContext, Content) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(InvocationContext, Event) -> Pin<Box<dyn Future<Output = Result<Option<Event>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(InvocationContext) -> Pin<Box<dyn Future<Output = ()> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context) -> Pin<Box<dyn Future<Output = Result<Option<Content>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Agent>, &AgentError) + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, LlmRequest) -> Pin<Box<dyn Future<Output = (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, LlmResponse, Option<Arc<ModelError>>) -> Pin<Box<dyn Future<Output = (LlmResponse, Result<Option<LlmResponse>, AgentError>)> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, LlmRequest, Arc<ModelError>) -> Pin<Box<dyn Future<Output = Result<Option<LlmResponse>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>) -> Pin<Box<dyn Future<Output = (Map<String, Value>, Result<Option<Map<String, Value>>, AgentError>)> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Map<String, Value>, Option<Arc<ToolError>>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Context, Arc<dyn Tool>, Map<String, Value>, Arc<ToolError>) -> Pin<Box<dyn Future<Output = Result<Option<Map<String, Value>>, AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send>> + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Any + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Any + Sync + Send>>: UnsafeUnpin,
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