> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # AgentSession > Session orchestrator that binds an Agent to the SignalWire platform. [agent]: /docs/server-sdks/reference/typescript/agents/livewire/agent [agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base [runcontext]: /docs/server-sdks/reference/typescript/agents/livewire/run-context [functiontool]: /docs/server-sdks/reference/typescript/agents/livewire/function-tool [start]: /docs/server-sdks/reference/typescript/agents/livewire/agent-session/start [say]: /docs/server-sdks/reference/typescript/agents/livewire/agent-session/say [generatereply]: /docs/server-sdks/reference/typescript/agents/livewire/agent-session/generate-reply [interrupt]: /docs/server-sdks/reference/typescript/agents/livewire/agent-session/interrupt [updateagent]: /docs/server-sdks/reference/typescript/agents/livewire/agent-session/update-agent `AgentSession` is the orchestrator that binds an [`Agent`][agent] to the SignalWire platform. When `start()` is called, it translates the LiveWire agent definition into a SignalWire [`AgentBase`][agentbase] instance, mapping instructions to prompts, tools to SWAIG functions, and LLM model settings to SignalWire AI parameters. ```typescript {4-5} import { Agent, AgentSession } from '@signalwire/sdk/livewire'; const agent = new Agent({ instructions: 'You are a helpful assistant.' }); const session = new AgentSession(); await session.start({ agent }); ``` ## **Constructor** ```typescript {1} new AgentSession(options?: { stt?: any; tts?: any; llm?: any; vad?: any; turnDetection?: any; tools?: FunctionTool[]; mcpServers?: unknown; userData?: UserData; allowInterruptions?: boolean; minInterruptionDuration?: number; minEndpointingDelay?: number; maxEndpointingDelay?: number; maxToolSteps?: number; preemptiveGeneration?: boolean; }) ``` **`stt`** `any` STT provider instance. Accepted for API compatibility; SignalWire handles speech recognition automatically. Logs an informational message on first use. --- **`tts`** `any` TTS provider instance. Accepted for API compatibility; SignalWire handles text-to-speech automatically. Logs an informational message on first use. --- **`llm`** `any` LLM provider or model string. If provided, the model name is extracted (stripping any provider prefix like `"openai/"`) and set on the underlying SignalWire agent. --- **`vad`** `any` VAD provider instance. Accepted for API compatibility; SignalWire handles voice activity detection automatically. --- **`turnDetection`** `any` Turn detection configuration. Accepted for API compatibility; SignalWire handles turn detection automatically. --- **`tools`** `FunctionTool[]` Optional additional tools merged with the agent's tools when `start()` is called. --- **`mcpServers`** `unknown` Accepted for LiveKit parity. MCP servers are not yet supported in LiveWire — logs a one-time advisory and has no effect. --- **`userData`** `UserData` — default: \{} Arbitrary data attached to the session. Accessible from tool handlers via [`RunContext.userData`][runcontext]. --- **`allowInterruptions`** `boolean` — default: true Forwarded to the SignalWire AI params when the session starts. --- **`minInterruptionDuration`** `number` — default: 0.5 Accepted for LiveKit parity. Forwarded to the SignalWire AI params when the session starts. --- **`minEndpointingDelay`** `number` — default: 0.5 Minimum endpointing delay in seconds. Forwarded to the SignalWire AI params when the session starts. --- **`maxEndpointingDelay`** `number` — default: 3.0 Maximum endpointing delay in seconds. Forwarded to the SignalWire AI params when the session starts. --- **`maxToolSteps`** `number` — default: 3 Accepted for LiveKit parity. SignalWire handles tool-execution depth automatically — logs a one-time advisory if set to a non-default value. --- **`preemptiveGeneration`** `boolean` — default: false Accepted for LiveKit parity. Stored on the session but not currently used. --- ## **Properties** **`userData`** `UserData` Getter/setter for the session's user data. Defaults to an empty object. --- ## **Methods** #### [start](/docs/server-sdks/reference/typescript/agents/livewire/agent-session/start) Bind an Agent and prepare the underlying SignalWire AgentBase. #### [say](/docs/server-sdks/reference/typescript/agents/livewire/agent-session/say) Queue text to be spoken by the agent. #### [generateReply](/docs/server-sdks/reference/typescript/agents/livewire/agent-session/generate-reply) Trigger the agent to generate a reply. #### [interrupt](/docs/server-sdks/reference/typescript/agents/livewire/agent-session/interrupt) No-op. SignalWire handles barge-in automatically. #### [updateAgent](/docs/server-sdks/reference/typescript/agents/livewire/agent-session/update-agent) Swap in a new Agent mid-session. ### getSwAgent ```typescript {1} getSwAgent(): AgentBase | undefined ``` Returns the underlying SignalWire [`AgentBase`][agentbase] instance, or `undefined` if `start()` has not been called yet. Useful for testing or advanced configuration. > Session orchestrator that binds an Agent to the SignalWire platform. ## Docs - [generateReply](https://signalwire.com/docs/server-sdks/reference/typescript/agents/livewire/agent-session/generate-reply.md): Trigger the agent to generate a reply. - [interrupt](https://signalwire.com/docs/server-sdks/reference/typescript/agents/livewire/agent-session/interrupt.md): No-op. SignalWire handles barge-in automatically via its control plane. - [say](https://signalwire.com/docs/server-sdks/reference/typescript/agents/livewire/agent-session/say.md): Queue text to be spoken by the agent. - [start](https://signalwire.com/docs/server-sdks/reference/typescript/agents/livewire/agent-session/start.md): Bind an Agent and prepare the underlying SignalWire AgentBase. - [updateAgent](https://signalwire.com/docs/server-sdks/reference/typescript/agents/livewire/agent-session/update-agent.md): Swap in a new Agent mid-session.