ai.params
Parameters for AI that can be passed in ai.params at the top level of the ai Method.
These parameters control the fundamental behavior and capabilities of the AI agent, including model selection, conversation management, and advanced features like thinking and vision.
An object that accepts the params parameters.
params Parameters
gpt-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
"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.
Used by check_for_input and save_conversation to identify an individual conversation.
Sets the conversation history window size (number of turns to keep in context).
the natural direction of the callForces the direction of the call to the assistant. Valid values are inbound and outbound.
falseEnables 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.
falseEnables 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.
falseSend 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.
Value of `ai_model`The 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
falsePass a summary of a conversation from one AI agent to another. For example, transfer a call summary between support agents in two departments.
Value of `ai_model`The 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
falseWhen false, AI agent will initialize dialogue after call is setup. When true, agent will wait for the user to speak first.
Speech Recognition
Configure how the AI agent processes and understands spoken input, including speaker identification, voice activity detection, and transcription settings.
falseIf 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.
falseEnables smart formatting for ASR output, improving the readability of transcribed text.
falseIf 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.
700Amount of silence, in ms, at the end of an utterance to detect end of speech. Allowed values from 0-10,000.
52Amount of energy necessary for bot to hear you (in dB). Allowed values from 0.0-100.0.
1000Timeout for detecting the first word of user speech. Allowed values from 0-10,000 ms.
falseIf 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.
deepgram:nova-3The ASR (Automatic Speech Recognition) engine to use. Common values include deepgram:nova-2, deepgram:nova-3, and other supported ASR engines.
Speech Synthesis
Customize the AI agent's voice output, including volume control, voice characteristics, emotional range, and video avatars for visual interactions.
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.
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.
30Maximum emotion intensity for text-to-speech. Allowed values from 1-30.
3Number of quick stops for speech generation. Allowed values from 0-10.
internationalThe format of the number the AI will reference the phone number.
Valid Values: international(e.g. +12345678901) or national(e.g. (234) 567-8901).
URL of a video file to play when AI is idle. Only works for calls that support video.
URL of a video file to play when AI is listening to the user speak. Only works for calls that support video.
URL of a video file to play when AI is talking. Only works for calls that support video.
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.
falseInstructs 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.
trueAllow functions to be called during barging. When false, functions are not executed if the user is speaking.
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.
Defines the number of words that must be input before triggering barge behavior. Allowed values from 1-99.
"complete,partial"Controls when user can interrupt the AI. Valid values: "complete", "partial", "all", or boolean. Set to false to disable barging.
falseWhen enabled, barges agent upon any sound interruption longer than 1 second. Can be boolean or a positive integer specifying the threshold.
trueWhen 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.
3000Maximum 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.
5000Amount of time, in ms, to wait before prompting the user to respond. Allowed values: 0 (to disable) or 10,000-600,000.
The 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.
3000Time, in ms, at the end of digit input to detect end of input. Allowed values from 0-30,000.
"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.
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
600000Amount of time, in ms, to wait before exiting the app due to inactivity. Allowed values: 0 (to disable) or 10,000-3,600,000.
0Amount of time, in ms, to wait before the AI Agent starts processing. Allowed values from 0-300,000.
120000Sets a time duration for the outbound call recipient to respond to the AI agent before timeout. Allowed values from 10,000-600,000 ms.
1400Timeout for speech events processing. Allowed values from 0-10,000 ms.
60000Overall 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.
undefinedMaximum number of times to loop playing the background file.
0Defines background_file volume. Allowed values from -50 to 50.
A URL for the hold music to play, accepting WAV, mp3, and FreeSWITCH tone_stream.
falseIf 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.
falseIf 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.
falseExecute functions when the user doesn't respond (on attention timeout).
trueAllows tweaking any of the indicated settings, such as barge_match_string, using the returned SWML from the SWAIG function.
trueAllows SWAIG functions to set global data that persists across function calls.
Input & DTMF
Handle dual-tone multi-frequency (DTMF) input and configure input polling for integrating external data sources during conversations.
2000Check 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.
falseIf true, the AI will announce the function that is being executed on the call.
falseAnnounce latency information during the call for debugging purposes.
1Enables debugging to the set URL. Allowed values from 0-2. Level 0 disables, 1 provides basic info, 2 provides verbose info.
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.
falseEnable usage accounting and tracking for billing and analytics purposes.