> 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. # addLanguage > Add a language configuration with voice settings for multilingual conversations. [ai-languages]: /docs/swml/reference/calling/ai/languages [swml-languages-reference]: /docs/swml/reference/calling/ai/languages [ref-agentbase]: /docs/server-sdks/reference/typescript/agents/agent-base Add a language configuration with voice settings. The agent uses these configurations to support multilingual conversations with appropriate TTS voices. > **Info** > > Language configurations map to the SWML [`ai.languages`][ai-languages] array. > See the [SWML languages reference][swml-languages-reference] for the full specification. > **Tip** > > Write `voice` as `"engine.voice"`, optionally with a `":model"` suffix. A bare voice name works > only alongside an explicit `engine` field, because on its own it resolves against a default > engine that can change. ## **Parameters** **`config`** `LanguageConfig` — required A language configuration object with the following fields: --- **`config.name`** `string` — required Human-readable language name (e.g., `"English"`, `"French"`, `"Spanish"`). --- **`config.code`** `string` — required Language code (e.g., `"en-US"`, `"fr-FR"`, `"es-MX"`). --- **`config.voice`** `string` TTS voice identifier. Accepts one of three formats: * Engine and voice: `"elevenlabs.josh"` * Engine, voice, and model: `"elevenlabs.josh:eleven_turbo_v2_5"` * Voice name with explicit `engine`: `"josh"` Always name the engine, either in the voice string or through `engine`. A voice name on its own — `"en-US-Neural2-F"` — is resolved against a default engine, and that default can change. --- **`config.engine`** `string` Explicit TTS engine name (e.g., `"elevenlabs"`, `"rime"`). --- **`config.fillers`** `Record` Filler phrases keyed by category for this language. --- **`config.speechModel`** `string` Speech recognition model identifier. --- **`config.functionFillers`** `Record>` Per-function filler phrases, keyed by function name then language code. --- **`config.params`** `Record` Optional per-language params dictionary for engine-specific tuning (e.g. voice settings). Only emitted into the SWML document when non-empty, so existing entries stay byte-identical when omitted. Can also be set or updated later via [`setLanguageParams()`](/docs/server-sdks/reference/typescript/agents/agent-base/set-language-params). --- ## **Returns** [`AgentBase`][ref-agentbase] -- Returns `this` for method chaining. ## **Examples** ### Engine and voice (engine.voice) ```typescript {5} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); agent.addLanguage({ name: 'English', code: 'en-US', voice: 'rime.spore' }); await agent.serve(); ``` ### Explicit engine ```typescript {5} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); agent.addLanguage({ name: 'English', code: 'en-US', voice: 'josh', engine: 'elevenlabs', }); await agent.serve(); ``` ### With fillers ```typescript {5} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); agent.addLanguage({ name: 'English', code: 'en-US', voice: 'rime.spore', fillers: { speech: ['Um...', 'Let me think...'], }, functionFillers: { get_weather: { 'en-US': ['Checking the weather...', 'One moment please...'] }, }, }); await agent.serve(); ``` > Add a language configuration with voice settings for multilingual conversations.