add_language
add_language
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 argument, because on its own it resolves against a default
engine that can change.
Parameters
name
Human-readable language name (e.g., "English", "French", "Spanish").
code
Language code (e.g., "en-US", "fr-FR", "es-MX").
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/model:"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.
speech_fillers
Filler phrases used during natural speech pauses (e.g., ["Um...", "Let me see..."]).
function_fillers
Filler phrases spoken while executing SWAIG functions
(e.g., ["One moment please...", "Looking that up..."]).
engine
Explicit TTS engine name (e.g., "elevenlabs", "rime"). Overrides the
combined string format if provided.
model
Explicit TTS model name (e.g., "eleven_turbo_v2_5", "coda"). Overrides the
combined string format if provided.
params
Per-language params dict for engine-specific tuning and voice settings. Emitted as
the language object’s params key in SWML, and only included when non-empty
(e.g., {"stability": 0.5, "similarity_boost": 0.75}).
Returns
AgentBase — Returns self for method chaining.