setLanguages

View as MarkdownOpen in Claude

Replace all language configurations at once with a new array. Each element is passed through addLanguage() internally.

Parameters

languages
LanguageConfig[]Required

Array of language configuration objects. Each object should include name, code, and optionally voice, engine, fillers, speechModel, and functionFillers.

Returns

AgentBase — Returns this for method chaining.

Example

1import { AgentBase } from '@signalwire/sdk';
2
3const agent = new AgentBase({ name: 'support', route: '/support' });
4agent.setPromptText('You are a helpful assistant.');
5agent.setLanguages([
6 { name: 'English', code: 'en-US', voice: 'rime.spore' },
7 { name: 'Spanish', code: 'es-MX', voice: 'rime.luna' },
8 { name: 'French', code: 'fr-FR', voice: 'rime.soleil' },
9]);
10await agent.serve();