Module live

Module live 

Source
Expand description

Live — Fluent builder for callback-driven Gemini Live sessions.

Wraps L1’s LiveSessionBuilder with ergonomic callback registration and integration with composition modules (M, T, P).

§Callback Modes

Control-lane callbacks support two execution modes via gemini_adk_rs::live::CallbackMode:

Use concurrent mode for fire-and-forget work (logging, analytics, webhook dispatch).

§Background Tool Execution

Mark tools for background execution to eliminate dead air in voice sessions:

Live::builder()
    .tools(dispatcher)
    .tool_background("search_kb")
    .connect_vertex(project, location, token)
    .await?;

Structs§

BackendInputVad
Incremental VAD over arbitrary PCM16 byte chunks.
BackendVadSnapshot
Snapshot of backend VAD state for devtools and diagnostics.
BackgroundAgentDispatcher
Dispatcher for running TextAgent pipelines as background tasks.
BackgroundToolTracker
Tracks in-flight background tool executions for cancellation.
ComputedContract
A computed state declaration.
ComputedRegistry
Registry of computed variables with dependency-ordered evaluation.
ComputedVar
A computed state variable: a pure function of other state keys.
ConsecutiveFailureDetector
Fires when a named tool has failed threshold consecutive times.
ContextBuilder
Declarative state-to-narrative renderer.
ControlContract
Runtime control-plane settings.
DefaultResultFormatter
Default formatter that wraps results in a status object.
DeferredWriter
A SessionWriter wrapper that flushes pending context before user content.
EffectPolicy
Execution policy for an effect.
EventCallbacks
Typed callback registry for Live session events.
ExtractorContract
A turn extractor declaration.
FieldPromotion
Rule for promoting one raw extraction field into authoritative state.
FsPersistence
File-system persistence (good for development and single-server deployments).
Live
Fluent builder for constructing and connecting Gemini Live sessions.
LiveEffectExecutor
Executes LiveEffect values emitted by the Live reactor.
LiveEventStream
A [futures::Stream] of LiveEvents from a Live session.
LiveHandle
Handle for interacting with a running Live session.
LiveReactor
Ordered collection of reactor rules.
LiveSessionBuilder
Builder for a callback-driven Live session.
LlmExtractor
LLM-backed turn extractor that sends transcript windows to an OOB LLM with a structured extraction prompt.
MemoryPersistence
In-memory persistence (good for tests).
NeedsFulfillment
Tracks need fulfillment per phase and recommends repair actions.
PendingContext
Thread-safe buffer for pending context turns awaiting delivery.
Phase
A conversation phase with instruction, tools, and transitions.
PhaseContract
A conversation phase declaration.
PhaseMachine
Evaluates transitions and manages phase entry/exit lifecycle.
PhasePreparation
A preparation effect that can materialize state before a phase is entered.
PhaseTransition
Record of a single phase transition for history/debugging.
PreparationContract
A phase preparation declaration.
PromotionContract
A field promotion declaration.
RateDetector
Fires when at least count matching events occur within window.
Reaction
A policy-wrapped effect.
RepairConfig
Configuration for the conversation repair system.
ReplaySession
A replayed session: the live handle plus the replay controls.
RuntimeContract
Serializable description of a configured Live runtime.
SessionSignals
Tracks session-level signals automatically from events.
SessionSnapshot
Serializable snapshot of the control plane state.
SessionTelemetry
Zero-overhead telemetry collector for speech-to-speech sessions.
SoftTurnDetector
Detects proactive silence — user stopped speaking but model didn’t respond.
SustainedDetector
Fires when a state-based condition remains true for at least duration.
TemporalRegistry
Registry of temporal patterns evaluated on events and/or timer ticks.
ToolCallSummary
Summary of a tool call within a conversation turn.
ToolContract
A tool declaration in the runtime contract.
TranscriptBuffer
Accumulates input/output transcripts and segments them by turn boundaries.
TranscriptTurn
A single completed conversation turn with accumulated transcripts.
TranscriptWindow
A read-only snapshot of recent transcript turns for context construction.
Transition
A guard-based transition to a named target phase.
TransitionContract
A phase transition declaration.
TransitionResult
Result of a phase transition, carrying the resolved instruction and any context to inject.
TurnCountDetector
Fires when a state-based condition is true for required consecutive evaluations (typically one evaluation per turn).
VoiceRuntimeState
Voice-flow state owned by the reactor.
Watcher
A single state watcher: observes one key, fires an async action when the predicate matches.
WatcherContract
A watcher declaration.
WatcherRegistry
Registry of state watchers, evaluated after each mutation cycle.

Enums§

CallbackMode
Controls how a control-lane callback is executed relative to the event loop.
ContextDelivery
When to deliver model-role context turns to the wire.
EffectMode
Whether an effect must complete before the reactor continues.
ExtractionTrigger
Controls WHEN an extractor runs.
InstructionModifier
A modifier that transforms a phase instruction based on runtime state.
LiveEffect
A typed runtime effect emitted by a reaction.
LiveEvent
Semantic events emitted by the Live session processor.
MergePolicy
How an extracted field should be merged into authoritative session state.
PhaseInstruction
Instruction source for a phase — either a fixed string or a closure over state.
ReactorEvent
A normalized event that can drive ADK-level reactions.
RepairAction
What action the repair system recommends.
SessionType
Session type determines the server-side duration limit.
SteeringMode
How the phase machine steers the model’s behavior.
ToolExecutionMode
Execution mode for a tool.
TransitionEvaluation
Result of evaluating outbound transitions.
TransitionTrigger
What caused a phase transition.
WatchPredicate
Condition under which a watcher fires, evaluated against (old, new) values.

Traits§

PatternDetector
A detector that evaluates whether a temporal pattern has been triggered.
ReactorRule
A rule that reacts to normalized events and emits typed effects.
ResultFormatter
Formats tool responses for background execution lifecycle.
SessionPersistence
Trait for persisting session state across process restarts.
TurnExtractor
Trait for between-turn extraction from transcript windows.

Functions§

attach_session
Attach the full L1 control plane (three-lane processor, phase machine, extractors, watchers, tool dispatch, …) to an already connected L0 session.
collect_events_until_idle
Collect LiveEvents until the stream stays idle for idle (or max elapses). Useful for settling an as-fast-as-possible replay where “done” means “no more effects are propagating”.
replay_session
Replay a recorded wire log through the real L1 processor, offline.

Type Aliases§

PredicateFn
Custom predicate function type for state change watchers.