setMultilingual

View as MarkdownOpen in Claude

Configure recognizer-driven multilingual mode. The speech recognizer runs in code-switching mode and the agent answers in whatever language the caller actually spoke, rather than the model choosing a language. The config is emitted as the multilingual object on the SWML ai verb.

Mutually exclusive with setLanguages(). If both are set, the platform uses multilingual and ignores languages.

Parameters

config
Record<string, unknown>Required

The multilingual configuration object, passed through as-is: languages (required, one entry per language with a voice), allowed, start_language, min_switch_words, and fillers. See the SWML ai.multilingual reference for every field.

Returns

AgentBase — Returns this for method chaining.

Example

import { AgentBase } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'dispatch', route: '/dispatch' });
agent.setMultilingual({
start_language: 'en',
allowed: ['en', 'es'],
languages: [
{ language: 'default', voice: 'elevenlabs.rachel' },
{ language: 'es', voice: 'elevenlabs.maria' },
],
});