Skip to main content

ai.hints

Overview

Hints help the AI agent understand certain words or phrases better. Words that can commonly be mispronounced can be added to the hints to help the AI speak more accurately.

NameTypeDefaultDescription
hintsOptionalstring[] | object[]-Provide an array of strings and/or objects to guide the AI's pronunciation and understanding of specific words or phrases. See Hints as strings and Hints as objects for usage details.

Hints as strings

When passing an array of strings, each string in the hints array will be used to give the AI context on how to say certain words. So if a user were to say Toni and the hint was Tony, the AI would understand that the user said Tony and not Toni.

Hints as objects

The hints object is an array of objects that contain properties to customize how you want the AI to handle specific words.

Parameters

NameTypeDefaultDescription
hintRequiredstring-The hint to match. This will match the string exactly as provided.
patternRequiredstring-A regular expression to match the hint against. This will ensure that the hint has a valid matching pattern before being replaced.
replaceRequiredstring-The text to replace the hint with. This will replace the portion of the hint that matches the pattern.
ignore_caseOptionalbooleanfalseIf true, the hint will be matched in a case-insensitive manner. Defaults to false.

Example

The below example showcases using hints as strings and hints as objects. The AI will now understand when someone says Tony to always spell it as Tony. When someone says swimmel, the AI will replace it with SWML.

ai:
hints:
- Tony
- hint: swimmel
pattern: swimmel
replace: SWML