ai.params
Parameters for AI that can be passed in ai.params
at the top level of the ai
Method.
Parameters
Name | Type | Description |
---|---|---|
direction | string | Forces 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_user | boolean | When 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_timeout | integer | Amount 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_timeout | integer | Amount 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_timeout | integer | Amount 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_file | string | URL of audio file to play in the background while AI plays in foreground. Optional. Default is not set. |
background_file_loops | integer | Maximum number of times to loop playing the background file. Optional. Default is undefined, so will loop indefinitely. |
background_file_volume | integer | Adjust the volume of the background file play. Allowed values from -40-40. Optional. Default 0 (the natural volume of the file). |
ai_volume | integer | Adjust the volume of the AI. Allowed values from -50-50. Optional. Default is 0 (the natural volume of the AI). |
local_tz | string | The local timezone setting for the AI. Value should use IANA TZ ID. Default is GMT. |
conscience | boolean | Strictly enforce prompts. Optional. Default is true. |
save_conversation | boolean | Send 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_id | string | Unique identifier for this conversation to be used to retain info from call to call. Optional. Default is undefined. |
digit_timeout | integer | Time, in ms, at the end of digit input to detect end of input. Allowed values from 250-10,000. Optional. Default is 3000. |
digit_terminators | string | DTMF digit, as a string, to signal the end of input (ex: "#"). Optional. Default is undefined. |
energy_level | float | Amount of energy necessary for bot to hear you (in dB). Allowed values from 0-100. Optional. Default is 52. |
swaig_allow_swml | boolean | Allow SWAIG functions to return SWML to be executed by the call. Optional. Default is true. |
Examples
AI agent with background audio
- YAML
- JSON
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"
{
"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.\nYou can reassure that Franklin will get in touch as soon as possible.\nCollect the user's name and number if you do not already know it from the caller id.\nStart by presenting yourself, then let the contact know that Franklin is not available, then offer to collect a message.\nAfter collecting the message, do not wait for the user to end the conversation: say good bye and hang up the call.\n"
},
"params": {
"background_file": "https://path/to/file.mp3",
"background_file_volume": -20,
"save_conversation": true,
"conversation_id": "80afbb06-f0f1-11ed-a285-62c3bdb19a89"
}
}
}
]
}
}