AgentsAgentBase

add_pronunciation

View as MarkdownOpen in Claude

Add a pronunciation rule that tells the TTS engine how to speak a specific word or phrase. Useful for brand names, acronyms, and technical terms that are commonly mispronounced by text-to-speech engines.

Parameters

replace
strRequired

The expression to match in the AI’s output text.

with_text
strRequired

The phonetic spelling or alternative text the TTS engine should speak instead.

ignore_case
boolDefaults to False

Whether to ignore case when matching the replace expression.

Returns

AgentBase — Returns self for method chaining.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="support", route="/support")
4agent.set_prompt_text("You are a helpful assistant.")
5agent.add_pronunciation("SQL", "sequel")
6agent.add_pronunciation("SWAIG", "swig", ignore_case=True)
7agent.serve()