AgentSession
AgentSession<UserData> 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 LLM model settings to
SignalWire AI parameters.
Constructor
stt
STT provider instance. Accepted for API compatibility; SignalWire handles speech recognition automatically. Logs an informational message on first use.
tts
TTS provider instance. Accepted for API compatibility; SignalWire handles text-to-speech automatically. Logs an informational message on first use.
llm
A model name, or an LLM plugin object such as plugins.OpenAILLM whose model
is used. Sets the model param on the underlying SignalWire agent, with any
provider/ prefix (like "openai/") removed.
vad
VAD provider instance. Accepted for API compatibility; SignalWire handles voice activity detection automatically.
turnDetection
Turn detection configuration. Accepted for API compatibility; SignalWire handles turn detection automatically.
tools
Optional additional tools, as an array or an object keyed by name, merged with the
agent’s tools when start() is called.
mcpServers
Accepted for LiveKit parity. MCP servers are not yet supported in LiveWire — logs a one-time advisory and has no effect.
userData
Arbitrary data attached to the session. Accessible from tool handlers via
RunContext.userData.
allowInterruptions
false sets the enable_barge AI param to false when the session starts, which
turns barge-in off.
minInterruptionDuration
Accepted for LiveKit parity. Forwarded to the SignalWire AI params when the session starts.
minEndpointingDelay
Minimum endpointing delay in seconds. Forwarded to the SignalWire AI params when the session starts.
maxEndpointingDelay
Maximum endpointing delay in seconds. Forwarded to the SignalWire AI params when the session starts.
maxToolSteps
Accepted for LiveKit parity. SignalWire handles tool-execution depth automatically — logs a one-time advisory if set to a non-default value.
preemptiveGeneration
Accepted for LiveKit parity. Stored on the session but not currently used.
Properties
userData
Getter/setter for the session’s user data. Defaults to an empty object.
Methods
getSwAgent
Returns the underlying SignalWire AgentBase instance, or undefined
if start() has not been called yet. Useful for testing or advanced configuration.