pub struct AgentPlugin { /* private fields */ }Expand description
The plugin. Register it with AppBuilder::plugin.
autumn_web::app().plugin(AgentPlugin::new()).run().await;Implementations§
Source§impl AgentPlugin
impl AgentPlugin
Sourcepub fn new() -> Self
pub fn new() -> Self
Create the plugin with default configuration.
Defaults resolve from autumn.toml’s [agent] section and AGENT_*
environment variables at startup; see AgentConfig.
Sourcepub fn configure(self, configure: impl FnOnce(&mut AgentConfig)) -> Self
pub fn configure(self, configure: impl FnOnce(&mut AgentConfig)) -> Self
Tune the configuration in code. Runs after file and env loading, so values set here win over both.
Sourcepub fn hook(self, hook: Arc<dyn AgentHooks>) -> Self
pub fn hook(self, hook: Arc<dyn AgentHooks>) -> Self
Add a lifecycle hook to every agent.
Sourcepub fn policy(self, policy: Arc<dyn ToolPolicy>) -> Self
pub fn policy(self, policy: Arc<dyn ToolPolicy>) -> Self
Decide per tool call whether agents may act. Defaults to allowing every call.
Sourcepub fn session_store(self, store: Arc<dyn SessionStore>) -> Self
pub fn session_store(self, store: Arc<dyn SessionStore>) -> Self
Persist session transcripts here. Defaults to an in-memory store, which loses sessions on restart.
Sourcepub fn memory_store(self, store: Arc<dyn MemoryStore>) -> Self
pub fn memory_store(self, store: Arc<dyn MemoryStore>) -> Self
Give agents persistent memory in this store.
Sourcepub const fn compaction(self, compaction: Compaction) -> Self
pub const fn compaction(self, compaction: Compaction) -> Self
Summarize long session transcripts before a run.
Sourcepub fn delivery(self, delivery: Arc<dyn Delivery>) -> Self
pub fn delivery(self, delivery: Arc<dyn Delivery>) -> Self
Where heartbeat, follow-up, and deliver job results go. Defaults to
logging them.
Trait Implementations§
Source§impl Debug for AgentPlugin
impl Debug for AgentPlugin
Source§impl Default for AgentPlugin
impl Default for AgentPlugin
Source§impl Plugin for AgentPlugin
impl Plugin for AgentPlugin
Source§fn build(self, app: AppBuilder) -> AppBuilder
fn build(self, app: AppBuilder) -> AppBuilder
Wire the plugin into the app builder.
Declares the [agent] config section, registers the agent_run and
agent_resume background jobs and the heartbeat task, adds the
provider health indicator, and installs a startup hook that fails the
boot fast when the config, the heartbeat, or the API key is unusable.
Source§fn name(&self) -> Cow<'static, str>
fn name(&self) -> Cow<'static, str>
Auto Trait Implementations§
impl !RefUnwindSafe for AgentPlugin
impl !UnwindSafe for AgentPlugin
impl Forget for AgentPlugin
impl Freeze for AgentPlugin
impl Send for AgentPlugin
impl Sync for AgentPlugin
impl Unpin for AgentPlugin
impl UnsafeUnpin for AgentPlugin
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> Plugins for Pwhere
P: Plugin,
impl<P> Plugins for Pwhere
P: Plugin,
Source§fn apply(self, app: AppBuilder) -> AppBuilder
fn apply(self, app: AppBuilder) -> AppBuilder
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.