AgentsAgentBase

set_languages

View as MarkdownOpen in Claude

Replace all language configurations at once with a list of raw language dictionaries. To let the caller switch languages mid-call instead, use set_multilingual(); the two are mutually exclusive.

Parameters

languages
list[dict[str, Any]]Required

List of language configuration dictionaries. Each dictionary should include name, code, and voice keys, and optionally engine, model, speech_fillers, and function_fillers.

Returns

AgentBase — Returns self for method chaining.

Example

from signalwire import AgentBase
agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("You are a helpful assistant.")
agent.set_languages([
{"name": "English", "code": "en-US", "voice": "rime.spore"},
{"name": "Spanish", "code": "es-MX", "voice": "rime.luna"},
{"name": "French", "code": "fr-FR", "voice": "rime.soleil"}
])
agent.serve()