pub struct GoalSupervisor { /* private fields */ }Expand description
Single-call supervisor verifier for autonomous goal sessions.
Uses a configurable LLM provider (ideally different from the main agent provider to avoid self-confirmation bias). On HTTP 429 the caller should wait and retry once before counting the failure toward the consecutive failure limit.
Implementations§
Source§impl GoalSupervisor
impl GoalSupervisor
Sourcepub fn new(provider: AnyProvider, timeout: Duration) -> Self
pub fn new(provider: AnyProvider, timeout: Duration) -> Self
Create a new supervisor with the given provider and per-call timeout.
Sourcepub async fn verify(
&self,
goal_condition: &str,
conversation_summary: &str,
recent_actions: &[String],
) -> Result<SupervisorVerdict, SupervisorError>
pub async fn verify( &self, goal_condition: &str, conversation_summary: &str, recent_actions: &[String], ) -> Result<SupervisorVerdict, SupervisorError>
Verify whether goal_condition has been achieved.
Makes at most two LLM calls (initial + one retry on JSON parse failure via
chat_json). Rate-limit (429) errors are surfaced as SupervisorError::RateLimited
so the caller can apply backoff before counting the failure.
§Errors
Returns SupervisorError on provider error, timeout, or unrecoverable parse failure.
Auto Trait Implementations§
impl !Freeze for GoalSupervisor
impl !RefUnwindSafe for GoalSupervisor
impl !UnwindSafe for GoalSupervisor
impl Send for GoalSupervisor
impl Sync for GoalSupervisor
impl Unpin for GoalSupervisor
impl UnsafeUnpin for GoalSupervisor
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request