AgentSession
AgentSession is the orchestrator that binds an
Agent to the SignalWire platform.
When start() is called, it translates the LiveWire agent definition into a SignalWire
AgentBase instance, mapping
instructions to prompts, tools to SWAIG functions, and timing parameters to
SignalWire AI parameters.
Constructor Parameters
tools
Additional tools to register alongside the agent’s tools.
userdata
Arbitrary data attached to the session.
allow_interruptions
Whether the user can interrupt the agent while it is speaking. Maps to
SignalWire’s barge_confidence parameter.
min_interruption_duration
Minimum duration in seconds before an interruption is recognized.
min_endpointing_delay
Minimum silence duration in seconds to finalize speech. Maps to
SignalWire’s end_of_speech_timeout parameter (converted to milliseconds).
max_endpointing_delay
Maximum silence duration in seconds before forcing endpointing. Maps to
SignalWire’s attention_timeout parameter (converted to milliseconds).
max_tool_steps
Maximum number of tool execution steps per turn.
preemptive_generation
Whether to start generating a response before the user finishes speaking.
The stt, tts, llm, vad, turn_detection, and mcp_servers parameters are
accepted for LiveKit API compatibility but are no-ops — SignalWire’s control plane
handles the full media pipeline automatically. MCP servers are not yet supported
in LiveWire.
Properties
userdata
Arbitrary data attached to the session. Accessible from tool handlers via
RunContext.userdata.
Defaults to an empty dict.
history
Conversation history as a list of {"role": ..., "content": ...} dicts.