retell-sdk 4.58.0 → 4.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/index.d.mts +5 -2
  3. package/index.d.ts +5 -2
  4. package/index.d.ts.map +1 -1
  5. package/index.js +3 -0
  6. package/index.js.map +1 -1
  7. package/index.mjs +3 -0
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/batch-call.d.ts +626 -0
  11. package/resources/batch-call.d.ts.map +1 -1
  12. package/resources/call.d.ts +98 -37
  13. package/resources/call.d.ts.map +1 -1
  14. package/resources/chat-agent.d.ts +670 -0
  15. package/resources/chat-agent.d.ts.map +1 -0
  16. package/resources/chat-agent.js +66 -0
  17. package/resources/chat-agent.js.map +1 -0
  18. package/resources/chat-agent.mjs +62 -0
  19. package/resources/chat-agent.mjs.map +1 -0
  20. package/resources/chat.d.ts +46 -1
  21. package/resources/chat.d.ts.map +1 -1
  22. package/resources/chat.js +23 -0
  23. package/resources/chat.js.map +1 -1
  24. package/resources/chat.mjs +23 -0
  25. package/resources/chat.mjs.map +1 -1
  26. package/resources/conversation-flow.d.ts +5 -5
  27. package/resources/index.d.ts +2 -1
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js +3 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs +1 -0
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/llm.d.ts +21 -27
  34. package/resources/llm.d.ts.map +1 -1
  35. package/src/index.ts +25 -0
  36. package/src/resources/batch-call.ts +849 -0
  37. package/src/resources/call.ts +107 -37
  38. package/src/resources/chat-agent.ts +1064 -0
  39. package/src/resources/chat.ts +54 -0
  40. package/src/resources/conversation-flow.ts +5 -5
  41. package/src/resources/index.ts +11 -0
  42. package/src/resources/llm.ts +21 -27
  43. package/src/version.ts +1 -1
  44. package/version.d.ts +1 -1
  45. package/version.js +1 -1
  46. package/version.mjs +1 -1
@@ -77,6 +77,13 @@ export namespace BatchCallCreateBatchCallParams {
77
77
  */
78
78
  to_number: string;
79
79
 
80
+ /**
81
+ * For this particular call, override agent configuration with these settings. This
82
+ * allows you to customize agent behavior for individual calls without modifying
83
+ * the base agent.
84
+ */
85
+ agent_override?: Task.AgentOverride;
86
+
80
87
  /**
81
88
  * If true, the e.164 validation will be ignored for the from_number. This can be
82
89
  * useful when you want to dial to internal pseudo numbers. This only applies when
@@ -104,6 +111,848 @@ export namespace BatchCallCreateBatchCallParams {
104
111
  */
105
112
  retell_llm_dynamic_variables?: { [key: string]: unknown };
106
113
  }
114
+
115
+ export namespace Task {
116
+ /**
117
+ * For this particular call, override agent configuration with these settings. This
118
+ * allows you to customize agent behavior for individual calls without modifying
119
+ * the base agent.
120
+ */
121
+ export interface AgentOverride {
122
+ /**
123
+ * Override agent configuration settings. Any properties specified here will
124
+ * override the base agent configuration for this call.
125
+ */
126
+ agent?: AgentOverride.Agent;
127
+
128
+ /**
129
+ * Override conversation flow configuration settings. Only applicable when using
130
+ * conversation flow as the response engine. Supported attributes - model_choice,
131
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
132
+ * start_speaker, begin_after_user_silence_ms.
133
+ */
134
+ conversation_flow?: AgentOverride.ConversationFlow;
135
+
136
+ /**
137
+ * Override Retell LLM configuration settings. Only applicable when using Retell
138
+ * LLM as the response engine. Supported attributes - model, s2s_model,
139
+ * model_temperature, model_high_priority, tool_call_strict_mode,
140
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
141
+ * begin_message.
142
+ */
143
+ retell_llm?: AgentOverride.RetellLlm;
144
+ }
145
+
146
+ export namespace AgentOverride {
147
+ /**
148
+ * Override agent configuration settings. Any properties specified here will
149
+ * override the base agent configuration for this call.
150
+ */
151
+ export interface Agent {
152
+ /**
153
+ * The name of the agent. Only used for your own reference.
154
+ */
155
+ agent_name?: string | null;
156
+
157
+ /**
158
+ * If set to true, DTMF input will be accepted and processed. If false, any DTMF
159
+ * input will be ignored. Default to true.
160
+ */
161
+ allow_user_dtmf?: boolean;
162
+
163
+ /**
164
+ * If set, will add ambient environment sound to the call to make experience more
165
+ * realistic. Currently supports the following options:
166
+ *
167
+ * - `coffee-shop`: Coffee shop ambience with people chatting in background.
168
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/coffee-shop.wav)
169
+ *
170
+ * - `convention-hall`: Convention hall ambience, with some echo and people
171
+ * chatting in background.
172
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/convention-hall.wav)
173
+ *
174
+ * - `summer-outdoor`: Summer outdoor ambience with cicada chirping.
175
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/summer-outdoor.wav)
176
+ *
177
+ * - `mountain-outdoor`: Mountain outdoor ambience with birds singing.
178
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/mountain-outdoor.wav)
179
+ *
180
+ * - `static-noise`: Constant static noise.
181
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/static-noise.wav)
182
+ *
183
+ * - `call-center`: Call center work noise.
184
+ * [Listen to Ambience](https://retell-utils-public.s3.us-west-2.amazonaws.com/call-center.wav)
185
+ *
186
+ * Set to `null` to remove ambient sound from this agent.
187
+ */
188
+ ambient_sound?:
189
+ | 'coffee-shop'
190
+ | 'convention-hall'
191
+ | 'summer-outdoor'
192
+ | 'mountain-outdoor'
193
+ | 'static-noise'
194
+ | 'call-center'
195
+ | null;
196
+
197
+ /**
198
+ * If set, will control the volume of the ambient sound. Value ranging from [0,2].
199
+ * Lower value means quieter ambient sound, while higher value means louder ambient
200
+ * sound. If unset, default value 1 will apply.
201
+ */
202
+ ambient_sound_volume?: number;
203
+
204
+ /**
205
+ * Only applicable when enable_backchannel is true. Controls how often the agent
206
+ * would backchannel when a backchannel is possible. Value ranging from [0,1].
207
+ * Lower value means less frequent backchannel, while higher value means more
208
+ * frequent backchannel. If unset, default value 0.8 will apply.
209
+ */
210
+ backchannel_frequency?: number;
211
+
212
+ /**
213
+ * Only applicable when enable_backchannel is true. A list of words that the agent
214
+ * would use as backchannel. If not set, default backchannel words will apply.
215
+ * Check out
216
+ * [backchannel default words](/agent/interaction-configuration#backchannel) for
217
+ * more details. Note that certain voices do not work too well with certain words,
218
+ * so it's recommended to experiment before adding any words.
219
+ */
220
+ backchannel_words?: Array<string> | null;
221
+
222
+ /**
223
+ * If set, will delay the first message by the specified amount of milliseconds, so
224
+ * that it gives user more time to prepare to take the call. Valid range is [0,
225
+ * 5000]. If not set or set to 0, agent will speak immediately. Only applicable
226
+ * when agent speaks first.
227
+ */
228
+ begin_message_delay_ms?: number;
229
+
230
+ /**
231
+ * Provide a customized list of keywords to bias the transcriber model, so that
232
+ * these words are more likely to get transcribed. Commonly used for names, brands,
233
+ * street, etc.
234
+ */
235
+ boosted_keywords?: Array<string> | null;
236
+
237
+ /**
238
+ * Granular setting to manage how Retell stores sensitive data (transcripts,
239
+ * recordings, logs, etc.). This replaces the deprecated
240
+ * `opt_out_sensitive_data_storage` field.
241
+ *
242
+ * - `everything`: Store all data including transcripts, recordings, and logs.
243
+ * - `everything_except_pii`: Store data without PII when PII is detected.
244
+ * - `basic_attributes_only`: Store only basic attributes; no
245
+ * transcripts/recordings/logs. If not set, default value of "everything" will
246
+ * apply.
247
+ */
248
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
249
+
250
+ /**
251
+ * If set, determines what denoising mode to use. Default to noise-cancellation.
252
+ */
253
+ denoising_mode?: 'noise-cancellation' | 'noise-and-background-speech-cancellation';
254
+
255
+ /**
256
+ * Controls whether the agent would backchannel (agent interjects the speaker with
257
+ * phrases like "yeah", "uh-huh" to signify interest and engagement). Backchannel
258
+ * when enabled tends to show up more in longer user utterances. If not set, agent
259
+ * will not backchannel.
260
+ */
261
+ enable_backchannel?: boolean;
262
+
263
+ /**
264
+ * If users stay silent for a period after agent speech, end the call. The minimum
265
+ * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min).
266
+ */
267
+ end_call_after_silence_ms?: number;
268
+
269
+ /**
270
+ * When TTS provider for the selected voice is experiencing outages, we would use
271
+ * fallback voices listed here for the agent. Voice id and the fallback voice ids
272
+ * must be from different TTS providers. The system would go through the list in
273
+ * order, if the first one in the list is also having outage, it would use the next
274
+ * one. Set to null to remove voice fallback for the agent.
275
+ */
276
+ fallback_voice_ids?: Array<string> | null;
277
+
278
+ /**
279
+ * Controls how sensitive the agent is to user interruptions. Value ranging from
280
+ * [0,1]. Lower value means it will take longer / more words for user to interrupt
281
+ * agent, while higher value means it's easier for user to interrupt agent. If
282
+ * unset, default value 1 will apply. When this is set to 0, agent would never be
283
+ * interrupted.
284
+ */
285
+ interruption_sensitivity?: number;
286
+
287
+ /**
288
+ * Specifies what language (and dialect) the speech recognition will operate in.
289
+ * For instance, selecting `en-GB` optimizes speech recognition for British
290
+ * English. If unset, will use default value `en-US`. Select `multi` for
291
+ * multilingual support, currently this supports Spanish and English.
292
+ */
293
+ language?:
294
+ | 'en-US'
295
+ | 'en-IN'
296
+ | 'en-GB'
297
+ | 'en-AU'
298
+ | 'en-NZ'
299
+ | 'de-DE'
300
+ | 'es-ES'
301
+ | 'es-419'
302
+ | 'hi-IN'
303
+ | 'fr-FR'
304
+ | 'fr-CA'
305
+ | 'ja-JP'
306
+ | 'pt-PT'
307
+ | 'pt-BR'
308
+ | 'zh-CN'
309
+ | 'ru-RU'
310
+ | 'it-IT'
311
+ | 'ko-KR'
312
+ | 'nl-NL'
313
+ | 'nl-BE'
314
+ | 'pl-PL'
315
+ | 'tr-TR'
316
+ | 'th-TH'
317
+ | 'vi-VN'
318
+ | 'ro-RO'
319
+ | 'bg-BG'
320
+ | 'ca-ES'
321
+ | 'da-DK'
322
+ | 'fi-FI'
323
+ | 'el-GR'
324
+ | 'hu-HU'
325
+ | 'id-ID'
326
+ | 'no-NO'
327
+ | 'sk-SK'
328
+ | 'sv-SE'
329
+ | 'multi';
330
+
331
+ /**
332
+ * Maximum allowed length for the call, will force end the call if reached. The
333
+ * minimum value allowed is 60,000 ms (1 min), and maximum value allowed is
334
+ * 7,200,000 (2 hours). By default, this is set to 3,600,000 (1 hour).
335
+ */
336
+ max_call_duration_ms?: number;
337
+
338
+ /**
339
+ * If set to true, will normalize the some part of text (number, currency, date,
340
+ * etc) to spoken to its spoken form for more consistent speech synthesis
341
+ * (sometimes the voice synthesize system itself might read these wrong with the
342
+ * raw text). For example, it will convert "Call my number 2137112342 on Jul 5th,
343
+ * 2024 for the $24.12 payment" to "Call my number two one three seven one one two
344
+ * three four two on july fifth, twenty twenty four for the twenty four dollars
345
+ * twelve cents payment" before starting audio generation.
346
+ */
347
+ normalize_for_speech?: boolean;
348
+
349
+ /**
350
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
351
+ * enabled, the generated URLs will include security signatures that restrict
352
+ * access and automatically expire after 24 hours.
353
+ */
354
+ opt_in_signed_url?: boolean;
355
+
356
+ /**
357
+ * Configuration for PII scrubbing from transcripts and recordings.
358
+ */
359
+ pii_config?: Agent.PiiConfig;
360
+
361
+ /**
362
+ * Post call analysis data to extract from the call. This data will augment the
363
+ * pre-defined variables extracted in the call analysis. This will be available
364
+ * after the call ends.
365
+ */
366
+ post_call_analysis_data?: Array<
367
+ | Agent.StringAnalysisData
368
+ | Agent.EnumAnalysisData
369
+ | Agent.BooleanAnalysisData
370
+ | Agent.NumberAnalysisData
371
+ > | null;
372
+
373
+ /**
374
+ * The model to use for post call analysis. Default to gpt-4o-mini.
375
+ */
376
+ post_call_analysis_model?:
377
+ | 'gpt-4o'
378
+ | 'gpt-4o-mini'
379
+ | 'gpt-4.1'
380
+ | 'gpt-4.1-mini'
381
+ | 'gpt-4.1-nano'
382
+ | 'gpt-5'
383
+ | 'gpt-5-mini'
384
+ | 'gpt-5-nano'
385
+ | 'claude-4.5-sonnet'
386
+ | 'claude-4.0-sonnet'
387
+ | 'claude-3.7-sonnet'
388
+ | 'claude-3.5-haiku'
389
+ | 'gemini-2.0-flash'
390
+ | 'gemini-2.0-flash-lite'
391
+ | 'gemini-2.5-flash'
392
+ | 'gemini-2.5-flash-lite';
393
+
394
+ /**
395
+ * A list of words / phrases and their pronunciation to be used to guide the audio
396
+ * synthesize for consistent pronunciation. Currently only supported for English &
397
+ * 11labs voices. Set to null to remove pronunciation dictionary from this agent.
398
+ */
399
+ pronunciation_dictionary?: Array<Agent.PronunciationDictionary> | null;
400
+
401
+ /**
402
+ * If set, controls how many times agent would remind user when user is
403
+ * unresponsive. Must be a non negative integer. If unset, default value of 1 will
404
+ * apply (remind once). Set to 0 to disable agent from reminding.
405
+ */
406
+ reminder_max_count?: number;
407
+
408
+ /**
409
+ * If set (in milliseconds), will trigger a reminder to the agent to speak if the
410
+ * user has been silent for the specified duration after some agent speech. Must be
411
+ * a positive number. If unset, default value of 10000 ms (10 s) will apply.
412
+ */
413
+ reminder_trigger_ms?: number;
414
+
415
+ /**
416
+ * The Response Engine to attach to the agent. It is used to generate responses for
417
+ * the agent. You need to create a Response Engine first before attaching it to an
418
+ * agent.
419
+ */
420
+ response_engine?:
421
+ | Agent.ResponseEngineRetellLm
422
+ | Agent.ResponseEngineCustomLm
423
+ | Agent.ResponseEngineConversationFlow;
424
+
425
+ /**
426
+ * Controls how responsive is the agent. Value ranging from [0,1]. Lower value
427
+ * means less responsive agent (wait more, respond slower), while higher value
428
+ * means faster exchanges (respond when it can). If unset, default value 1 will
429
+ * apply.
430
+ */
431
+ responsiveness?: number;
432
+
433
+ /**
434
+ * If set, the phone ringing will last for the specified amount of milliseconds.
435
+ * This applies for both outbound call ringtime, and call transfer ringtime.
436
+ * Default to 30000 (30 s). Valid range is [5000, 90000].
437
+ */
438
+ ring_duration_ms?: number;
439
+
440
+ /**
441
+ * If set, determines whether speech to text should focus on latency or accuracy.
442
+ * Default to fast mode.
443
+ */
444
+ stt_mode?: 'fast' | 'accurate';
445
+
446
+ user_dtmf_options?: Agent.UserDtmfOptions | null;
447
+
448
+ /**
449
+ * If set, determines the vocabulary set to use for transcription. This setting
450
+ * only applies for English agents, for non English agent, this setting is a no-op.
451
+ * Default to general.
452
+ */
453
+ vocab_specialization?: 'general' | 'medical';
454
+
455
+ /**
456
+ * Unique voice id used for the agent. Find list of available voices and their
457
+ * preview in Dashboard.
458
+ */
459
+ voice_id?: string;
460
+
461
+ /**
462
+ * Optionally set the voice model used for the selected voice. Currently only
463
+ * elevenlab voices have voice model selections. Set to null to remove voice model
464
+ * selection, and default ones will apply. Check out the dashboard for details on
465
+ * each voice model.
466
+ */
467
+ voice_model?:
468
+ | 'eleven_turbo_v2'
469
+ | 'eleven_flash_v2'
470
+ | 'eleven_turbo_v2_5'
471
+ | 'eleven_flash_v2_5'
472
+ | 'eleven_multilingual_v2'
473
+ | 'tts-1'
474
+ | 'gpt-4o-mini-tts'
475
+ | null;
476
+
477
+ /**
478
+ * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
479
+ * speech, while higher value means faster speech rate. If unset, default value 1
480
+ * will apply.
481
+ */
482
+ voice_speed?: number;
483
+
484
+ /**
485
+ * Controls how stable the voice is. Value ranging from [0,2]. Lower value means
486
+ * more stable, and higher value means more variant speech generation. Currently
487
+ * this setting only applies to `11labs` voices. If unset, default value 1 will
488
+ * apply.
489
+ */
490
+ voice_temperature?: number;
491
+
492
+ /**
493
+ * If this option is set, the call will try to detect voicemail in the first 3
494
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
495
+ * applied when the voicemail is detected. Set this to null to disable voicemail
496
+ * detection.
497
+ */
498
+ voicemail_option?: Agent.VoicemailOption | null;
499
+
500
+ /**
501
+ * If set, will control the volume of the agent. Value ranging from [0,2]. Lower
502
+ * value means quieter agent speech, while higher value means louder agent speech.
503
+ * If unset, default value 1 will apply.
504
+ */
505
+ volume?: number;
506
+
507
+ /**
508
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
509
+ * will apply.
510
+ */
511
+ webhook_timeout_ms?: number;
512
+
513
+ /**
514
+ * The webhook for agent to listen to call events. See what events it would get at
515
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
516
+ * agent to the specified url, and will ignore the account level webhook for this
517
+ * agent. Set to `null` to remove webhook url from this agent.
518
+ */
519
+ webhook_url?: string | null;
520
+ }
521
+
522
+ export namespace Agent {
523
+ /**
524
+ * Configuration for PII scrubbing from transcripts and recordings.
525
+ */
526
+ export interface PiiConfig {
527
+ /**
528
+ * List of PII categories to scrub from transcripts and recordings.
529
+ */
530
+ categories: Array<
531
+ | 'person_name'
532
+ | 'address'
533
+ | 'email'
534
+ | 'phone_number'
535
+ | 'ssn'
536
+ | 'passport'
537
+ | 'driver_license'
538
+ | 'credit_card'
539
+ | 'bank_account'
540
+ | 'password'
541
+ | 'pin'
542
+ | 'medical_id'
543
+ | 'date_of_birth'
544
+ >;
545
+
546
+ /**
547
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
548
+ */
549
+ mode: 'post_call';
550
+ }
551
+
552
+ export interface StringAnalysisData {
553
+ /**
554
+ * Description of the variable.
555
+ */
556
+ description: string;
557
+
558
+ /**
559
+ * Name of the variable.
560
+ */
561
+ name: string;
562
+
563
+ /**
564
+ * Type of the variable to extract.
565
+ */
566
+ type: 'string';
567
+
568
+ /**
569
+ * Examples of the variable value to teach model the style and syntax.
570
+ */
571
+ examples?: Array<string>;
572
+ }
573
+
574
+ export interface EnumAnalysisData {
575
+ /**
576
+ * The possible values of the variable, must be non empty array.
577
+ */
578
+ choices: Array<string>;
579
+
580
+ /**
581
+ * Description of the variable.
582
+ */
583
+ description: string;
584
+
585
+ /**
586
+ * Name of the variable.
587
+ */
588
+ name: string;
589
+
590
+ /**
591
+ * Type of the variable to extract.
592
+ */
593
+ type: 'enum';
594
+ }
595
+
596
+ export interface BooleanAnalysisData {
597
+ /**
598
+ * Description of the variable.
599
+ */
600
+ description: string;
601
+
602
+ /**
603
+ * Name of the variable.
604
+ */
605
+ name: string;
606
+
607
+ /**
608
+ * Type of the variable to extract.
609
+ */
610
+ type: 'boolean';
611
+ }
612
+
613
+ export interface NumberAnalysisData {
614
+ /**
615
+ * Description of the variable.
616
+ */
617
+ description: string;
618
+
619
+ /**
620
+ * Name of the variable.
621
+ */
622
+ name: string;
623
+
624
+ /**
625
+ * Type of the variable to extract.
626
+ */
627
+ type: 'number';
628
+ }
629
+
630
+ export interface PronunciationDictionary {
631
+ /**
632
+ * The phonetic alphabet to be used for pronunciation.
633
+ */
634
+ alphabet: 'ipa' | 'cmu';
635
+
636
+ /**
637
+ * Pronunciation of the word in the format of a IPA / CMU pronunciation.
638
+ */
639
+ phoneme: string;
640
+
641
+ /**
642
+ * The string of word / phrase to be annotated with pronunciation.
643
+ */
644
+ word: string;
645
+ }
646
+
647
+ export interface ResponseEngineRetellLm {
648
+ /**
649
+ * id of the Retell LLM Response Engine.
650
+ */
651
+ llm_id: string;
652
+
653
+ /**
654
+ * type of the Response Engine.
655
+ */
656
+ type: 'retell-llm';
657
+
658
+ /**
659
+ * Version of the Retell LLM Response Engine.
660
+ */
661
+ version?: number | null;
662
+ }
663
+
664
+ export interface ResponseEngineCustomLm {
665
+ /**
666
+ * LLM websocket url of the custom LLM.
667
+ */
668
+ llm_websocket_url: string;
669
+
670
+ /**
671
+ * type of the Response Engine.
672
+ */
673
+ type: 'custom-llm';
674
+ }
675
+
676
+ export interface ResponseEngineConversationFlow {
677
+ /**
678
+ * ID of the Conversation Flow Response Engine.
679
+ */
680
+ conversation_flow_id: string;
681
+
682
+ /**
683
+ * type of the Response Engine.
684
+ */
685
+ type: 'conversation-flow';
686
+
687
+ /**
688
+ * Version of the Conversation Flow Response Engine.
689
+ */
690
+ version?: number | null;
691
+ }
692
+
693
+ export interface UserDtmfOptions {
694
+ /**
695
+ * The maximum number of digits allowed in the user's DTMF (Dual-Tone
696
+ * Multi-Frequency) input per turn. Once this limit is reached, the input is
697
+ * considered complete and a response will be generated immediately.
698
+ */
699
+ digit_limit?: number | null;
700
+
701
+ /**
702
+ * A single key that signals the end of DTMF input. Acceptable values include any
703
+ * digit (0–9), the pound/hash symbol (#), or the asterisk (\*).
704
+ */
705
+ termination_key?: string | null;
706
+
707
+ /**
708
+ * The time (in milliseconds) to wait for user DTMF input before timing out. The
709
+ * timer resets with each digit received.
710
+ */
711
+ timeout_ms?: number;
712
+ }
713
+
714
+ /**
715
+ * If this option is set, the call will try to detect voicemail in the first 3
716
+ * minutes of the call. Actions defined (hangup, or leave a message) will be
717
+ * applied when the voicemail is detected. Set this to null to disable voicemail
718
+ * detection.
719
+ */
720
+ export interface VoicemailOption {
721
+ action:
722
+ | VoicemailOption.VoicemailActionPrompt
723
+ | VoicemailOption.VoicemailActionStaticText
724
+ | VoicemailOption.VoicemailActionHangup;
725
+ }
726
+
727
+ export namespace VoicemailOption {
728
+ export interface VoicemailActionPrompt {
729
+ /**
730
+ * The prompt used to generate the text to be spoken when the call is detected to
731
+ * be in voicemail.
732
+ */
733
+ text: string;
734
+
735
+ type: 'prompt';
736
+ }
737
+
738
+ export interface VoicemailActionStaticText {
739
+ /**
740
+ * The text to be spoken when the call is detected to be in voicemail.
741
+ */
742
+ text: string;
743
+
744
+ type: 'static_text';
745
+ }
746
+
747
+ export interface VoicemailActionHangup {
748
+ type: 'hangup';
749
+ }
750
+ }
751
+ }
752
+
753
+ /**
754
+ * Override conversation flow configuration settings. Only applicable when using
755
+ * conversation flow as the response engine. Supported attributes - model_choice,
756
+ * model_temperature, tool_call_strict_mode, knowledge_base_ids, kb_config,
757
+ * start_speaker, begin_after_user_silence_ms.
758
+ */
759
+ export interface ConversationFlow {
760
+ /**
761
+ * If set, the AI will begin the conversation after waiting for the user for the
762
+ * duration (in milliseconds) specified by this attribute. This only applies if the
763
+ * agent is configured to wait for the user to speak first. If not set, the agent
764
+ * will wait indefinitely for the user to speak.
765
+ */
766
+ begin_after_user_silence_ms?: number | null;
767
+
768
+ /**
769
+ * Knowledge base configuration for RAG retrieval.
770
+ */
771
+ kb_config?: ConversationFlow.KBConfig;
772
+
773
+ /**
774
+ * Knowledge base IDs for RAG (Retrieval-Augmented Generation).
775
+ */
776
+ knowledge_base_ids?: Array<string> | null;
777
+
778
+ /**
779
+ * The model choice for the conversation flow.
780
+ */
781
+ model_choice?: ConversationFlow.ModelChoice;
782
+
783
+ /**
784
+ * Controls the randomness of the model's responses. Lower values make responses
785
+ * more deterministic.
786
+ */
787
+ model_temperature?: number | null;
788
+
789
+ /**
790
+ * Who starts the conversation - user or agent.
791
+ */
792
+ start_speaker?: 'user' | 'agent';
793
+
794
+ /**
795
+ * Whether to use strict mode for tool calls. Only applicable when using certain
796
+ * supported models.
797
+ */
798
+ tool_call_strict_mode?: boolean | null;
799
+ }
800
+
801
+ export namespace ConversationFlow {
802
+ /**
803
+ * Knowledge base configuration for RAG retrieval.
804
+ */
805
+ export interface KBConfig {
806
+ /**
807
+ * Similarity threshold for filtering search results
808
+ */
809
+ filter_score?: number;
810
+
811
+ /**
812
+ * Max number of knowledge base chunks to retrieve
813
+ */
814
+ top_k?: number;
815
+ }
816
+
817
+ /**
818
+ * The model choice for the conversation flow.
819
+ */
820
+ export interface ModelChoice {
821
+ /**
822
+ * The LLM model to use
823
+ */
824
+ model:
825
+ | 'gpt-5'
826
+ | 'gpt-5-mini'
827
+ | 'gpt-5-nano'
828
+ | 'gpt-4o'
829
+ | 'gpt-4o-mini'
830
+ | 'gpt-4.1'
831
+ | 'gpt-4.1-mini'
832
+ | 'gpt-4.1-nano'
833
+ | 'claude-3.7-sonnet'
834
+ | 'claude-3.5-haiku'
835
+ | 'gemini-2.0-flash'
836
+ | 'gemini-2.0-flash-lite'
837
+ | 'gemini-2.5-flash'
838
+ | 'gemini-2.5-flash-lite';
839
+
840
+ /**
841
+ * Type of model choice
842
+ */
843
+ type: 'cascading';
844
+
845
+ /**
846
+ * Whether to use high priority pool with more dedicated resource, default false
847
+ */
848
+ high_priority?: boolean;
849
+ }
850
+ }
851
+
852
+ /**
853
+ * Override Retell LLM configuration settings. Only applicable when using Retell
854
+ * LLM as the response engine. Supported attributes - model, s2s_model,
855
+ * model_temperature, model_high_priority, tool_call_strict_mode,
856
+ * knowledge_base_ids, kb_config, start_speaker, begin_after_user_silence_ms,
857
+ * begin_message.
858
+ */
859
+ export interface RetellLlm {
860
+ /**
861
+ * If set, the AI will begin the conversation after waiting for the user for the
862
+ * duration (in milliseconds) specified by this attribute. This only applies if the
863
+ * agent is configured to wait for the user to speak first. If not set, the agent
864
+ * will wait indefinitely for the user to speak.
865
+ */
866
+ begin_after_user_silence_ms?: number | null;
867
+
868
+ /**
869
+ * First utterance said by the agent in the call. If not set, LLM will dynamically
870
+ * generate a message. If set to "", agent will wait for user to speak first.
871
+ */
872
+ begin_message?: string | null;
873
+
874
+ /**
875
+ * Knowledge base configuration for RAG retrieval.
876
+ */
877
+ kb_config?: RetellLlm.KBConfig | null;
878
+
879
+ /**
880
+ * A list of knowledge base ids to use for this resource.
881
+ */
882
+ knowledge_base_ids?: Array<string> | null;
883
+
884
+ /**
885
+ * Select the underlying text LLM. If not set, would default to gpt-4.1.
886
+ */
887
+ model?:
888
+ | 'gpt-5'
889
+ | 'gpt-5-mini'
890
+ | 'gpt-5-nano'
891
+ | 'gpt-4o'
892
+ | 'gpt-4o-mini'
893
+ | 'gpt-4.1'
894
+ | 'gpt-4.1-mini'
895
+ | 'gpt-4.1-nano'
896
+ | 'claude-3.7-sonnet'
897
+ | 'claude-3.5-haiku'
898
+ | 'gemini-2.0-flash'
899
+ | 'gemini-2.0-flash-lite'
900
+ | 'gemini-2.5-flash'
901
+ | 'gemini-2.5-flash-lite'
902
+ | null;
903
+
904
+ /**
905
+ * If set to true, will use high priority pool with more dedicated resource to
906
+ * ensure lower and more consistent latency, default to false. This feature usually
907
+ * comes with a higher cost.
908
+ */
909
+ model_high_priority?: boolean | null;
910
+
911
+ /**
912
+ * If set, will control the randomness of the response. Value ranging from [0,1].
913
+ * Lower value means more deterministic, while higher value means more random. If
914
+ * unset, default value 0 will apply. Note that for tool calling, a lower value is
915
+ * recommended.
916
+ */
917
+ model_temperature?: number;
918
+
919
+ /**
920
+ * Select the underlying speech to speech model. Can only set this or model, not
921
+ * both.
922
+ */
923
+ s2s_model?: 'gpt-4o-realtime' | 'gpt-4o-mini-realtime' | 'gpt-realtime' | null;
924
+
925
+ /**
926
+ * The speaker who starts the conversation. Required. Must be either 'user' or
927
+ * 'agent'.
928
+ */
929
+ start_speaker?: 'user' | 'agent';
930
+
931
+ /**
932
+ * Whether to use strict mode for tool calls. Only applicable when using certain
933
+ * supported models.
934
+ */
935
+ tool_call_strict_mode?: boolean | null;
936
+ }
937
+
938
+ export namespace RetellLlm {
939
+ /**
940
+ * Knowledge base configuration for RAG retrieval.
941
+ */
942
+ export interface KBConfig {
943
+ /**
944
+ * Similarity threshold for filtering search results
945
+ */
946
+ filter_score?: number;
947
+
948
+ /**
949
+ * Max number of knowledge base chunks to retrieve
950
+ */
951
+ top_k?: number;
952
+ }
953
+ }
954
+ }
955
+ }
107
956
  }
108
957
 
109
958
  export declare namespace BatchCall {