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
Pluginas anEnhancedPlugin.
Structs§
- Adapted
Plugin - Wraps a legacy closure-based
Pluginas anEnhancedPlugin. - Enhanced
Plugin Manager - Manages enhanced plugins with priority-based pipeline execution.
- Plugin
- A Plugin bundles related callbacks for extending agent behavior.
- Plugin
Builder - Builder for creating plugins with a fluent API.
- Plugin
Config - Configuration for creating a Plugin.
- Plugin
Context - A type-safe, concurrent key-value store for plugin shared state.
- Plugin
Manager - Manages a collection of plugins and coordinates callback execution.
- Plugin
Manager Config - Configuration for the PluginManager.
Enums§
- After
Model Call Result - Result from an
after_model_callhook invocation. - After
Tool Call Result - Result from an
after_tool_callhook invocation. - Before
Model Call Result - Result from a
before_model_callhook invocation. - Before
Tool Call Result - Result from a
before_tool_callhook invocation.
Traits§
- Enhanced
Plugin - 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§
- After
RunCallback - Callback invoked after the agent run completes.
- Before
RunCallback - Callback invoked before the agent run starts.
- OnEvent
Callback - Callback invoked for each event generated by the agent.
- OnModel
Error Callback - Callback invoked when a model error occurs.
- OnTool
Error Callback - Callback invoked when a tool execution fails (after retries are exhausted).
- OnUser
Message Callback - Callback invoked when a user message is received.