pub enum TurnEvent {
TextDelta(String),
ToolStarted {
name: String,
},
ApprovalPending {
request_id: String,
tool_name: String,
title: String,
args_json: String,
},
HandoffStarted {
child_agent_id: String,
reason: String,
},
Done,
}Expand description
Incremental event emitted while a turn streams from the control plane.
Unlike AgentDialer::run_turn, which folds the whole turn into one
string, the streaming API surfaces each meaningful step as it arrives so a
live surface (e.g. Slack chat.appendStream) can update in place.
Variants§
TextDelta(String)
Incremental assistant answer text (model/assistant role).
ToolStarted
A tool call has started, named for a user-visible “thinking step”.
ApprovalPending
The turn paused before executing a tool that requires human approval.
Emitted (one per pending call) from the terminal AgentEnd just before
TurnEvent::Done. The caller submits a decision via
ApprovalService.Respond (the THIN path) and re-drives the turn.
Fields
tool_name: StringThe tool/function name awaiting approval. Raw machine identifier; the field of record for trust/audit.
HandoffStarted
The turn suspended to delegate to a sub-agent: the model invoked the
reserved __handoff_to primitive. Surfaced (once) from the terminal
AgentEnd.handoff just before TurnEvent::Done. The child
conversation runs independently; the parent resumes when the child
returns, so an edge can render “delegating…” rather than going silent.
Fields
Done
Terminal event: the turn has ended and no further events follow.
Trait Implementations§
impl Eq for TurnEvent
impl StructuralPartialEq for TurnEvent
Auto Trait Implementations§
impl Freeze for TurnEvent
impl RefUnwindSafe for TurnEvent
impl Send for TurnEvent
impl Sync for TurnEvent
impl Unpin for TurnEvent
impl UnsafeUnpin for TurnEvent
impl UnwindSafe for TurnEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request