Skip to main content

ai.params

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

NameTypeDefaultDescription
paramsOptionalobject-An object that accepts the params parameters.

params Parameters

Core AI Behavior

These parameters control the fundamental behavior and capabilities of the AI agent, including model selection, conversation management, and advanced features like thinking and vision.

NameTypeDefaultDescription
ai_modelOptionalstringgpt-4o-miniThe AI model that the AI Agent will use during the conversation.

Available AI Models: gpt-4o-mini, gpt-4.1-mini, gpt-4.1-nano

conscienceOptionalstring"Remember to stay in character. You must not do anything outside the scope of your provided role."Sets the prompt which binds the agent to its purpose.
thinking_modelOptionalstringValue of ai_modelThe AI model that the AI Agent will use when utilizing thinking capabilities.

Available AI Models: gpt-4o-mini, gpt-4.1-mini, gpt-4.1-nano

vision_modelOptionalstringValue of ai_modelThe AI model that the AI Agent will use when utilizing vision capabilities.

Available AI Models: gpt-4o-mini, gpt-4.1-mini, gpt-4.1-nano

enable_thinkingOptionalbooleanfalseEnables thinking output for the AI Agent. When set to true, the AI Agent will be able to utilize thinking capabilities.
Important: This may introduce a little bit of latency as the AI will use an additional turn in the conversation to think about the query.
enable_visionOptionalbooleanfalseEnables visual input processing for the AI Agent. The image that will be used for visual processing will be gathered from the users camera if video is available on the call.
When set to true, the AI Agent will be able to utilize visual processing capabilities, while leveraging the get_visual_input function.
wait_for_userOptionalbooleanfalseWhen false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first.
directionOptionalstringthe natural direction of the callForces the direction of the call to the assistant. Valid values are inbound and outbound.
conversation_idOptionalstring-Used by check_for_input and save_conversation to identify an individual conversation.
local_tzOptionalstringGMTThe local timezone setting for the AI. Value should use IANA TZ ID
save_conversationOptionalbooleanfalseSend 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.
transfer_summaryOptionalbooleanfalsePass a summary of a conversation from one AI agent to another. For example, transfer a call summary between support agents in two departments.
languages_enabledOptionalbooleanfalseAllows multilingualism when true.
conversation_sliding_windowOptionalinteger-Sets the conversation history window size (number of turns to keep in context).
summary_modeOptionalstring-Summary generation mode. Valid values: "string", "original".

Speech Recognition

Configure how the AI agent processes and understands spoken input, including speaker identification, voice activity detection, and transcription settings.

NameTypeDefaultDescription
asr_diarizeOptionalbooleanfalseIf true, enables speaker diarization in ASR (Automatic Speech Recognition). This will break up the transcript into chunks, with each chunk containing a unique identity (e.g speaker1, speaker2, etc.) and the text they spoke.
asr_speaker_affinityOptionalbooleanfalseIf true, will force the AI Agent to only respond to the speaker who responds to the AI Agent first. Any other speaker will be ignored.
asr_smart_formatOptionalbooleanfalseEnables smart formatting for ASR output, improving the readability of transcribed text.
openai_asr_engineOptionalstringdeepgram:nova-3The ASR (Automatic Speech Recognition) engine to use. Common values include deepgram:nova-2, deepgram:nova-3, and other supported ASR engines.
energy_levelOptionalnumber52Amount of energy necessary for bot to hear you (in dB). Allowed values from 0.0-100.0.
llm_diarize_awareOptionalbooleanfalseIf true, the AI Agent will be involved with the diarization process. Users can state who they are at the start of the conversation and the AI Agent will be able to correctly identify them when they are speaking later in the conversation.
end_of_speech_timeoutOptionalinteger700 msAmount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from 0-10,000.
first_word_timeoutOptionalinteger1000 msTimeout for detecting the first word of user speech. Allowed values from 0-10,000 ms.

Speech Synthesis

Customize the AI agent's voice output, including volume control, voice characteristics, emotional range, and video avatars for visual interactions.

NameTypeDefaultDescription
ai_volumeOptionalinteger0 (the natural volume of the AI)Adjust the volume of the AI. Allowed values from -50-50.
tts_number_formatOptionalstringinternationalThe format of the number the AI will reference the phone number.
Valid Values: international(e.g. +12345678901) or national(e.g. (234) 567-8901).
eleven_labs_stabilityOptionalnumber-The stability slider determines how stable the voice is and the randomness between each generation. Lowering this slider introduces a broader emotional range for the voice. Valid values range from 0.01 to 1.0.

Important: This will only works when elevenlabs is set in the ai.languages.voice as the engine id.
eleven_labs_similarityOptionalnumber-The similarity slider dictates how closely the AI should adhere to the original voice when attempting to replicate it. The higher the similarity, the closer the AI will sound to the original voice. Valid values range from 0.01 to 1.0.

Important: This will only works when elevenlabs is set in the ai.languages.voice as the engine id.
video_talking_fileOptionalstring-URL of a video file to play when AI is talking. Only works for calls that support video.
video_idle_fileOptionalstring-URL of a video file to play when AI is idle. Only works for calls that support video.
video_listening_fileOptionalstring-URL of a video file to play when AI is listening to the user speak. Only works for calls that support video.
max_emotionOptionalinteger30Maximum emotion intensity for text-to-speech. Allowed values from 1-30.
speech_gen_quick_stopsOptionalinteger3Number of quick stops for speech generation. Allowed values from 0-10.

Interruption & Barge Control

Manage how the AI agent handles interruptions when users speak over it, including when to stop speaking, acknowledge interruptions, or continue regardless.

NameTypeDefaultDescription
acknowledge_interruptionsOptionalboolean | numberfalseInstructs the agent to acknowledge crosstalk and confirm user input when the user speaks over the agent. Can be boolean or a positive integer specifying the maximum number of interruptions to acknowledge.
enable_bargeOptionalstring"complete,partial"Controls when user can interrupt the AI. Valid values: "complete", "partial", "all", or boolean. Set to false to disable barging.
transparent_bargeOptionalbooleantrueWhen enabled, the AI will not respond to the user's input when the user is speaking over the agent. The agent will wait for the user to finish speaking before responding. Additionally, any attempt the LLM makes to barge will be ignored and scraped from the conversation logs.
barge_match_stringOptionalstring-Takes a string, including a regular expression, defining barge behavior. For example, this param can direct the AI to stop when the word "hippopotomus" is input.
barge_min_wordsOptionalinteger-Defines the number of words that must be input before triggering barge behavior. Allowed values from 1-99.
interrupt_on_noiseOptionalboolean | integerfalseWhen enabled, barges agent upon any sound interruption longer than 1 second. Can be boolean or a positive integer specifying the threshold.
interrupt_promptOptionalstring-Provide a prompt for the agent to handle crosstalk.
barge_functionsOptionalbooleantrueAllow functions to be called during barging. When false, functions are not executed if the user is speaking.
transparent_barge_max_timeOptionalinteger3000 msMaximum duration for transparent barge mode. Allowed values from 0-60,000 ms.

Timeouts & Delays

Set various timing parameters that control wait times, response delays, and session limits to optimize the conversation flow and prevent dead air.

NameTypeDefaultDescription
attention_timeoutOptionalinteger5000 msAmount of time, in ms, to wait before prompting the user to respond. Allowed values: 0 (to disable) or 10,000-600,000.
attention_timeout_promptOptionalstringThe user has not responded, try to get their attention. Stay in the same language.A custom prompt that is fed into the AI when the attention_timeout is reached.
inactivity_timeoutOptionalinteger600000 msAmount of time, in ms, to wait before exiting the app due to inactivity. Allowed values: 0 (to disable) or 10,000-3,600,000.
outbound_attention_timeoutOptionalinteger120000 msSets a time duration for the outbound call recipient to respond to the AI agent before timeout. Allowed values from 10,000-600,000 ms.
initial_sleep_msOptionalinteger0Amount of time, in ms, to wait before the AI Agent starts processing. Allowed values from 0-300,000.
speech_event_timeoutOptionalinteger1400 msTimeout for speech events processing. Allowed values from 0-10,000 ms.
digit_timeoutOptionalinteger3000 msTime, in ms, at the end of digit input to detect end of input. Allowed values from 0-30,000.
hard_stop_timeOptionalstring-Specifies the maximum duration for the AI Agent to remain active before it exits the session. After the timeout, the AI will stop responding, and will proceed with the next SWML instruction.
Time Format
  • Seconds Format: 30s
  • Minutes Format: 2m
  • Hours Format: 1h
  • Combined Format: 1h45m30s
hard_stop_promptOptionalstring"Explain to the user that the call has reached its maximum duration and you need to end the conversation."A final prompt that is fed into the AI when the hard_stop_time is reached.
speech_timeoutOptionalinteger60000 msOverall speech timeout (developer mode only). Allowed values from 0-600,000 ms.

Audio & Media

Control background audio, hold music, and greeting messages to enhance the caller experience during different phases of the conversation.

NameTypeDefaultDescription
background_fileOptionalstring-URL of audio file to play in the background while AI plays in foreground.
background_file_loopsOptionalintegerundefined (loops indefinitely)Maximum number of times to loop playing the background file.
background_file_volumeOptionalinteger0Defines background_file volume. Allowed values from -50 to 50.
hold_musicOptionalstring-A URL for the hold music to play, accepting WAV, mp3, and FreeSWITCH tone_stream.
hold_on_processOptionalbooleanfalseEnables hold music during SWAIG processing.
static_greetingOptionalstring-A static greeting to play at the start of the call.
static_greeting_no_bargeOptionalbooleanfalseIf true, the static greeting will not be interrupted by the user if they speak over the greeting. If false, the static greeting can be interrupted by the user if they speak over the greeting.

SWAIG Functions

Configure SignalWire AI Gateway (SWAIG) function capabilities, including permissions, execution timing, and data persistence across function calls.

NameTypeDefaultDescription
swaig_allow_swmlOptionalbooleantrueAllows your SWAIG to return SWML to be executed.
swaig_allow_settingsOptionalbooleantrueAllows tweaking any of the indicated settings, such as barge_match_string, using the returned SWML from the SWAIG function.
swaig_post_conversationOptionalbooleanfalsePost entire conversation to any SWAIG call.
function_wait_for_talkingOptionalbooleanfalseIf true, the AI will wait for any filler to finish playing before executing a function.
If false, the AI will asynchronously execute a function while playing a filler.
swaig_set_global_dataOptionalbooleantrueAllows SWAIG functions to set global data that persists across function calls.
functions_on_no_responseOptionalbooleanfalseExecute functions when the user doesn't respond (on attention timeout).

Input & DTMF

Handle dual-tone multi-frequency (DTMF) input and configure input polling for integrating external data sources during conversations.

NameTypeDefaultDescription
digit_terminatorsOptionalstring-DTMF digit, as a string, to signal the end of input (ex: "#")
input_poll_freqOptionalinteger2000 msCheck for input function with check_for_input. Allowed values from 1,000-10,000 ms. Example use case: Feeding an inbound SMS to AI on a voice call, eg., for collecting an email address or other complex information.

Debug & Development

Enable debugging tools, logging, and performance monitoring features to help developers troubleshoot and optimize their AI agent implementations.

NameTypeDefaultDescription
debug_webhook_urlOptionalstring-Each interaction between the AI and end user is posted in real time to the established URL. Authentication can also be set in the url in the format of username:password@url.
debug_webhook_levelOptionalinteger1Enables debugging to the set URL. Allowed values from 0-2. Level 0 disables, 1 provides basic info, 2 provides verbose info.
audible_debugOptionalbooleanfalseIf true, the AI will announce the function that is being executed on the call.
verbose_logsOptionalbooleanfalseEnable verbose logging (developer mode only).
cache_modeOptionalbooleanfalseEnable response caching to improve performance for repeated queries.
enable_accountingOptionalbooleanfalseEnable usage accounting and tracking for billing and analytics purposes.
audible_latencyOptionalbooleanfalseAnnounce latency information during the call for debugging purposes.