import { APIResource } from "../core/resource.js"; import { APIPromise } from "../core/api-promise.js"; import { RequestOptions } from "../internal/request-options.js"; export declare class Llm extends APIResource { /** * Create a new Retell LLM Response Engine that can be attached to an agent. This * is used to generate response output for the agent. * * @example * ```ts * const llmResponse = await client.llm.create(); * ``` */ create(body: LlmCreateParams, options?: RequestOptions): APIPromise; /** * Retrieve details of a specific Retell LLM Response Engine * * @example * ```ts * const llmResponse = await client.llm.retrieve( * '16b980523634a6dc504898cda492e939', * ); * ``` */ retrieve(llmID: string, query?: LlmRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Update an existing Retell LLM Response Engine * * @example * ```ts * const llmResponse = await client.llm.update( * '16b980523634a6dc504898cda492e939', * { * begin_message: * 'Hey I am a virtual assistant calling from Retell Hospital.', * }, * ); * ``` */ update(llmID: string, params: LlmUpdateParams, options?: RequestOptions): APIPromise; /** * List Retell LLM Response Engines with pagination * * @example * ```ts * const llms = await client.llm.list(); * ``` */ list(query?: LlmListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Delete an existing Retell LLM Response Engine * * @example * ```ts * await client.llm.delete('oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD'); * ``` */ delete(llmID: string, params?: LlmDeleteParams | null | undefined, options?: RequestOptions): APIPromise; } export interface LlmResponse { /** * Last modification timestamp (milliseconds since epoch). Either the time of last * update or creation if no updates available. */ last_modification_timestamp: number; /** * Unique id of Retell LLM Response Engine. */ llm_id: string; /** * @deprecated Backup models are supported only for call agents. Response engines * with a backup model cannot be used by chat agents. */ backup_model?: unknown | LlmResponse.BackupModelChoice; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * First utterance said by the agent in the call. If not set, LLM will dynamically * generate a message. If set to "", agent will wait for user to speak first. */ begin_message?: string | null; /** * Default dynamic variables represented as key-value pairs of strings. These are * injected into your Retell LLM prompt and tool description when specific values * are not provided in a request. Only applicable for Retell LLM. */ default_dynamic_variables?: { [key: string]: string; } | null; /** * General prompt appended to system prompt no matter what state the agent is in. * * - System prompt (with state) = general prompt + state prompt. * - System prompt (no state) = general prompt. */ general_prompt?: string | null; /** * A list of tools the model may call (to get external knowledge, call API, etc). * You can select from some common predefined tools like end call, transfer call, * etc; or you can create your own custom tool for the LLM to use. * * - Tools of LLM (with state) = general tools + state tools + state transitions * - Tools of LLM (no state) = general tools */ general_tools?: Array | null; /** * Whether the Retell LLM Response Engine is published. */ is_published?: boolean; /** * Whether this Retell LLM is used for warm transfer. Can only be set at creation, * and is ignored on update. */ is_transfer_llm?: boolean | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: LlmResponse.KBConfig | null; /** * A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * A list of MCPs to use for this LLM. */ mcps?: Array | null; /** * @deprecated Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: LlmResponse.CascadingModelConfig | LlmResponse.S2SModelConfig | LlmResponse.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.primary.tier fast. Ignored when * model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number; /** * @deprecated Deprecated, use model_config.primary.tier ultrafast. Ignored when * model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * The speaker who starts the conversation. Required. Must be either 'user' or * 'agent'. */ start_speaker?: 'user' | 'agent'; /** * Name of the starting state. Required if states is not empty. */ starting_state?: string | null; /** * @deprecated States of the LLM. This is to help reduce prompt length and tool * choices when the call can be broken into distinct states. With shorter prompts * and less tools, the LLM can better focus and follow the rules, minimizing * hallucination. If this field is not set, the agent would only have general * prompt and general tools (essentially one state). */ states?: Array | null; /** * Version of the Retell LLM Response Engine. */ version?: number; /** * Prompt for the voice model when model_config.type is duplex, at most 15,000 * tokens. Required for duplex, where general_prompt is the backend's prompt. Kept * when you switch models. */ voice_prompt?: string | null; } export declare namespace LlmResponse { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface Mcp { name: string; /** * The URL of the MCP server. */ url: string; /** * Headers to add to the MCP connection request. */ headers?: { [key: string]: string; }; /** * Query parameters to append to the MCP connection request URL. */ query_params?: { [key: string]: string; }; /** * Maximum time to wait for an MCP tool call to return (in milliseconds). Values * below 60,000 are treated as 60,000, and values above 600,000 are treated as * 600,000. Default to 60,000 ms (1 minute). */ timeout_ms?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } interface State { /** * Name of the state, must be unique for each state. Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; /** * Edges of the state define how and what state can be reached from this state. */ edges?: Array; /** * Prompt of the state, will be appended to the system prompt of LLM. * * - System prompt = general prompt + state prompt. */ state_prompt?: string; /** * A list of tools specific to this state the model may call (to get external * knowledge, call API, etc). You can select from some common predefined tools like * end call, transfer call, etc; or you can create your own custom tool for the LLM * to use. * * - Tools of LLM = general tools + state tools + state transitions */ tools?: Array; } namespace State { interface Edge { /** * Describes what's the transition and at what time / criteria should this * transition happen. */ description: string; /** * The destination state name when going through transition of state via this edge. * State transition internally is implemented as a tool call of LLM, and a tool * call with name "transition*to*{destination_state_name}" will get created. Feel * free to reference it inside the prompt. */ destination_state_name: string; /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ parameters?: Edge.Parameters; } namespace Edge { /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } } } export interface LlmListResponse { /** * Whether more results are available. */ has_more: boolean; items: Array; /** * Pagination key for the next page. */ pagination_key?: string; } export interface LlmCreateParams { /** * @deprecated Backup models are supported only for call agents. Response engines * with a backup model cannot be used by chat agents. */ backup_model?: unknown | LlmCreateParams.BackupModelChoice; /** * If set, the AI will begin the conversation after waiting for the user for the * duration (in milliseconds) specified by this attribute. This only applies if the * agent is configured to wait for the user to speak first. If not set, the agent * will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * First utterance said by the agent in the call. If not set, LLM will dynamically * generate a message. If set to "", agent will wait for user to speak first. */ begin_message?: string | null; /** * Default dynamic variables represented as key-value pairs of strings. These are * injected into your Retell LLM prompt and tool description when specific values * are not provided in a request. Only applicable for Retell LLM. */ default_dynamic_variables?: { [key: string]: string; } | null; /** * General prompt appended to system prompt no matter what state the agent is in. * * - System prompt (with state) = general prompt + state prompt. * - System prompt (no state) = general prompt. */ general_prompt?: string | null; /** * A list of tools the model may call (to get external knowledge, call API, etc). * You can select from some common predefined tools like end call, transfer call, * etc; or you can create your own custom tool for the LLM to use. * * - Tools of LLM (with state) = general tools + state tools + state transitions * - Tools of LLM (no state) = general tools */ general_tools?: Array | null; /** * Whether this Retell LLM is used for warm transfer. Can only be set at creation, * and is ignored on update. */ is_transfer_llm?: boolean | null; /** * Knowledge base configuration for RAG retrieval. */ kb_config?: LlmCreateParams.KBConfig | null; /** * A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * A list of MCPs to use for this LLM. */ mcps?: Array | null; /** * @deprecated Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Model settings for the response engine. type decides which models primary and * backup accept. On update, each top-level key replaces the current one and * omitted keys are kept; set backup to null to remove it. Changing type requires * primary and clears backup, while temperature carries over. In agent_override, * type is required whenever primary is set; setting backup to null disables it for * that call only. */ model_config?: LlmCreateParams.CascadingModelConfig | LlmCreateParams.S2SModelConfig | LlmCreateParams.DuplexModelConfig; /** * @deprecated Deprecated, use model_config.primary.tier fast. Ignored when * model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Deprecated, use model_config.temperature. Ignored when model_config * is set. */ model_temperature?: number; /** * @deprecated Deprecated, use model_config.primary.tier ultrafast. Ignored when * model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * The speaker who starts the conversation. Required. Must be either 'user' or * 'agent'. */ start_speaker?: 'user' | 'agent'; /** * Name of the starting state. Required if states is not empty. */ starting_state?: string | null; /** * @deprecated States of the LLM. This is to help reduce prompt length and tool * choices when the call can be broken into distinct states. With shorter prompts * and less tools, the LLM can better focus and follow the rules, minimizing * hallucination. If this field is not set, the agent would only have general * prompt and general tools (essentially one state). */ states?: Array | null; /** * Prompt for the voice model when model_config.type is duplex, at most 15,000 * tokens. Required for duplex, where general_prompt is the backend's prompt. Kept * when you switch models. */ voice_prompt?: string | null; } export declare namespace LlmCreateParams { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface Mcp { name: string; /** * The URL of the MCP server. */ url: string; /** * Headers to add to the MCP connection request. */ headers?: { [key: string]: string; }; /** * Query parameters to append to the MCP connection request URL. */ query_params?: { [key: string]: string; }; /** * Maximum time to wait for an MCP tool call to return (in milliseconds). Values * below 60,000 are treated as 60,000, and values above 600,000 are treated as * 600,000. Default to 60,000 ms (1 minute). */ timeout_ms?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } interface State { /** * Name of the state, must be unique for each state. Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; /** * Edges of the state define how and what state can be reached from this state. */ edges?: Array; /** * Prompt of the state, will be appended to the system prompt of LLM. * * - System prompt = general prompt + state prompt. */ state_prompt?: string; /** * A list of tools specific to this state the model may call (to get external * knowledge, call API, etc). You can select from some common predefined tools like * end call, transfer call, etc; or you can create your own custom tool for the LLM * to use. * * - Tools of LLM = general tools + state tools + state transitions */ tools?: Array; } namespace State { interface Edge { /** * Describes what's the transition and at what time / criteria should this * transition happen. */ description: string; /** * The destination state name when going through transition of state via this edge. * State transition internally is implemented as a tool call of LLM, and a tool * call with name "transition*to*{destination_state_name}" will get created. Feel * free to reference it inside the prompt. */ destination_state_name: string; /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ parameters?: Edge.Parameters; } namespace Edge { /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } } } export interface LlmRetrieveParams { /** * Optional version of the API to use for this request. Default to latest version. */ version?: number; } export interface LlmUpdateParams { /** * Query param: Optional version of the API to use for this request. Default to * latest version. */ version?: number; /** * @deprecated Body param: Backup models are supported only for call agents. * Response engines with a backup model cannot be used by chat agents. */ backup_model?: unknown | LlmUpdateParams.BackupModelChoice; /** * Body param: If set, the AI will begin the conversation after waiting for the * user for the duration (in milliseconds) specified by this attribute. This only * applies if the agent is configured to wait for the user to speak first. If not * set, the agent will wait indefinitely for the user to speak. */ begin_after_user_silence_ms?: number | null; /** * Body param: First utterance said by the agent in the call. If not set, LLM will * dynamically generate a message. If set to "", agent will wait for user to speak * first. */ begin_message?: string | null; /** * Body param: Default dynamic variables represented as key-value pairs of strings. * These are injected into your Retell LLM prompt and tool description when * specific values are not provided in a request. Only applicable for Retell LLM. */ default_dynamic_variables?: { [key: string]: string; } | null; /** * Body param: General prompt appended to system prompt no matter what state the * agent is in. * * - System prompt (with state) = general prompt + state prompt. * - System prompt (no state) = general prompt. */ general_prompt?: string | null; /** * Body param: A list of tools the model may call (to get external knowledge, call * API, etc). You can select from some common predefined tools like end call, * transfer call, etc; or you can create your own custom tool for the LLM to use. * * - Tools of LLM (with state) = general tools + state tools + state transitions * - Tools of LLM (no state) = general tools */ general_tools?: Array | null; /** * Body param: Whether this Retell LLM is used for warm transfer. Can only be set * at creation, and is ignored on update. */ is_transfer_llm?: boolean | null; /** * Body param: Knowledge base configuration for RAG retrieval. */ kb_config?: LlmUpdateParams.KBConfig | null; /** * Body param: A list of knowledge base ids to use for this resource. */ knowledge_base_ids?: Array | null; /** * Body param: A list of MCPs to use for this LLM. */ mcps?: Array | null; /** * @deprecated Body param: Available LLM models for agents. */ model?: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon' | null; /** * Body param: Model settings for the response engine. type decides which models * primary and backup accept. On update, each top-level key replaces the current * one and omitted keys are kept; set backup to null to remove it. Changing type * requires primary and clears backup, while temperature carries over. In * agent_override, type is required whenever primary is set; setting backup to null * disables it for that call only. */ model_config?: LlmUpdateParams.CascadingModelConfig | LlmUpdateParams.S2SModelConfig | LlmUpdateParams.DuplexModelConfig; /** * @deprecated Body param: Deprecated, use model_config.primary.tier fast. Ignored * when model_config is set. */ model_high_priority?: boolean | null; /** * @deprecated Body param: Deprecated, use model_config.temperature. Ignored when * model_config is set. */ model_temperature?: number; /** * @deprecated Body param: Deprecated, use model_config.primary.tier ultrafast. * Ignored when model_config is set. */ model_ultrafast?: boolean | null; /** * @deprecated Body param: The speech-to-speech model to use */ s2s_model?: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0' | null; /** * Body param: The speaker who starts the conversation. Required. Must be either * 'user' or 'agent'. */ start_speaker?: 'user' | 'agent'; /** * Body param: Name of the starting state. Required if states is not empty. */ starting_state?: string | null; /** * @deprecated Body param: States of the LLM. This is to help reduce prompt length * and tool choices when the call can be broken into distinct states. With shorter * prompts and less tools, the LLM can better focus and follow the rules, * minimizing hallucination. If this field is not set, the agent would only have * general prompt and general tools (essentially one state). */ states?: Array | null; /** * Body param: Prompt for the voice model when model_config.type is duplex, at most * 15,000 tokens. Required for duplex, where general_prompt is the backend's * prompt. Kept when you switch models. */ voice_prompt?: string | null; } export declare namespace LlmUpdateParams { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelChoice { /** * The LLM model to use */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Type of model choice */ type: 'cascading'; /** * Duration in milliseconds to prefer primary model output while both models run * concurrently. Must be between 300 and 60000 milliseconds, inclusive. Defaults to * 1500 when omitted. */ backup_kick_in_timeout?: number; /** * Whether to use high priority pool with more dedicated resource, default false */ high_priority?: boolean; /** * Whether to use the ultrafast tier for much faster response generation, default * false. Only supported by gpt-6.1-sol on voice agents; ignored otherwise. Takes * precedence over high_priority. */ ultrafast?: boolean; } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } /** * Knowledge base configuration for RAG retrieval. */ interface KBConfig { /** * Similarity threshold for filtering search results */ filter_score?: number; /** * Max number of knowledge base chunks to retrieve */ top_k?: number; } interface Mcp { name: string; /** * The URL of the MCP server. */ url: string; /** * Headers to add to the MCP connection request. */ headers?: { [key: string]: string; }; /** * Query parameters to append to the MCP connection request URL. */ query_params?: { [key: string]: string; }; /** * Maximum time to wait for an MCP tool call to return (in milliseconds). Values * below 60,000 are treated as 60,000, and values above 600,000 are treated as * 600,000. Default to 60,000 ms (1 minute). */ timeout_ms?: number; } interface CascadingModelConfig { /** * A text LLM that runs alongside the primary and takes over when the primary is * slow. */ backup?: CascadingModelConfig.BackupModelRef | unknown; primary?: CascadingModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a text LLM with a separate voice. This is the default type. */ type?: 'cascading'; } namespace CascadingModelConfig { /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } } interface S2SModelConfig { primary?: S2SModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a speech-to-speech model. */ type?: 's2s'; } namespace S2SModelConfig { interface Primary { /** * The speech-to-speech model to use */ model: 'gpt-realtime-2.1' | 'gpt-realtime-2.1-mini' | 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | 'grok-voice-3.0'; } } /** * Retell LLMs only. A full-duplex voice model talks to the user and delegates to a * cascading backend model, which runs the LLM's prompt, tools and knowledge base. * Requires backend, and the Retell LLM's voice_prompt. Tools' * speak_during_execution is ignored, since the voice model covers the wait itself, * and speak_after_execution is always on. */ interface DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ backend?: DuplexModelConfig.Backend; /** * A backup for the backend model. */ backup?: DuplexModelConfig.BackupModelRef | unknown; primary?: DuplexModelConfig.Primary; /** * Randomness of the response, from 0 to 1. Defaults to 0; a lower value is * recommended for tool calling. */ temperature?: number; /** * Runs a full-duplex voice model with a cascading backend. */ type?: 'duplex'; } namespace DuplexModelConfig { /** * The text LLM that answers the voice model's delegations. */ interface Backend { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } /** * Backup models are supported only for call agents. Response engines with a backup * model cannot be used by chat agents. */ interface BackupModelRef { /** * Available LLM models for agents. */ model: 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6.2-astra' | 'gpt-6.2-sol' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-6-luna' | 'tell-1' | 'claude-4.6-sonnet' | 'claude-5-opus' | 'claude-5.5-opus' | 'claude-5-sonnet' | 'claude-5.5-sonnet' | 'claude-5.5-haiku' | 'claude-4.5-haiku' | 'gemini-3.0-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-neon' | 'gemini-4-hydrogen' | 'gemini-4-carbon' | 'gemini-4-argon'; /** * How long to prefer the primary model's output while both models run, in * milliseconds. Defaults to 1500. */ kick_in_timeout_ms?: number; /** * Capacity tier for a model. standard is always available. fast draws from * dedicated capacity for lower, steadier latency, and ultrafast is faster still on * voice agents; faster tiers cost more. Each model offers its own set of tiers, * and a tier the model does not offer is rejected. */ tier?: 'standard' | 'fast' | 'ultrafast'; } interface Primary { model: 'gpt-live-1'; } } interface State { /** * Name of the state, must be unique for each state. Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; /** * Edges of the state define how and what state can be reached from this state. */ edges?: Array; /** * Prompt of the state, will be appended to the system prompt of LLM. * * - System prompt = general prompt + state prompt. */ state_prompt?: string; /** * A list of tools specific to this state the model may call (to get external * knowledge, call API, etc). You can select from some common predefined tools like * end call, transfer call, etc; or you can create your own custom tool for the LLM * to use. * * - Tools of LLM = general tools + state tools + state transitions */ tools?: Array; } namespace State { interface Edge { /** * Describes what's the transition and at what time / criteria should this * transition happen. */ description: string; /** * The destination state name when going through transition of state via this edge. * State transition internally is implemented as a tool call of LLM, and a tool * call with name "transition*to*{destination_state_name}" will get created. Feel * free to reference it inside the prompt. */ destination_state_name: string; /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ parameters?: Edge.Parameters; } namespace Edge { /** * Describes what parameters you want to extract out when the transition changes. * The parameters extracted here can be referenced in prompts & function * descriptions of later states via dynamic variables. The parameters the functions * accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface EscalateChatTool { destination: EscalateChatTool.Destination; name: string; type: 'escalate_chat'; description?: string; } namespace EscalateChatTool { interface Destination { destination: Destination.Destination; type: 'webhook'; } namespace Destination { interface Destination { method: 'POST' | 'PUT'; /** * Customer webhook URL for transfer requests and forwarded SMS messages. */ url: string; /** * Customer-defined fields nested in args on chat_transfer_requested events. String * values support dynamic variables such as {{customer_id}}, including inside * nested objects and arrays. Field names and non-string values are preserved. */ body?: { [key: string]: unknown; }; headers?: { [key: string]: string; }; max_retry?: number; query_params?: { [key: string]: string; }; timeout_ms?: number; } } } interface EndCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'end_call'; /** * Custom SIP headers sent on the outgoing BYE when ending the call. Header names * must start with X- or x-. Supports dynamic variables. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when ending the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface TransferCallTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; transfer_destination: TransferCallTool.TransferDestinationPredefined | TransferCallTool.TransferDestinationInferred; transfer_option: TransferCallTool.TransferOptionColdTransfer | TransferCallTool.TransferOptionWarmTransfer | TransferCallTool.TransferOptionAgenticWarmTransfer; type: 'transfer_call'; /** * Custom SIP headers to be added to the call. */ custom_sip_headers?: { [key: string]: string; }; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say to user when transferring the call. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, the e.164 validation will be ignored for the from_number. This can be * useful when you want to dial to internal pseudo numbers. This only applies when * you are using custom telephony and does not apply when you are using Retell * Telephony. If omitted, the default value is false. */ ignore_e164_validation?: boolean; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } namespace TransferCallTool { interface TransferDestinationPredefined { /** * The number to transfer to in E.164 format or a dynamic variable like * {{transfer_number}}. */ number: string; /** * The type of transfer destination. */ type: 'predefined'; /** * Extension digits to dial after the main number connects. Sent via DTMF. Allow * digits, '\*', '#', or a dynamic variable like {{extension}}. */ extension?: string; } interface TransferDestinationInferred { /** * The prompt to be used to help infer the transfer destination. The model will * take the global prompt, the call transcript, and this prompt together to deduce * the right number to transfer to. Can contain dynamic variables. */ prompt: string; /** * The type of transfer destination. */ type: 'inferred'; } interface TransferOptionColdTransfer { /** * The type of the transfer. */ type: 'cold_transfer'; /** * The mode of the cold transfer. If set to `sip_refer`, will use SIP REFER to * transfer the call. If set to `sip_invite`, will use SIP INVITE to transfer the * call. */ cold_transfer_mode?: 'sip_refer' | 'sip_invite'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * The music to play while the caller is being transferred. If omitted, preserves * the existing transfer audio behavior. Use `custom` together with * `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring. Requires the telephony side to support caller id override. Retell * Twilio numbers support this option. This parameter takes effect only when * `cold_transfer_mode` is set to `sip_invite`. When using `sip_refer`, this option * is not available. Retell Twilio numbers always use user's number as the caller * id when using `sip refer` cold transfer mode. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } interface TransferOptionWarmTransfer { /** * The type of the transfer. */ type: 'warm_transfer'; /** * The time to wait before considering transfer fails. */ agent_detection_timeout_ms?: number; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ ivr_option?: TransferOptionWarmTransfer.IvrOption; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set to true, will not perform human detection for the transfer. Default to * false. */ opt_out_human_detection?: boolean; /** * If set, when transfer is connected, will say the handoff message only to the * agent receiving the transfer. Can leave either a static message or a dynamic one * based on prompt. Set to null to disable warm handoff. */ private_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionWarmTransfer.WarmTransferPrompt | TransferOptionWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionWarmTransfer { /** * IVR navigation option to run when doing human detection. This prompt will guide * the AI on how to navigate the IVR system. */ interface IvrOption { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } interface TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ agentic_transfer_config: TransferOptionAgenticWarmTransfer.AgenticTransferConfig; /** * The type of the transfer. */ type: 'agentic_warm_transfer'; /** * Asset ID of the uploaded hold music to play. Required when `on_hold_music` is * `custom`. Must reference an audio asset owned by the organization (see * create-asset). */ custom_on_hold_music_asset_id?: string; /** * Whether to play an audio cue when bridging the call. Defaults to true. */ enable_bridge_audio_cue?: boolean; /** * The music to play while the caller is being transferred. Use `custom` together * with `custom_on_hold_music_asset_id` to play an uploaded audio asset. */ on_hold_music?: 'none' | 'relaxing_sound' | 'uplifting_beats' | 'ringtone' | 'custom'; /** * If set, when transfer is successful, will say the handoff message to both the * transferee and the agent receiving the transfer. Can leave either a static * message or a dynamic one based on prompt. Set to null to disable warm handoff. */ public_handoff_option?: TransferOptionAgenticWarmTransfer.WarmTransferPrompt | TransferOptionAgenticWarmTransfer.WarmTransferStaticMessage; /** * If set to true, will show transferee (the user, not the AI agent) as caller when * transferring, requires the telephony side to support caller id override. Retell * Twilio numbers support this option. */ show_transferee_as_caller?: boolean; /** * Override the ring duration for this specific transfer, in milliseconds. If not * set, falls back to the agent-level `ring_duration_ms`. */ transfer_ring_duration_ms?: number; } namespace TransferOptionAgenticWarmTransfer { /** * Configuration for agentic warm transfer. Required for agentic warm transfer. */ interface AgenticTransferConfig { /** * The action to take when the transfer agent times out without making a decision. * Defaults to cancel_transfer. */ action_on_timeout?: 'bridge_transfer' | 'cancel_transfer'; /** * The agent that will mediate the transfer decision. */ transfer_agent?: AgenticTransferConfig.TransferAgent; /** * The maximum time to wait for the transfer agent to make a decision, in * milliseconds. Defaults to 30000 (30 seconds). */ transfer_timeout_ms?: number; } namespace AgenticTransferConfig { /** * The agent that will mediate the transfer decision. */ interface TransferAgent { /** * The agent ID of the transfer agent. This agent must have isTransferAgent set to * true and should use bridge_transfer and cancel_transfer tools (for Retell LLM) * or BridgeTransferNode and CancelTransferNode (for Conversation Flow). */ agent_id: string; /** * The version of the transfer agent to use. */ agent_version: string | number; } } interface WarmTransferPrompt { /** * The prompt to be used for warm handoff. Can contain dynamic variables. */ prompt?: string; type?: 'prompt'; } interface WarmTransferStaticMessage { /** * The static message to be used for warm handoff. Can contain dynamic variables. */ message?: string; type?: 'static_message'; } } } interface AgentSwapTool { /** * The id of the agent to swap to. */ agent_id: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). */ name: string; /** * Post call analysis setting for the agent swap. */ post_call_analysis_setting: 'both_agents' | 'only_destination_agent'; type: 'agent_swap'; /** * The version of the agent to swap to. If not specified, will use the latest * version. */ agent_version?: string | number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * The message for the agent to speak when executing agent swap. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, keep the current language when swapping agents. Defaults to false. */ keep_current_language?: boolean; /** * If true, keep the current voice and ambient sound settings when swapping agents. * Otherwise, use the destination agent's voice and ambient sound settings. * Defaults to false. */ keep_current_voice?: boolean; speak_during_execution?: boolean; /** * If true, restart the max call duration timer at the swap using the destination * agent's max_call_duration_ms, capped so the whole call never exceeds 2 hours. * Otherwise, the timer already running is left unchanged. Voice calls only. * Defaults to false. */ use_swap_agent_max_duration?: boolean; /** * Webhook setting for the agent swap, defaults to only source. */ webhook_setting?: 'both_agents' | 'only_destination_agent' | 'only_source_agent'; } interface PressDigitTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'press_digit'; /** * Delay in milliseconds before pressing the digit, because a lot of IVR systems * speak very slowly, and a delay can make sure the agent hears the full menu. * Default to 1000 ms (1s). Valid range is 0 to 5000 ms (inclusive). */ delay_ms?: number; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; } interface SendSMSTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; sms_content: SendSMSTool.SMSContentPredefined | SendSMSTool.SMSContentInferred | SendSMSTool.SMSContentTemplate; type: 'send_sms'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description?: string; /** * Describes what to say before sending the SMS. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * SMS destination number configuration. If omitted, the message is sent to the * customer number on the call. */ sms_destination?: SendSMSTool.DestinationCustomerNumber | SendSMSTool.DestinationPhoneNumber | unknown; /** * SMS sender number configuration. If omitted, the message is sent from the * agent's phone number. */ sms_sender?: SendSMSTool.SenderCurrentNumber | SendSMSTool.SenderRetellLongCode | unknown; /** * Whether the agent should speak after the SMS tool finishes execution. */ speak_after_execution?: boolean; /** * If true, the agent will speak a short line before sending the SMS. If omitted, * defaults to true (same as end_call / transfer_call tools). */ speak_during_execution?: boolean; } namespace SendSMSTool { interface SMSContentPredefined { /** * The static message to be sent in the SMS. Can contain dynamic variables. */ text?: string; type?: 'predefined'; } interface SMSContentInferred { /** * The prompt to be used to help infer the SMS content. The model will take the * global prompt, the call transcript, and this prompt together to deduce the right * message to send. Can contain dynamic variables. */ prompt?: string; type?: 'inferred'; } interface SMSContentTemplate { /** * The template to use for the SMS content. "info_collection" sends a predefined * message requesting information from the user. */ template: 'info_collection'; type: 'template'; } interface DestinationCustomerNumber { type: 'customer_number'; } interface DestinationPhoneNumber { /** * Destination phone number in E.164 format. */ phone_number: string; type: 'phone_number'; /** * If true, skip E.164 validation for this phone number (same semantics as * transfer_call ignore_e164_validation). */ ignore_e164_validation?: boolean; } interface SenderCurrentNumber { type: 'current_number'; } interface SenderRetellLongCode { type: 'retell_long_code'; } } interface CustomTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'custom'; /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ url: string; /** * If set to true, the parameters will be passed as root level JSON object instead * of nested under "args". */ args_at_root?: boolean; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. Useful when the tool takes a noticeable amount of time to prevent * silence on the call. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Headers to add to the request. */ headers?: { [key: string]: string; }; /** * Maximum number of times to retry the request after a failed attempt, from 0 (no * retry) to 5. Retries happen on any failure, with exponential backoff between * attempts; the backoff delay is not configurable. `timeout_ms` applies per * attempt rather than as a budget across all attempts, so an attempt that times * out is still retried and the worst-case total duration is `timeout_ms` * multiplied by (`max_retry` + 1) as well as any latency incurred by the * exponential backoff + jitter between each retry. Only the final attempt's result * is reported to the agent. Because retries repeat the request, only set this * above 0 if your endpoint is idempotent — a retried request may be processed more * than once. Defaults to 0 (no retry). */ max_retry?: number; /** * Method to use for the request, default to POST. */ method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; /** * How the tool's `parameters` are authored and shown in the dashboard editor — * "form" for the visual parameter builder, "json" for a raw JSON Schema. Both * produce the same `parameters` schema; this does not change how the request body * is encoded (see `args_at_root`). */ parameter_type?: 'json' | 'form'; /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ parameters?: CustomTool.Parameters; /** * Query parameters to append to the request URL. */ query_params?: { [key: string]: string; }; /** * A mapping of variable names to JSON paths in the response body. These values * will be extracted from the response and made available as dynamic variables for * use. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the tool can run before it's considered * timeout. If the tool times out, the agent would have that info. The minimum * value allowed is 1000 ms (1 s), and maximum value allowed is 600,000 ms (10 * min). By default, this is set to 120,000 ms (2 min). */ timeout_ms?: number; } namespace CustomTool { /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameters { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } interface CodeTool { /** * JavaScript code to execute in the sandbox. */ code: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'code'; /** * Describes what this tool does and when to call this tool. */ description?: string; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * A mapping of variable names to JSON paths in the code execution result. These * mapped values will be extracted and added as dynamic variables. */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the tool. */ speak_during_execution?: boolean; /** * The maximum time in milliseconds the code can run before it's considered * timeout. Defaults to 30,000 ms (30 s). */ timeout_ms?: number; } interface ExtractDynamicVariableTool { /** * Describes what the tool does, sometimes can also include information about when * to call the tool. */ description: string; /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state edges). Must be consisted of a-z, A-Z, * 0-9, or contain underscores and dashes, with a maximum length of 64 (no space * allowed). */ name: string; type: 'extract_dynamic_variable'; /** * The variables to be extracted. */ variables: Array; /** * If true, play a typing sound on the agent audio track while this tool is * executing. */ enable_typing_sound?: boolean; } namespace ExtractDynamicVariableTool { interface StringAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'string'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Examples of the variable value to teach model the style and syntax. */ examples?: Array; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface EnumAnalysisData { /** * The possible values of the variable, must be non empty array. */ choices: Array; /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'enum'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface BooleanAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'boolean'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } interface NumberAnalysisData { /** * Description of the variable. */ description: string; /** * Name of the variable. */ name: string; /** * Type of the variable to extract. */ type: 'number'; /** * Instruction for deciding whether to populate this field. Only used when required * is false. */ conditional_prompt?: string; /** * Whether this data is required. Defaults to true. If true and the data is not * extracted, the call will be marked as unsuccessful. Set to false to let the * field stay empty when the call has no applicable value; this is the "Allow empty * value" setting in the dashboard. */ required?: boolean; } } interface BridgeTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'bridge_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it bridges the original caller to the transfer target and ends the * transfer agent call. */ description?: string; /** * Describes what to say to user when bridging the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface CancelTransferTool { /** * Name of the tool. Must be unique within all tools available to LLM at any given * time (general tools + state tools + state transitions). Must be consisted of * a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64 * (no space allowed). */ name: string; type: 'cancel_transfer'; /** * Describes what the tool does. This tool is only available to transfer agents * (agents with isTransferAgent set to true) in agentic warm transfer mode. When * invoked, it cancels the transfer, returns the original caller to the main agent, * and ends the transfer agent call. */ description?: string; /** * Describes what to say to user when cancelling the transfer. Only applicable when * speak_during_execution is true. */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * If true, will speak during execution. */ speak_during_execution?: boolean; } interface McpTool { /** * Description of the MCP tool. */ description: string; /** * Name of the MCP tool. */ name: string; type: 'mcp'; /** * If true, play a typing sound on the agent audio track while this MCP tool is * executing. */ enable_typing_sound?: boolean; /** * The description for the sentence agent say during execution. Only applicable * when speak_during_execution is true. Can write what to say or even provide * examples. The default is "The message you will say to callee when calling this * tool. Make sure it fits into the conversation smoothly.". */ execution_message_description?: string; /** * Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * The input schema of the MCP tool. */ input_schema?: { [key: string]: string; }; /** * Unique id of the MCP. */ mcp_id?: string; /** * Response variables to add to dynamic variables, key is the variable name, value * is the path to the variable in the response */ response_variables?: { [key: string]: string; }; /** * Determines whether the agent would call LLM another time and speak when the * result of function is obtained. Usually this needs to get turned on so user can * get update for the function call. */ speak_after_execution?: boolean; /** * Determines whether the agent would say sentence like "One moment, let me check * that." when executing the function. Recommend to turn on if your function call * takes over 1s (including network) to complete, so that your agent remains * responsive. */ speak_during_execution?: boolean; } interface AppTool { /** * The connection (App) this tool runs against. Must be a connection in the * organization whose provider matches this tool's provider. */ app_id: string; /** * Name of the catalog template within the provider, as listed by * list-app-templates. */ app_tool_template_name: string; /** * Name of the tool. Must be unique within the phase's tools; referenced by * depends_on. Must be consisted of a-z, A-Z, 0-9, or contain underscores and * dashes, with a maximum length of 64 (no space allowed). */ name: string; /** * Provider of the connection. Must match the connection's provider; supported * providers are listed by list-app-templates. */ provider: string; type: 'integration_app'; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Overrides the catalog template's LLM-facing description. */ description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, play a typing sound on the agent audio track while this * tool is executing. Useful when the tool takes a noticeable amount of time to * prevent silence on the call. */ enable_typing_sound?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. The message for the agent to speak when executing the tool. Only * applicable when speak_during_execution is true. */ execution_message_description?: string; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Type of execution message. "prompt" means the agent will use * execution_message_description as a prompt to generate the message. "static_text" * means the agent will speak the execution_message_description directly. Defaults * to "prompt". */ execution_message_type?: 'prompt' | 'static_text'; /** * Dynamic variable to store execution status as "success" or "failure". Tools * skipped by conditions or dependencies leave it unchanged. */ execution_status_variable?: string; /** * Which fields of a successful JSON tool response the agent and the transcript * see. Omit to keep all fields. Does not affect response_variables, which are * always extracted from the raw response. Non-JSON responses and failed tool * results are not filtered. Response size limits still apply. */ output_selection?: AppTool.UnionMember0 | AppTool.UnionMember1; /** * The resolved input parameters, in order. Properties may pin a value with const * (including {{variable}} references) or provide a description for LLM inference. * Each property may also record selected*input_mode, the editor mode the user * selected ("const_enum", "const_boolean", "const_value", "description_custom", or * "description_preset"); it is stored and returned as-is, used only by the tool * config UI. Omit the key when no mode is recorded; when set, const*_ modes * require a non-empty const, and description\__ modes must omit const entirely. * Each parameter's required list must match the schema returned by the * corresponding step of the get-app-tool-schema loop. */ parameters?: Array; /** * Mapping of a dynamic-variable name to the response field (dot-path) it is * populated from. Missing paths are ignored. */ response_variables?: { [key: string]: string; }; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. Determines whether the agent would call LLM another time and speak * when the result of the tool is obtained. */ speak_after_execution?: boolean; /** * Only applies to during conversation functions; ignored by the pre/post * conversation. If true, will speak during execution. */ speak_during_execution?: boolean; } namespace AppTool { interface UnionMember0 { mode: 'all'; /** * Not used at runtime; stored and returned as-is for the UI. */ fields?: Array; } interface UnionMember1 { /** * The only response fields the agent and the transcript see, as dot-paths into the * response (for app tools, the response schema returned by get-app-tool-schema). * Everything else is dropped. Selecting a parent keeps its whole subtree. A plain * segment traverses arrays element-wise (deals.properties.amount keeps that field * on every deal), while key[n] selects one element (deals[0].id keeps only the * first deal's id); paths that match nothing contribute nothing. */ fields: Array; mode: 'subset'; } /** * The parameters the functions accepts, described as a JSON Schema object. See * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for * documentation about the format. Omitting parameters defines a function with an * empty parameter list. */ interface Parameter { /** * The value of properties is an object, where each key is the name of a property * and each value is a schema used to validate that property. */ properties: unknown; /** * Type must be "object" for a JSON Schema object. */ type: 'object'; /** * On an integration function's response schema, false means the output fields are * fixed to properties and no others can be added. */ additionalProperties?: boolean; /** * List of names of required property when generating this parameter. LLM will do * its best to generate the required properties in its function arguments. Property * must exist in properties. */ required?: Array; } } } } export interface LlmListParams { /** * Maximum number of items to return. */ limit?: number; /** * Pagination key for fetching the next page. */ pagination_key?: string; /** * Sort order for results. */ sort_order?: 'ascending' | 'descending'; } export interface LlmDeleteParams { /** * By default the deletion is rejected with a 400 if any agent still uses this * Retell LLM as its response engine. Set to true to delete it anyway, which leaves * those agents pointing at a Retell LLM that no longer exists. */ force_delete?: boolean; } export declare namespace Llm { export { type LlmResponse as LlmResponse, type LlmListResponse as LlmListResponse, type LlmCreateParams as LlmCreateParams, type LlmRetrieveParams as LlmRetrieveParams, type LlmUpdateParams as LlmUpdateParams, type LlmListParams as LlmListParams, type LlmDeleteParams as LlmDeleteParams, }; } //# sourceMappingURL=llm.d.ts.map