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

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