Skip to main content

ai.prompt

Defines the AI agent's personality, goals, behaviors, and instructions for handling conversations. The prompt establishes how the agent should interact with callers, what information it should gather, and how it should respond to various scenarios.

It is recommended to write prompts using markdown formatting as LLMs better understand structured content. Additionally it is recommended to read the Prompting Best Practices guide.

ai.prompt
object

An object that contains the prompt parameters.

prompt Parameters

The prompt property accepts one of the following objects:

prompt.text
stringrequired

The main identity prompt for the AI. This prompt will be used to outline the agent's personality, role, and other characteristics.

prompt.contexts
object

An object that defines the available contexts for the AI. Each context represents a set of steps that guide the flow of the conversation. The object must include a default key, which specifies the initial context used at the start of the conversation. Additional contexts can be added as other keys within the object. For more details, see the contexts technical reference.

prompt.temperature
number
Default: 1.0

Randomness setting. Float value between 0.0 and 1.5. Closer to 0 will make the output less random.

prompt.top_p
number
Default: 1.0

Randomness setting. Alternative to temperature. Float value between 0.0 and 1.0. Closer to 0 will make the output less random.

prompt.confidence
number
Default: 0.6

Threshold to fire a speech-detect event at the end of the utterance. Float value between 0.0 and 1.0. Decreasing this value will reduce the pause after the user speaks, but may introduce false positives.

prompt.presence_penalty
number
Default: 0

Aversion to staying on topic. Float value between -2.0 and 2.0. Positive values increase the model's likelihood to talk about new topics.

prompt.frequency_penalty
number
Default: 0

Aversion to repeating lines. Float value between -2.0 and 2.0. Positive values decrease the model's likelihood to repeat the same line verbatim.

prompt.max_tokens
integer
Default: 256

Limits the amount of tokens that the AI agent may generate when creating its response.
Valid Value Range: 0 - 4096

Variable Expansion

Use the following syntax to expand variables into your prompt.

${call_direction}
string

Inbound or outbound.

${caller_id_number}
string

The caller ID number.

${local_date}
string

The local date.

${spoken_date}
string

The spoken date.

${local_time}
string

The local time.

${time_of_day}
string

The time of day.

${supported_languages}
string

A list of supported languages.

${default_language}
string

The default language.