addLanguage
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.
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
A language configuration object with the following fields:
config.name
Human-readable language name (e.g., "English", "French", "Spanish").
config.code
Language code (e.g., "en-US", "fr-FR", "es-MX").
config.voice
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
Explicit TTS engine name (e.g., "elevenlabs", "rime").
config.fillers
Filler phrases keyed by category for this language.
config.speechModel
Speech recognition model identifier.
config.functionFillers
Per-function filler phrases, keyed by function name then language code.
config.params
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().
Returns
AgentBase — Returns this for method chaining.