addDynamicHints

View as MarkdownOpen in Claude

Add speech recognition hints dynamically during a call. Hints improve recognition accuracy for domain-specific vocabulary, product names, or uncommon words. Each hint can be a simple string or a pronunciation pattern object that maps misrecognized speech to the correct text.

Parameters

hints
(string | { pattern: string; replace: string; ignore_case?: boolean })[]Required

List of hints. Each entry is either:

  • A string — a word or phrase to boost recognition (e.g., "SignalWire")
  • An object with pronunciation pattern fields:
FieldTypeDescription
patternstringRegex pattern to match in recognized speech
replacestringReplacement text when the pattern matches
ignore_casebooleanCase-insensitive matching (optional)

Returns

FunctionResultthis, for chaining.

Examples

Simple Word Hints

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .addDynamicHints(['visa', 'mastercard', 'amex']);

Pronunciation Patterns

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .addDynamicHints([
5 { pattern: '\\d{4}', replace: 'four digits', ignore_case: true },
6 ]);