setPronunciations

View as MarkdownOpen in Claude

Replace every pronunciation rule on the agent with the provided array. Use addPronunciation() to append a single rule without replacing the list.

Parameters

rules
PronunciationRule[]Required

Ordered list of pronunciation rules. Each rule has replace (the spelled-out token), with (the phonetic replacement), and an optional ignoreCase boolean.

Returns

AgentBase — Returns this for method chaining.

Example

import { AgentBase } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'support', route: '/support' });
agent.setPromptText('You are a helpful assistant.');
agent.setPronunciations([
{ replace: 'SignalWire', with: 'signal wire' },
{ replace: 'SWML', with: 'swim el' },
{ replace: 'SWAIG', with: 'swayg' },
]);
await agent.serve();