pub enum AssistantEvent {
InferenceStarted {
model: String,
attempt: u32,
turn: u32,
},
InferenceRetry {
model: String,
attempt: u32,
reason: String,
backoff_ms: u64,
},
ModelServed {
model_id: String,
local_last_resort: bool,
},
Text(String),
ToolCall {
call_id: String,
sequence: u32,
name: String,
params: Value,
},
ToolResult {
call_id: String,
sequence: u32,
name: String,
ok: bool,
content: String,
},
Done {
text: String,
},
Error(String),
AuthRequired {
reason: AuthRequiredReason,
message: String,
},
GoalEvaluated {
iteration: u32,
met: bool,
grounded: bool,
reason: String,
},
}Expand description
Streamed events from one loop run. emit is called synchronously as the loop
progresses; a chat caller forwards these to agent.chat.event, a CLI caller
prints them.
Variants§
InferenceStarted
A model call is about to begin. Emitted before awaiting the generator so a host can distinguish live inference from a wedged assistant loop.
InferenceRetry
A transient provider failure will be retried after a bounded backoff.
ModelServed
Attribution for one completed model turn. Emitted before that turn’s text/tool events so every rendered answer can be tied to its actual serving model, including transparent on-device degradation.
Text(String)
The model’s free-text for a turn (may be empty when it only calls tools).
ToolCall
A tool is about to run. call_id is generated by the loop rather than
trusted from the provider, and sequence is its one-based position in
this turn. The matching result carries both values.
ToolResult
A tool finished. ok is false for a failed/denied/cancelled call.
Fields
Done
Terminal: the model answered with no further tool calls.
Error(String)
Terminal: the run failed (inference/transport error).
AuthRequired
Terminal: the turn cannot reach Parslee inference because of the ACCOUNT, and says which remedy applies.
Typed apart from AssistantEvent::Error because the two ask
different things of a host. An error is something that went wrong; an
auth_required is a step the person can take, and a host can render it
as a sign-in card rather than a red row. It is terminal in the same
sense Done/Error are — the chat service sends it INSTEAD of the
done/error frame, never before one.
GoalEvaluated
Goal-loop verifier result after one iteration. This surfaces CAR’s grounded completion evidence to CLI/chat hosts instead of hiding it in tracing logs.
Auto Trait Implementations§
impl Freeze for AssistantEvent
impl RefUnwindSafe for AssistantEvent
impl Send for AssistantEvent
impl Sync for AssistantEvent
impl Unpin for AssistantEvent
impl UnsafeUnpin for AssistantEvent
impl UnwindSafe for AssistantEvent
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
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> ⓘ
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 more