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.
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
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:
- Simple name:
"en-US-Neural2-F" - Combined format:
"elevenlabs.josh:eleven_turbo_v2_5" - Short name with explicit
engine:"josh"
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.