Enum SessionEvent
pub enum SessionEvent {
Show 20 variants
Connected,
TextDelta(String),
TextComplete(String),
AudioData(Bytes),
InputTranscription(String),
OutputTranscription(String),
Thought(String),
ToolCall(Vec<FunctionCall>),
ToolCallCancelled(Vec<String>),
TurnComplete,
GenerationComplete,
Interrupted,
PhaseChanged(SessionPhase),
GoAway(Option<String>),
Disconnected(Option<String>),
Error(String),
SessionResumeUpdate(ResumeInfo),
VoiceActivityStart,
VoiceActivityEnd,
Usage(UsageMetadata),
}Expand description
Events emitted by the session, consumed by application code.
Variants§
Connected
Session connected and setup complete.
TextDelta(String)
Incremental text from model response.
TextComplete(String)
Complete text of a finished model turn.
AudioData(Bytes)
Audio data from model response (PCM16 samples, base64-decoded).
Uses [bytes::Bytes] for zero-copy fan-out: cloning a Bytes handle
bumps an Arc refcount instead of copying the underlying data.
InputTranscription(String)
Input transcription from server.
OutputTranscription(String)
Output transcription from server.
Thought(String)
Thought/reasoning summary from the model (when includeThoughts is enabled).
ToolCall(Vec<FunctionCall>)
Model requested tool calls.
ToolCallCancelled(Vec<String>)
Server cancelled pending tool calls.
TurnComplete
Model turn is complete (it’s the user’s turn now).
GenerationComplete
Model finished generating its full response.
Fires even if the generation was interrupted — tells you the model’s
internal generation pipeline has stopped. Distinct from TurnComplete
which is the turn-taking signal.
Interrupted
Model was interrupted by barge-in.
PhaseChanged(SessionPhase)
Session phase changed.
GoAway(Option<String>)
Server sent GoAway signal with optional time remaining.
Disconnected(Option<String>)
Session disconnected (with optional reason).
Error(String)
Non-fatal error.
SessionResumeUpdate(ResumeInfo)
Session resumption update with handle, resumability, and consumed index.
VoiceActivityStart
Server-side voice activity detected (user started speaking).
VoiceActivityEnd
Server-side voice activity ended (user stopped speaking).
Usage(UsageMetadata)
Token usage metadata from server (for context window tracking).
Contains full token breakdown: prompt, response, cached, tool-use, thinking tokens, plus per-modality details.
Trait Implementations§
§impl Clone for SessionEvent
impl Clone for SessionEvent
§fn clone(&self) -> SessionEvent
fn clone(&self) -> SessionEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more