Skip to main content

ai.params

Parameters for AI that can be passed in ai.params at the top level of the ai Method.

Parameters

NameTypeDescription
directionstringForces the direction of the call to the assistant. Valid values are "inbound" and "outbound". Optional. Default is the natural direction of the call.
wait_for_userbooleanWhen false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first. Optional. Default is false.
end_of_speech_timeoutintegerAmount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from 250-10,000. Optional. Default is 2000.
attention_timeoutintegerAmount of time, in ms, to wait before prompting the user to respond. Allowed values from 10,000-600,000. May be set to 0 to disable. Optional. Default is 10000.
inactivity_timeoutintegerAmount of time, in ms, to wait before exiting the app due to inactivity. Allowed values from 10,000-3,600,000. Optional. Default is 600000 (10 mins).
background_filestringURL of audio file to play in the background while AI plays in foreground. Optional. Default is not set.
background_file_loopsintegerMaximum number of times to loop playing the background file. Optional. Default is undefined, so will loop indefinitely.
background_file_volumeintegerAdjust the volume of the background file play. Allowed values from -40-40. Optional. Default 0 (the natural volume of the file).
ai_volumeintegerAdjust the volume of the AI. Allowed values from -50-50. Optional. Default is 0 (the natural volume of the AI).
local_tzstringThe local timezone setting for the AI. Value should use IANA TZ ID. Default is GMT.
consciencebooleanStrictly enforce prompts. Optional. Default is true.
save_conversationbooleanSend a summary of the conversation after the call ends. This requires a post_url to be set in the ai parameters and the conversation_id defined below. This eliminates the need for a post_prompt in the ai parameters. Optional. Default is false.
conversation_idstringUnique identifier for this conversation to be used to retain info from call to call. Optional. Default is undefined.
digit_timeoutintegerTime, in ms, at the end of digit input to detect end of input. Allowed values from 250-10,000. Optional. Default is 3000.
digit_terminatorsstringDTMF digit, as a string, to signal the end of input (ex: "#"). Optional. Default is undefined.
energy_levelfloatAmount of energy necessary for bot to hear you (in dB). Allowed values from 0-100. Optional. Default is 52.
swaig_allow_swmlbooleanAllow SWAIG functions to return SWML to be executed by the call. Optional. Default is true.

Examples

AI agent with background audio

version: 1.0.0
sections:
main:
- ai:
post_prompt_url: "https://example.com/my-api"
prompt:
text: |
You are Franklin's assistant, and your job is to collect messages for him over the phone.
You can reassure that Franklin will get in touch as soon as possible.
Collect the user's name and number if you do not already know it from the caller id.
Start by presenting yourself, then let the contact know that Franklin is not available, then offer to collect a message.
After collecting the message, do not wait for the user to end the conversation: say good bye and hang up the call.
params:
background_file: "https://path/to/file.mp3"
background_file_volume: -20
save_conversation: true
conversation_id: "80afbb06-f0f1-11ed-a285-62c3bdb19a89"