pub enum SessionUpdate {
AgentMessageChunk {
text: String,
},
AgentThoughtChunk {
text: String,
},
UserMessageChunk {
text: String,
},
ToolCall(ToolCallInfo),
ToolCallUpdate(ToolCallUpdateInfo),
Plan(PlanInfo),
AvailableCommandsUpdate(Vec<AgentCommand>),
CurrentModeUpdate {
mode_id: String,
},
Unknown(Value),
}Expand description
A parsed session update. These are not serde-derived because the
sessionUpdate discriminator field requires manual dispatch.
Variants§
AgentMessageChunk
A chunk of the agent’s response text.
AgentThoughtChunk
A chunk of the agent’s internal reasoning.
UserMessageChunk
A chunk echoing the user’s message.
ToolCall(ToolCallInfo)
A new or updated tool call.
ToolCallUpdate(ToolCallUpdateInfo)
An incremental update to an existing tool call.
Plan(PlanInfo)
The agent’s current plan.
AvailableCommandsUpdate(Vec<AgentCommand>)
Updated list of available slash commands.
CurrentModeUpdate
The agent switched interaction mode.
Unknown(Value)
Unrecognized update type — preserved as raw JSON.
Implementations§
Source§impl SessionUpdate
impl SessionUpdate
Sourcepub fn from_value(value: &Value) -> Self
pub fn from_value(value: &Value) -> Self
Parse a session update from its raw JSON Value.
The value is expected to have a "sessionUpdate" string field that
acts as a type discriminator.
Trait Implementations§
Source§impl Clone for SessionUpdate
impl Clone for SessionUpdate
Source§fn clone(&self) -> SessionUpdate
fn clone(&self) -> SessionUpdate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionUpdate
impl RefUnwindSafe for SessionUpdate
impl Send for SessionUpdate
impl Sync for SessionUpdate
impl Unpin for SessionUpdate
impl UnsafeUnpin for SessionUpdate
impl UnwindSafe for SessionUpdate
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