Skip to main content

Module plugin

Module plugin 

Source
Available on crate feature plugin only.
Expand description

Plugin system for extending agent behavior.

Extensible callback architecture for agent lifecycle hooks:

  • Plugin registration and discovery
  • Before/after hooks for agent operations

Available with feature: plugin

Modules§

adapted_plugin
Adapter wrapping a legacy closure-based Plugin as an EnhancedPlugin.

Structs§

AdaptedPlugin
Wraps a legacy closure-based Plugin as an EnhancedPlugin.
EnhancedPluginManager
Manages enhanced plugins with priority-based pipeline execution.
Plugin
A Plugin bundles related callbacks for extending agent behavior.
PluginBuilder
Builder for creating plugins with a fluent API.
PluginConfig
Configuration for creating a Plugin.
PluginContext
A type-safe, concurrent key-value store for plugin shared state.
PluginManager
Manages a collection of plugins and coordinates callback execution.
PluginManagerConfig
Configuration for the PluginManager.

Enums§

AfterModelCallResult
Result from an after_model_call hook invocation.
AfterToolCallResult
Result from an after_tool_call hook invocation.
BeforeModelCallResult
Result from a before_model_call hook invocation.
BeforeToolCallResult
Result from a before_tool_call hook invocation.

Traits§

EnhancedPlugin
Enhanced plugin trait with fine-grained hooks and default no-op implementations.

Functions§

collect_metrics
Helper to create a metrics collection callback.
log_events
Helper to create a simple logging callback for events.
log_user_messages
Helper to create a simple logging callback for user messages.

Type Aliases§

AfterRunCallback
Callback invoked after the agent run completes.
BeforeRunCallback
Callback invoked before the agent run starts.
OnEventCallback
Callback invoked for each event generated by the agent.
OnModelErrorCallback
Callback invoked when a model error occurs.
OnToolErrorCallback
Callback invoked when a tool execution fails (after retries are exhausted).
OnUserMessageCallback
Callback invoked when a user message is received.