pub struct AgentAdvisor { /* private fields */ }Expand description
Unstable (feature: advisor) — may change or be removed
An [`AdvisorAgent`] backed by a concrete [`Agent`].Implementations§
Source§impl AgentAdvisor
impl AgentAdvisor
Sourcepub fn new(agent: Arc<Agent>) -> AgentAdvisor
pub fn new(agent: Arc<Agent>) -> AgentAdvisor
Wrap an Agent as an advisor-driving AdvisorAgent.
Sourcepub fn with_post_prompt_hook(
agent: Arc<Agent>,
hook: Arc<dyn Fn(&Agent) + Send + Sync>,
) -> AgentAdvisor
pub fn with_post_prompt_hook( agent: Arc<Agent>, hook: Arc<dyn Fn(&Agent) + Send + Sync>, ) -> AgentAdvisor
Wrap an Agent with a hook fired after each successful advisor prompt.
Used by the host to persist advisor turns to <session>/__advisor.jsonl
for stats attribution / observability.
Sourcepub fn agent(&self) -> &Agent
pub fn agent(&self) -> &Agent
Access the underlying agent (for transcript-recorder / event wiring).
Sourcepub fn into_agent(self) -> Arc<Agent> ⓘ
pub fn into_agent(self) -> Arc<Agent> ⓘ
Clone the underlying agent handle (cheap — Arc clone).
Trait Implementations§
Source§impl AdvisorAgent for AgentAdvisor
impl AdvisorAgent for AgentAdvisor
Source§fn prompt<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentAdvisor: 'async_trait,
fn prompt<'life0, 'async_trait>(
&'life0 self,
input: String,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentAdvisor: 'async_trait,
Drive one advisor turn from the given batch text.
Err marks the turn
failed (triggers the retry/drop-after-3 path).Source§fn rollback_to<'life0, 'async_trait>(
&'life0 self,
count: usize,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentAdvisor: 'async_trait,
fn rollback_to<'life0, 'async_trait>(
&'life0 self,
count: usize,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
AgentAdvisor: 'async_trait,
Drop messages appended past
count. Called after a failed prompt so a
retry doesn’t replay the failed user batch. omp rollbackTo.Source§fn message_count(&self) -> usize
fn message_count(&self) -> usize
Current advisor message count (for the rollback snapshot).
Auto Trait Implementations§
impl !RefUnwindSafe for AgentAdvisor
impl !UnwindSafe for AgentAdvisor
impl Freeze for AgentAdvisor
impl Send for AgentAdvisor
impl Sync for AgentAdvisor
impl Unpin for AgentAdvisor
impl UnsafeUnpin for AgentAdvisor
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