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:
- Default methods (e.g.,
.on_turn_complete()) →gemini_adk_rs::live::CallbackMode::Blocking _concurrentmethods (e.g.,.on_turn_complete_concurrent()) →gemini_adk_rs::live::CallbackMode::Concurrent
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§
- Backend
Input Vad - Incremental VAD over arbitrary PCM16 byte chunks.
- Backend
VadSnapshot - Snapshot of backend VAD state for devtools and diagnostics.
- Background
Agent Dispatcher - Dispatcher for running
TextAgentpipelines as background tasks. - Background
Tool Tracker - Tracks in-flight background tool executions for cancellation.
- Computed
Contract - A computed state declaration.
- Computed
Registry - Registry of computed variables with dependency-ordered evaluation.
- Computed
Var - A computed state variable: a pure function of other state keys.
- Consecutive
Failure Detector - Fires when a named tool has failed
thresholdconsecutive times. - Context
Builder - Declarative state-to-narrative renderer.
- Control
Contract - Runtime control-plane settings.
- Default
Result Formatter - Default formatter that wraps results in a status object.
- Deferred
Writer - A
SessionWriterwrapper that flushes pending context before user content. - Effect
Policy - Execution policy for an effect.
- Event
Callbacks - Typed callback registry for Live session events.
- Extractor
Contract - A turn extractor declaration.
- Field
Promotion - 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.
- Live
Effect Executor - Executes
LiveEffectvalues emitted by the Live reactor. - Live
Event Stream - A [
futures::Stream] ofLiveEvents from a Live session. - Live
Handle - Handle for interacting with a running Live session.
- Live
Reactor - Ordered collection of reactor rules.
- Live
Session Builder - 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.
- Memory
Persistence - In-memory persistence (good for tests).
- Needs
Fulfillment - Tracks need fulfillment per phase and recommends repair actions.
- Pending
Context - Thread-safe buffer for pending context turns awaiting delivery.
- Phase
- A conversation phase with instruction, tools, and transitions.
- Phase
Contract - A conversation phase declaration.
- Phase
Machine - Evaluates transitions and manages phase entry/exit lifecycle.
- Phase
Preparation - A preparation effect that can materialize state before a phase is entered.
- Phase
Transition - Record of a single phase transition for history/debugging.
- Preparation
Contract - A phase preparation declaration.
- Promotion
Contract - A field promotion declaration.
- Rate
Detector - Fires when at least
countmatching events occur withinwindow. - Reaction
- A policy-wrapped effect.
- Repair
Config - Configuration for the conversation repair system.
- Replay
Session - A replayed session: the live handle plus the replay controls.
- Runtime
Contract - Serializable description of a configured Live runtime.
- Session
Signals - Tracks session-level signals automatically from events.
- Session
Snapshot - Serializable snapshot of the control plane state.
- Session
Telemetry - Zero-overhead telemetry collector for speech-to-speech sessions.
- Soft
Turn Detector - Detects proactive silence — user stopped speaking but model didn’t respond.
- Sustained
Detector - Fires when a state-based condition remains true for at least
duration. - Temporal
Registry - Registry of temporal patterns evaluated on events and/or timer ticks.
- Tool
Call Summary - Summary of a tool call within a conversation turn.
- Tool
Contract - A tool declaration in the runtime contract.
- Transcript
Buffer - Accumulates input/output transcripts and segments them by turn boundaries.
- Transcript
Turn - A single completed conversation turn with accumulated transcripts.
- Transcript
Window - A read-only snapshot of recent transcript turns for context construction.
- Transition
- A guard-based transition to a named target phase.
- Transition
Contract - A phase transition declaration.
- Transition
Result - Result of a phase transition, carrying the resolved instruction and any context to inject.
- Turn
Count Detector - Fires when a state-based condition is true for
requiredconsecutive evaluations (typically one evaluation per turn). - Voice
Runtime State - Voice-flow state owned by the reactor.
- Watcher
- A single state watcher: observes one key, fires an async action when the predicate matches.
- Watcher
Contract - A watcher declaration.
- Watcher
Registry - Registry of state watchers, evaluated after each mutation cycle.
Enums§
- Callback
Mode - Controls how a control-lane callback is executed relative to the event loop.
- Context
Delivery - When to deliver model-role context turns to the wire.
- Effect
Mode - Whether an effect must complete before the reactor continues.
- Extraction
Trigger - Controls WHEN an extractor runs.
- Instruction
Modifier - A modifier that transforms a phase instruction based on runtime state.
- Live
Effect - A typed runtime effect emitted by a reaction.
- Live
Event - Semantic events emitted by the Live session processor.
- Merge
Policy - How an extracted field should be merged into authoritative session state.
- Phase
Instruction - Instruction source for a phase — either a fixed string or a closure over state.
- Reactor
Event - A normalized event that can drive ADK-level reactions.
- Repair
Action - What action the repair system recommends.
- Session
Type - Session type determines the server-side duration limit.
- Steering
Mode - How the phase machine steers the model’s behavior.
- Tool
Execution Mode - Execution mode for a tool.
- Transition
Evaluation - Result of evaluating outbound transitions.
- Transition
Trigger - What caused a phase transition.
- Watch
Predicate - Condition under which a watcher fires, evaluated against (old, new) values.
Traits§
- Pattern
Detector - A detector that evaluates whether a temporal pattern has been triggered.
- Reactor
Rule - A rule that reacts to normalized events and emits typed effects.
- Result
Formatter - Formats tool responses for background execution lifecycle.
- Session
Persistence - Trait for persisting session state across process restarts.
- Turn
Extractor - 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 foridle(ormaxelapses). 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§
- Predicate
Fn - Custom predicate function type for state change watchers.