pub trait AdvisorRuntimeHost:
Send
+ Sync
+ 'static {
// Required methods
fn snapshot_messages(&self) -> Vec<Message>;
fn enqueue_advice(&self, note: AdvisorNote);
// Provided methods
fn maintain_context(&self, _incoming_tokens: usize) -> bool { ... }
fn begin_advisor_update(&self) { ... }
fn notify_failure(&self, _error: &str) { ... }
}Expand description
Host callbacks the runtime needs. omp AdvisorRuntimeHost.
Required Methods§
Sourcefn snapshot_messages(&self) -> Vec<Message>
fn snapshot_messages(&self) -> Vec<Message>
Snapshot of the primary transcript (host should exclude the advisor’s own echoed advice so it isn’t re-fed).
Sourcefn enqueue_advice(&self, note: AdvisorNote)
fn enqueue_advice(&self, note: AdvisorNote)
Route an accepted note to the primary (the host applies its emission
guard + delivery channel). omp enqueueAdvice.
Provided Methods§
Sourcefn maintain_context(&self, _incoming_tokens: usize) -> bool
fn maintain_context(&self, _incoming_tokens: usize) -> bool
Pre-prompt context maintenance for the advisor’s own context. Return
true to force a re-prime (reset advisor context + replay the full
current transcript). omp maintainContext. Optional.
Sourcefn begin_advisor_update(&self)
fn begin_advisor_update(&self)
Called immediately before each advisor prompt cycle, so the host can
clear per-update advisor state (its emission guard’s one-advise budget).
omp beginAdvisorUpdate. Optional.
Sourcefn notify_failure(&self, _error: &str)
fn notify_failure(&self, _error: &str)
Surface a non-recovering advisor failure (3 consecutive errors) without
adding model-visible context. omp notifyFailure. Optional.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".