LiveEvent

Enum LiveEvent 

Source
pub enum LiveEvent {
Show 21 variants Audio(Bytes), TextDelta(String), TextComplete(String), InputTranscript { text: String, is_final: bool, }, OutputTranscript { text: String, is_final: bool, }, Thought(String), VadStart, VadEnd, Extraction { name: String, value: Value, }, ExtractionError { name: String, error: String, }, StatePromotion { extractor: String, field: String, state_key: String, accepted: bool, reason: String, value: Value, }, PhaseTransition { from: String, to: String, reason: String, }, ToolExecution { name: String, args: Value, result: Value, }, TurnComplete, Interrupted, Connected, Disconnected { reason: Option<String>, }, Error(String), GoAway { time_left: Duration, }, Telemetry(Value), TurnMetrics { turn: u32, latency_ms: u32, prompt_tokens: u32, response_tokens: u32, },
}
Expand description

Semantic events emitted by the Live session processor.

The L1 equivalent of L0’s SessionEvent. L0 events are wire-level; LiveEvents are semantic (extractions completed, phases transitioned, tools executed).

Subscribe via LiveHandle::events(). Multiple independent subscribers supported. Zero-cost when no subscribers exist (broadcast::send with 0 receivers is a no-op).

Variants§

§

Audio(Bytes)

Raw PCM audio from model. Uses Bytes (refcounted) — clone is a pointer increment (~2ns), not a deep copy.

§

TextDelta(String)

Incremental text token from model.

§

TextComplete(String)

Complete text response (all deltas concatenated).

§

InputTranscript

User speech transcription.

Fields

§text: String

The transcribed text content.

§is_final: bool

Whether this is the final transcription for the utterance.

§

OutputTranscript

Model speech transcription.

Fields

§text: String

The transcribed text content.

§is_final: bool

Whether this is the final transcription for the utterance.

§

Thought(String)

Model reasoning/thinking content.

§

VadStart

Voice activity detected — user started speaking.

§

VadEnd

Voice activity ended — user stopped speaking.

§

Extraction

Extraction completed. Emitted for both the top-level result AND each flattened key (e.g., “order.items”, “order.phase”).

Fields

§name: String

Extractor name, or "extractor.field" for flattened keys.

§value: Value

The extracted JSON value.

§

ExtractionError

Extraction failed.

Fields

§name: String

Name of the extractor that failed.

§error: String

Human-readable error description.

§

StatePromotion

A raw extraction field was considered for promotion into authoritative state.

Fields

§extractor: String

Extractor name that produced the field.

§field: String

Field name inside the extractor result.

§state_key: String

State key targeted by the promotion rule.

§accepted: bool

Whether the promotion was accepted and written.

§reason: String

Human-readable reason for the decision.

§value: Value

Extracted value that was considered.

§

PhaseTransition

Phase machine transitioned.

Fields

§from: String

Phase the machine transitioned from.

§to: String

Phase the machine transitioned to.

§reason: String

Human-readable reason for the transition.

§

ToolExecution

Tool dispatched and result obtained.

Fields

§name: String

Name of the tool that was called.

§args: Value

Arguments passed to the tool.

§result: Value

Result returned by the tool.

§

TurnComplete

Model completed a conversational turn.

§

Interrupted

Model output interrupted by user speech.

§

Connected

Session connected to Gemini.

§

Disconnected

Session disconnected.

Fields

§reason: Option<String>

Optional reason for disconnection (server-provided or error message).

§

Error(String)

Unrecoverable error.

§

GoAway

Server requesting session wind-down.

Fields

§time_left: Duration

Time remaining before the server closes the connection.

§

Telemetry(Value)

Aggregated session telemetry snapshot.

§

TurnMetrics

Per-turn latency and token metrics.

Fields

§turn: u32

Turn number (1-indexed).

§latency_ms: u32

End-to-end latency for this turn in milliseconds.

§prompt_tokens: u32

Number of prompt tokens consumed.

§response_tokens: u32

Number of response tokens generated.

Trait Implementations§

Source§

impl Clone for LiveEvent

Source§

fn clone(&self) -> LiveEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LiveEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more