For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
        • Agent
        • AgentSession
          • generateReply
          • interrupt
          • say
          • start
          • updateAgent
        • Infrastructure
        • Plugins
        • runApp
        • RunContext
        • Signals
        • tool / FunctionTool
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Signature
  • Parameters
  • Returns
  • Example
AgentsLiveWireAgentSession

start

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

updateAgent

Next
Built with

Bind an Agent to this session and prepare the underlying SignalWire infrastructure. This translates the agent’s instructions into a prompt, registers tools as SWAIG functions, and maps the LLM model (if provided) to the SignalWire AI model parameter.

Signature

1async start(params: { agent: Agent<UserData>; room?: any; record?: boolean }): Promise<void>

Parameters

agent
AgentRequired

The Agent instance to bind to this session.

room
any

A room instance. Accepted for API compatibility with LiveKit.

record
boolean

Whether to record the session. Accepted for API compatibility with LiveKit.

Returns

Promise<void>

Example

1import { Agent, AgentSession, tool } from '@signalwire/sdk/livewire';
2
3const checkBalance = tool({
4 description: 'Check the balance for an account.',
5 parameters: { accountId: { type: 'string' } },
6 execute: (params) => {
7 return `Account ${params.accountId} has a balance of $150.00.`;
8 },
9});
10
11const agent = new Agent({
12 instructions: 'You are a helpful banking assistant.',
13 tools: { checkBalance },
14});
15
16const session = new AgentSession({ llm: 'gpt-4o' });
17await session.start({ agent });