> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# addLanguage

> Add a language configuration with voice settings for multilingual conversations.

[ai-languages]: /docs/swml/reference/ai/languages

[swml-languages-reference]: /docs/swml/reference/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.

Language configurations map to the SWML [`ai.languages`][ai-languages] array.
See the [SWML languages reference][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`** `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:

* 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.

---

**`config.params`** `Record<string, unknown>`

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**

### Simple 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();
```