***

title: addLanguage
slug: /reference/typescript/agents/agent-base/add-language
description: Add a language configuration with voice settings for multilingual conversations.
max-toc-depth: 3
---------------------

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

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

<Info>
  Language configurations map to the SWML [`ai.languages`][ai-languages] array.
  See the [SWML languages reference][swml-languages-reference] for the full specification.
</Info>

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

## **Parameters**

<ParamField path="config" type="LanguageConfig" required={true} toc={true}>
  A language configuration object with the following fields:
</ParamField>

<Indent>
  <ParamField path="config.name" type="string" required={true} toc={true}>
    Human-readable language name (e.g., `"English"`, `"French"`, `"Spanish"`).
  </ParamField>

  <ParamField path="config.code" type="string" required={true} toc={true}>
    Language code (e.g., `"en-US"`, `"fr-FR"`, `"es-MX"`).
  </ParamField>

  <ParamField path="config.voice" type="string" toc={true}>
    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"`
  </ParamField>

  <ParamField path="config.engine" type="string" toc={true}>
    Explicit TTS engine name (e.g., `"elevenlabs"`, `"rime"`).
  </ParamField>

  <ParamField path="config.fillers" type={"Record<string, string[]>"} toc={true}>
    Filler phrases keyed by category for this language.
  </ParamField>

  <ParamField path="config.speechModel" type="string" toc={true}>
    Speech recognition model identifier.
  </ParamField>

  <ParamField path="config.functionFillers" type={"Record<string, Record<string, string[]>>"} toc={true}>
    Per-function filler phrases, keyed by function name then language code.
  </ParamField>
</Indent>

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