pub struct AdvisorRuntime { /* private fields */ }Expand description
Implementations§
Source§impl AdvisorRuntime
impl AdvisorRuntime
Sourcepub fn new(
agent: Arc<dyn AdvisorAgent>,
host: Arc<dyn AdvisorRuntimeHost>,
retry_delay: Duration,
) -> AdvisorRuntime
pub fn new( agent: Arc<dyn AdvisorAgent>, host: Arc<dyn AdvisorRuntimeHost>, retry_delay: Duration, ) -> AdvisorRuntime
Construct. retry_delay is the backoff between failed advisor turns
(omp default 1000ms).
Sourcepub fn set_transcript_path(&self, path: Option<PathBuf>)
pub fn set_transcript_path(&self, path: Option<PathBuf>)
Attach the host-owned advisor transcript path.
Sourcepub fn transcript_path(&self) -> Option<PathBuf>
pub fn transcript_path(&self) -> Option<PathBuf>
Path to the advisor transcript, when persistence is available.
Sourcepub fn install_self(&self, weak: Weak<AdvisorRuntime>)
pub fn install_self(&self, weak: Weak<AdvisorRuntime>)
Install the weak self-reference required for self-spawning the drain
task. Call once after wrapping in Arc.
Sourcepub fn is_disposed(&self) -> bool
pub fn is_disposed(&self) -> bool
Whether the runtime has been disposed.
Sourcepub fn on_turn_end(&self, messages: Vec<Message>)
pub fn on_turn_end(&self, messages: Vec<Message>)
Feed one primary turn’s transcript to the advisor. Renders the delta
(new messages since the last drain), queues it, and spawns a drain task
if none is running. omp onTurnEnd.
Sourcepub async fn wait_for_catchup(&self, max: Duration, threshold: u64)
pub async fn wait_for_catchup(&self, max: Duration, threshold: u64)
Block until the backlog drops below threshold, or max elapses. omp
waitForCatchup. Registration + backlog-check happen under the waiters
lock so a concurrent notify_waiters cannot miss the waiter (the
catchup lost-wakeup fix).
Sourcepub fn reset(&self)
pub fn reset(&self)
Re-prime the advisor after a history rewrite (compaction, session
switch/resume, branch). Clears the advisor’s context and rewinds the
cursor so the next turn replays the full current transcript. omp reset.
Auto Trait Implementations§
impl !Freeze for AdvisorRuntime
impl !RefUnwindSafe for AdvisorRuntime
impl !UnwindSafe for AdvisorRuntime
impl Send for AdvisorRuntime
impl Sync for AdvisorRuntime
impl Unpin for AdvisorRuntime
impl UnsafeUnpin for AdvisorRuntime
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.