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
        • addAnswerVerb
        • addFunctionInclude
        • addHint
        • addHints
        • addInternalFiller
        • addLanguage
        • addMcpServer
        • addPatternHint
        • addPostAiVerb
        • addPostAnswerVerb
        • addPreAnswerVerb
        • addPronunciation
        • addSkill
        • addSkillByName
        • addSwaigQueryParams
        • asRouter
        • autoMapSipUsernames
        • clearPostAiVerbs
        • clearPostAnswerVerbs
        • clearPreAnswerVerbs
        • clearSwaigQueryParams
        • defineContexts
        • defineTool
        • defineTools
        • defineTypedTool
        • enableDebugEvents
        • enableDebugRoutes
        • enableMcpServer
        • enableSipRouting
        • extractSipUsername
        • getApp
        • getBasicAuthCredentials
        • getFullUrl
        • getMcpServers
        • getName
        • getPostPrompt
        • getPrompt
        • getPromptPom
        • getRegisteredTools
        • getTool
        • handleMcpRequest
        • hasSkill
        • isMcpServerEnabled
        • listSkills
        • manualSetProxyUrl
        • onDebugEvent
        • onFunctionCall
        • onSummary
        • onSwmlRequest
        • promptAddSection
        • promptAddSubsection
        • promptAddToSection
        • promptHasSection
        • registerSipUsername
        • registerSwaigFunction
        • removeSkill
        • removeSkillByName
        • renderSwml
        • resetContexts
        • run
        • serve
        • setDynamicConfigCallback
        • setFunctionIncludes
        • setGlobalData
        • setInternalFillers
        • setLanguages
        • setNativeFunctions
        • setParam
        • setParams
        • setPostPrompt
        • setPostPromptLlmParams
        • setPostPromptUrl
        • setPromptLlmParams
        • setPromptPom
        • setPromptText
        • setPronunciations
        • setupGracefulShutdown
        • setWebHookUrl
        • updateGlobalData
        • validateBasicAuth
        • validateToolToken
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • 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
  • Parameters
  • Returns
  • Examples
  • Simple voice
  • Explicit engine
  • With fillers
AgentsAgentBase

addLanguage

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

addMcpServer

Next
Built with

Add a language configuration with voice settings. The agent uses these configurations to support multilingual conversations with appropriate TTS voices.

Language configurations map to the SWML ai.languages array. See the SWML languages reference for the full specification.

The voice parameter supports three formats: a simple voice name, an explicit engine/model via separate parameters, or a combined "engine.voice:model" string.

Parameters

config
LanguageConfigRequired

A language configuration object with the following fields:

config.name
stringRequired

Human-readable language name (e.g., "English", "French", "Spanish").

config.code
stringRequired

Language code (e.g., "en-US", "fr-FR", "es-MX").

config.voice
string

TTS voice identifier. Accepts one of three formats:

  • Simple name: "en-US-Neural2-F"
  • Combined format: "elevenlabs.josh:eleven_turbo_v2_5"
  • Short name with explicit engine: "josh"
config.engine
string

Explicit TTS engine name (e.g., "elevenlabs", "rime").

config.fillers
Record<string, string[]>

Filler phrases keyed by category for this language.

config.speechModel
string

Speech recognition model identifier.

config.functionFillers
Record<string, Record<string, string[]>>

Per-function filler phrases, keyed by function name then language code.

Returns

AgentBase — Returns this for method chaining.

Examples

Simple voice

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.addLanguage({ name: 'English', code: 'en-US', voice: 'rime.spore' });
6await agent.serve();

Explicit engine

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.addLanguage({
6 name: 'English',
7 code: 'en-US',
8 voice: 'josh',
9 engine: 'elevenlabs',
10});
11await agent.serve();

With fillers

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.addLanguage({
6 name: 'English',
7 code: 'en-US',
8 voice: 'rime.spore',
9 fillers: {
10 speech: ['Um...', 'Let me think...'],
11 },
12 functionFillers: {
13 get_weather: { 'en-US': ['Checking the weather...', 'One moment please...'] },
14 },
15});
16await agent.serve();