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
@@ -0,0 +1,1064 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import { isRequestOptions } from '../core';
5
+ import * as Core from '../core';
6
+
7
+ export class ChatAgent extends APIResource {
8
+ /**
9
+ * Create a new chat agent
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const chatAgentResponse = await client.chatAgent.create({
14
+ * response_engine: {
15
+ * llm_id: 'llm_234sdertfsdsfsdf',
16
+ * type: 'retell-llm',
17
+ * },
18
+ * });
19
+ * ```
20
+ */
21
+ create(body: ChatAgentCreateParams, options?: Core.RequestOptions): Core.APIPromise<ChatAgentResponse> {
22
+ return this._client.post('/create-chat-agent', { body, ...options });
23
+ }
24
+
25
+ /**
26
+ * Retrieve details of a specific chat agent
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const chatAgentResponse = await client.chatAgent.retrieve(
31
+ * '16b980523634a6dc504898cda492e939',
32
+ * );
33
+ * ```
34
+ */
35
+ retrieve(
36
+ agentId: string,
37
+ query?: ChatAgentRetrieveParams,
38
+ options?: Core.RequestOptions,
39
+ ): Core.APIPromise<ChatAgentResponse>;
40
+ retrieve(agentId: string, options?: Core.RequestOptions): Core.APIPromise<ChatAgentResponse>;
41
+ retrieve(
42
+ agentId: string,
43
+ query: ChatAgentRetrieveParams | Core.RequestOptions = {},
44
+ options?: Core.RequestOptions,
45
+ ): Core.APIPromise<ChatAgentResponse> {
46
+ if (isRequestOptions(query)) {
47
+ return this.retrieve(agentId, {}, query);
48
+ }
49
+ return this._client.get(`/get-chat-agent/${agentId}`, { query, ...options });
50
+ }
51
+
52
+ /**
53
+ * Update an existing chat agent
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const chatAgentResponse = await client.chatAgent.update(
58
+ * '16b980523634a6dc504898cda492e939',
59
+ * );
60
+ * ```
61
+ */
62
+ update(
63
+ agentId: string,
64
+ params: ChatAgentUpdateParams,
65
+ options?: Core.RequestOptions,
66
+ ): Core.APIPromise<ChatAgentResponse> {
67
+ const { version, ...body } = params;
68
+ return this._client.patch(`/update-chat-agent/${agentId}`, { query: { version }, body, ...options });
69
+ }
70
+
71
+ /**
72
+ * List all chat agents
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const chatAgentResponses = await client.chatAgent.list();
77
+ * ```
78
+ */
79
+ list(query?: ChatAgentListParams, options?: Core.RequestOptions): Core.APIPromise<ChatAgentListResponse>;
80
+ list(options?: Core.RequestOptions): Core.APIPromise<ChatAgentListResponse>;
81
+ list(
82
+ query: ChatAgentListParams | Core.RequestOptions = {},
83
+ options?: Core.RequestOptions,
84
+ ): Core.APIPromise<ChatAgentListResponse> {
85
+ if (isRequestOptions(query)) {
86
+ return this.list({}, query);
87
+ }
88
+ return this._client.get('/list-chat-agents', { query, ...options });
89
+ }
90
+
91
+ /**
92
+ * Get all versions of a chat agent
93
+ *
94
+ * @example
95
+ * ```ts
96
+ * const chatAgentResponses =
97
+ * await client.chatAgent.getVersions(
98
+ * '16b980523634a6dc504898cda492e939',
99
+ * );
100
+ * ```
101
+ */
102
+ getVersions(agentId: string, options?: Core.RequestOptions): Core.APIPromise<ChatAgentGetVersionsResponse> {
103
+ return this._client.get(`/get-chat-agent-versions/${agentId}`, options);
104
+ }
105
+ }
106
+
107
+ export interface ChatAgentResponse {
108
+ /**
109
+ * Unique id of chat agent.
110
+ */
111
+ agent_id: string;
112
+
113
+ /**
114
+ * Last modification timestamp (milliseconds since epoch). Either the time of last
115
+ * update or creation if no updates available.
116
+ */
117
+ last_modification_timestamp: number;
118
+
119
+ /**
120
+ * The Response Engine to attach to the agent. It is used to generate responses for
121
+ * the agent. You need to create a Response Engine first before attaching it to an
122
+ * agent.
123
+ */
124
+ response_engine:
125
+ | ChatAgentResponse.ResponseEngineRetellLm
126
+ | ChatAgentResponse.ResponseEngineCustomLm
127
+ | ChatAgentResponse.ResponseEngineConversationFlow;
128
+
129
+ /**
130
+ * The name of the chat agent. Only used for your own reference.
131
+ */
132
+ agent_name?: string | null;
133
+
134
+ /**
135
+ * Message to display when the chat is automatically closed.
136
+ */
137
+ auto_close_message?: string | null;
138
+
139
+ /**
140
+ * Controls what data is stored for this agent. "everything" stores all data
141
+ * including transcripts and recordings. "everything_except_pii" stores data but
142
+ * excludes PII when possible based on PII configuration. "basic_attributes_only"
143
+ * stores only basic metadata. If not set, defaults to "everything".
144
+ */
145
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
146
+
147
+ /**
148
+ * If users stay silent for a period after agent speech, end the chat. The minimum
149
+ * value allowed is 360,000 ms (0.1 hours). The maximum value allowed is
150
+ * 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
151
+ */
152
+ end_chat_after_silence_ms?: number;
153
+
154
+ /**
155
+ * Whether the chat agent is published.
156
+ */
157
+ is_published?: boolean;
158
+
159
+ /**
160
+ * Specifies what language (and dialect) the chat will operate in. For instance,
161
+ * selecting `en-GB` optimizes for British English. If unset, will use default
162
+ * value `en-US`. Select `multi` for multilingual support, currently this supports
163
+ * Spanish and English.
164
+ */
165
+ language?:
166
+ | 'en-US'
167
+ | 'en-IN'
168
+ | 'en-GB'
169
+ | 'en-AU'
170
+ | 'en-NZ'
171
+ | 'de-DE'
172
+ | 'es-ES'
173
+ | 'es-419'
174
+ | 'hi-IN'
175
+ | 'fr-FR'
176
+ | 'fr-CA'
177
+ | 'ja-JP'
178
+ | 'pt-PT'
179
+ | 'pt-BR'
180
+ | 'zh-CN'
181
+ | 'ru-RU'
182
+ | 'it-IT'
183
+ | 'ko-KR'
184
+ | 'nl-NL'
185
+ | 'nl-BE'
186
+ | 'pl-PL'
187
+ | 'tr-TR'
188
+ | 'th-TH'
189
+ | 'vi-VN'
190
+ | 'ro-RO'
191
+ | 'bg-BG'
192
+ | 'ca-ES'
193
+ | 'da-DK'
194
+ | 'fi-FI'
195
+ | 'el-GR'
196
+ | 'hu-HU'
197
+ | 'id-ID'
198
+ | 'no-NO'
199
+ | 'sk-SK'
200
+ | 'sv-SE'
201
+ | 'multi';
202
+
203
+ /**
204
+ * Whether this agent opts in to signed url for public log. If not set, default
205
+ * value of false will apply.
206
+ */
207
+ opt_in_signed_url?: boolean;
208
+
209
+ /**
210
+ * Configuration for PII scrubbing from transcripts and recordings.
211
+ */
212
+ pii_config?: ChatAgentResponse.PiiConfig;
213
+
214
+ /**
215
+ * Post chat analysis data to extract from the chat. This data will augment the
216
+ * pre-defined variables extracted in the chat analysis. This will be available
217
+ * after the chat ends.
218
+ */
219
+ post_chat_analysis_data?: Array<
220
+ | ChatAgentResponse.StringAnalysisData
221
+ | ChatAgentResponse.EnumAnalysisData
222
+ | ChatAgentResponse.BooleanAnalysisData
223
+ | ChatAgentResponse.NumberAnalysisData
224
+ > | null;
225
+
226
+ /**
227
+ * The model to use for post chat analysis. Default to gpt-4.1-mini.
228
+ */
229
+ post_chat_analysis_model?:
230
+ | 'gpt-4o'
231
+ | 'gpt-4o-mini'
232
+ | 'gpt-4.1'
233
+ | 'gpt-4.1-mini'
234
+ | 'gpt-4.1-nano'
235
+ | 'gpt-5'
236
+ | 'gpt-5.1'
237
+ | 'gpt-5-mini'
238
+ | 'gpt-5-nano'
239
+ | 'claude-4.5-sonnet'
240
+ | 'claude-4.0-sonnet'
241
+ | 'claude-3.7-sonnet'
242
+ | 'claude-3.5-haiku'
243
+ | 'gemini-2.0-flash'
244
+ | 'gemini-2.0-flash-lite'
245
+ | 'gemini-2.5-flash'
246
+ | 'gemini-2.5-flash-lite';
247
+
248
+ /**
249
+ * The version of the chat agent.
250
+ */
251
+ version?: number;
252
+
253
+ /**
254
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
255
+ * will apply.
256
+ */
257
+ webhook_timeout_ms?: number;
258
+
259
+ /**
260
+ * The webhook for agent to listen to chat events. See what events it would get at
261
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
262
+ * agent to the specified url, and will ignore the account level webhook for this
263
+ * agent. Set to `null` to remove webhook url from this agent.
264
+ */
265
+ webhook_url?: string | null;
266
+ }
267
+
268
+ export namespace ChatAgentResponse {
269
+ export interface ResponseEngineRetellLm {
270
+ /**
271
+ * id of the Retell LLM Response Engine.
272
+ */
273
+ llm_id: string;
274
+
275
+ /**
276
+ * type of the Response Engine.
277
+ */
278
+ type: 'retell-llm';
279
+
280
+ /**
281
+ * Version of the Retell LLM Response Engine.
282
+ */
283
+ version?: number | null;
284
+ }
285
+
286
+ export interface ResponseEngineCustomLm {
287
+ /**
288
+ * LLM websocket url of the custom LLM.
289
+ */
290
+ llm_websocket_url: string;
291
+
292
+ /**
293
+ * type of the Response Engine.
294
+ */
295
+ type: 'custom-llm';
296
+ }
297
+
298
+ export interface ResponseEngineConversationFlow {
299
+ /**
300
+ * ID of the Conversation Flow Response Engine.
301
+ */
302
+ conversation_flow_id: string;
303
+
304
+ /**
305
+ * type of the Response Engine.
306
+ */
307
+ type: 'conversation-flow';
308
+
309
+ /**
310
+ * Version of the Conversation Flow Response Engine.
311
+ */
312
+ version?: number | null;
313
+ }
314
+
315
+ /**
316
+ * Configuration for PII scrubbing from transcripts and recordings.
317
+ */
318
+ export interface PiiConfig {
319
+ /**
320
+ * List of PII categories to scrub from transcripts and recordings.
321
+ */
322
+ categories: Array<
323
+ | 'person_name'
324
+ | 'address'
325
+ | 'email'
326
+ | 'phone_number'
327
+ | 'ssn'
328
+ | 'passport'
329
+ | 'driver_license'
330
+ | 'credit_card'
331
+ | 'bank_account'
332
+ | 'password'
333
+ | 'pin'
334
+ | 'medical_id'
335
+ | 'date_of_birth'
336
+ >;
337
+
338
+ /**
339
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
340
+ */
341
+ mode: 'post_call';
342
+ }
343
+
344
+ export interface StringAnalysisData {
345
+ /**
346
+ * Description of the variable.
347
+ */
348
+ description: string;
349
+
350
+ /**
351
+ * Name of the variable.
352
+ */
353
+ name: string;
354
+
355
+ /**
356
+ * Type of the variable to extract.
357
+ */
358
+ type: 'string';
359
+
360
+ /**
361
+ * Examples of the variable value to teach model the style and syntax.
362
+ */
363
+ examples?: Array<string>;
364
+ }
365
+
366
+ export interface EnumAnalysisData {
367
+ /**
368
+ * The possible values of the variable, must be non empty array.
369
+ */
370
+ choices: Array<string>;
371
+
372
+ /**
373
+ * Description of the variable.
374
+ */
375
+ description: string;
376
+
377
+ /**
378
+ * Name of the variable.
379
+ */
380
+ name: string;
381
+
382
+ /**
383
+ * Type of the variable to extract.
384
+ */
385
+ type: 'enum';
386
+ }
387
+
388
+ export interface BooleanAnalysisData {
389
+ /**
390
+ * Description of the variable.
391
+ */
392
+ description: string;
393
+
394
+ /**
395
+ * Name of the variable.
396
+ */
397
+ name: string;
398
+
399
+ /**
400
+ * Type of the variable to extract.
401
+ */
402
+ type: 'boolean';
403
+ }
404
+
405
+ export interface NumberAnalysisData {
406
+ /**
407
+ * Description of the variable.
408
+ */
409
+ description: string;
410
+
411
+ /**
412
+ * Name of the variable.
413
+ */
414
+ name: string;
415
+
416
+ /**
417
+ * Type of the variable to extract.
418
+ */
419
+ type: 'number';
420
+ }
421
+ }
422
+
423
+ export type ChatAgentListResponse = Array<ChatAgentResponse>;
424
+
425
+ export type ChatAgentGetVersionsResponse = Array<ChatAgentResponse>;
426
+
427
+ export interface ChatAgentCreateParams {
428
+ /**
429
+ * The Response Engine to attach to the agent. It is used to generate responses for
430
+ * the agent. You need to create a Response Engine first before attaching it to an
431
+ * agent.
432
+ */
433
+ response_engine:
434
+ | ChatAgentCreateParams.ResponseEngineRetellLm
435
+ | ChatAgentCreateParams.ResponseEngineCustomLm
436
+ | ChatAgentCreateParams.ResponseEngineConversationFlow;
437
+
438
+ /**
439
+ * The name of the chat agent. Only used for your own reference.
440
+ */
441
+ agent_name?: string | null;
442
+
443
+ /**
444
+ * Message to display when the chat is automatically closed.
445
+ */
446
+ auto_close_message?: string | null;
447
+
448
+ /**
449
+ * Controls what data is stored for this agent. "everything" stores all data
450
+ * including transcripts and recordings. "everything_except_pii" stores data but
451
+ * excludes PII when possible based on PII configuration. "basic_attributes_only"
452
+ * stores only basic metadata. If not set, defaults to "everything".
453
+ */
454
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
455
+
456
+ /**
457
+ * If users stay silent for a period after agent speech, end the chat. The minimum
458
+ * value allowed is 360,000 ms (0.1 hours). The maximum value allowed is
459
+ * 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
460
+ */
461
+ end_chat_after_silence_ms?: number;
462
+
463
+ /**
464
+ * Specifies what language (and dialect) the chat will operate in. For instance,
465
+ * selecting `en-GB` optimizes for British English. If unset, will use default
466
+ * value `en-US`. Select `multi` for multilingual support, currently this supports
467
+ * Spanish and English.
468
+ */
469
+ language?:
470
+ | 'en-US'
471
+ | 'en-IN'
472
+ | 'en-GB'
473
+ | 'en-AU'
474
+ | 'en-NZ'
475
+ | 'de-DE'
476
+ | 'es-ES'
477
+ | 'es-419'
478
+ | 'hi-IN'
479
+ | 'fr-FR'
480
+ | 'fr-CA'
481
+ | 'ja-JP'
482
+ | 'pt-PT'
483
+ | 'pt-BR'
484
+ | 'zh-CN'
485
+ | 'ru-RU'
486
+ | 'it-IT'
487
+ | 'ko-KR'
488
+ | 'nl-NL'
489
+ | 'nl-BE'
490
+ | 'pl-PL'
491
+ | 'tr-TR'
492
+ | 'th-TH'
493
+ | 'vi-VN'
494
+ | 'ro-RO'
495
+ | 'bg-BG'
496
+ | 'ca-ES'
497
+ | 'da-DK'
498
+ | 'fi-FI'
499
+ | 'el-GR'
500
+ | 'hu-HU'
501
+ | 'id-ID'
502
+ | 'no-NO'
503
+ | 'sk-SK'
504
+ | 'sv-SE'
505
+ | 'multi';
506
+
507
+ /**
508
+ * Whether this agent opts in to signed url for public log. If not set, default
509
+ * value of false will apply.
510
+ */
511
+ opt_in_signed_url?: boolean;
512
+
513
+ /**
514
+ * Configuration for PII scrubbing from transcripts and recordings.
515
+ */
516
+ pii_config?: ChatAgentCreateParams.PiiConfig;
517
+
518
+ /**
519
+ * Post chat analysis data to extract from the chat. This data will augment the
520
+ * pre-defined variables extracted in the chat analysis. This will be available
521
+ * after the chat ends.
522
+ */
523
+ post_chat_analysis_data?: Array<
524
+ | ChatAgentCreateParams.StringAnalysisData
525
+ | ChatAgentCreateParams.EnumAnalysisData
526
+ | ChatAgentCreateParams.BooleanAnalysisData
527
+ | ChatAgentCreateParams.NumberAnalysisData
528
+ > | null;
529
+
530
+ /**
531
+ * The model to use for post chat analysis. Default to gpt-4.1-mini.
532
+ */
533
+ post_chat_analysis_model?:
534
+ | 'gpt-4o'
535
+ | 'gpt-4o-mini'
536
+ | 'gpt-4.1'
537
+ | 'gpt-4.1-mini'
538
+ | 'gpt-4.1-nano'
539
+ | 'gpt-5'
540
+ | 'gpt-5.1'
541
+ | 'gpt-5-mini'
542
+ | 'gpt-5-nano'
543
+ | 'claude-4.5-sonnet'
544
+ | 'claude-4.0-sonnet'
545
+ | 'claude-3.7-sonnet'
546
+ | 'claude-3.5-haiku'
547
+ | 'gemini-2.0-flash'
548
+ | 'gemini-2.0-flash-lite'
549
+ | 'gemini-2.5-flash'
550
+ | 'gemini-2.5-flash-lite';
551
+
552
+ /**
553
+ * The timeout for the webhook in milliseconds. If not set, default value of 10000
554
+ * will apply.
555
+ */
556
+ webhook_timeout_ms?: number;
557
+
558
+ /**
559
+ * The webhook for agent to listen to chat events. See what events it would get at
560
+ * [webhook doc](/features/webhook). If set, will binds webhook events for this
561
+ * agent to the specified url, and will ignore the account level webhook for this
562
+ * agent. Set to `null` to remove webhook url from this agent.
563
+ */
564
+ webhook_url?: string | null;
565
+ }
566
+
567
+ export namespace ChatAgentCreateParams {
568
+ export interface ResponseEngineRetellLm {
569
+ /**
570
+ * id of the Retell LLM Response Engine.
571
+ */
572
+ llm_id: string;
573
+
574
+ /**
575
+ * type of the Response Engine.
576
+ */
577
+ type: 'retell-llm';
578
+
579
+ /**
580
+ * Version of the Retell LLM Response Engine.
581
+ */
582
+ version?: number | null;
583
+ }
584
+
585
+ export interface ResponseEngineCustomLm {
586
+ /**
587
+ * LLM websocket url of the custom LLM.
588
+ */
589
+ llm_websocket_url: string;
590
+
591
+ /**
592
+ * type of the Response Engine.
593
+ */
594
+ type: 'custom-llm';
595
+ }
596
+
597
+ export interface ResponseEngineConversationFlow {
598
+ /**
599
+ * ID of the Conversation Flow Response Engine.
600
+ */
601
+ conversation_flow_id: string;
602
+
603
+ /**
604
+ * type of the Response Engine.
605
+ */
606
+ type: 'conversation-flow';
607
+
608
+ /**
609
+ * Version of the Conversation Flow Response Engine.
610
+ */
611
+ version?: number | null;
612
+ }
613
+
614
+ /**
615
+ * Configuration for PII scrubbing from transcripts and recordings.
616
+ */
617
+ export interface PiiConfig {
618
+ /**
619
+ * List of PII categories to scrub from transcripts and recordings.
620
+ */
621
+ categories: Array<
622
+ | 'person_name'
623
+ | 'address'
624
+ | 'email'
625
+ | 'phone_number'
626
+ | 'ssn'
627
+ | 'passport'
628
+ | 'driver_license'
629
+ | 'credit_card'
630
+ | 'bank_account'
631
+ | 'password'
632
+ | 'pin'
633
+ | 'medical_id'
634
+ | 'date_of_birth'
635
+ >;
636
+
637
+ /**
638
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
639
+ */
640
+ mode: 'post_call';
641
+ }
642
+
643
+ export interface StringAnalysisData {
644
+ /**
645
+ * Description of the variable.
646
+ */
647
+ description: string;
648
+
649
+ /**
650
+ * Name of the variable.
651
+ */
652
+ name: string;
653
+
654
+ /**
655
+ * Type of the variable to extract.
656
+ */
657
+ type: 'string';
658
+
659
+ /**
660
+ * Examples of the variable value to teach model the style and syntax.
661
+ */
662
+ examples?: Array<string>;
663
+ }
664
+
665
+ export interface EnumAnalysisData {
666
+ /**
667
+ * The possible values of the variable, must be non empty array.
668
+ */
669
+ choices: Array<string>;
670
+
671
+ /**
672
+ * Description of the variable.
673
+ */
674
+ description: string;
675
+
676
+ /**
677
+ * Name of the variable.
678
+ */
679
+ name: string;
680
+
681
+ /**
682
+ * Type of the variable to extract.
683
+ */
684
+ type: 'enum';
685
+ }
686
+
687
+ export interface BooleanAnalysisData {
688
+ /**
689
+ * Description of the variable.
690
+ */
691
+ description: string;
692
+
693
+ /**
694
+ * Name of the variable.
695
+ */
696
+ name: string;
697
+
698
+ /**
699
+ * Type of the variable to extract.
700
+ */
701
+ type: 'boolean';
702
+ }
703
+
704
+ export interface NumberAnalysisData {
705
+ /**
706
+ * Description of the variable.
707
+ */
708
+ description: string;
709
+
710
+ /**
711
+ * Name of the variable.
712
+ */
713
+ name: string;
714
+
715
+ /**
716
+ * Type of the variable to extract.
717
+ */
718
+ type: 'number';
719
+ }
720
+ }
721
+
722
+ export interface ChatAgentRetrieveParams {
723
+ /**
724
+ * Optional version of the API to use for this request. If not provided, will
725
+ * default to latest version.
726
+ */
727
+ version?: number;
728
+ }
729
+
730
+ export interface ChatAgentUpdateParams {
731
+ /**
732
+ * Query param: Optional version of the API to use for this request. Default to
733
+ * latest version.
734
+ */
735
+ version?: number;
736
+
737
+ /**
738
+ * Body param: The name of the chat agent. Only used for your own reference.
739
+ */
740
+ agent_name?: string | null;
741
+
742
+ /**
743
+ * Body param: Message to display when the chat is automatically closed.
744
+ */
745
+ auto_close_message?: string | null;
746
+
747
+ /**
748
+ * Body param: Controls what data is stored for this agent. "everything" stores all
749
+ * data including transcripts and recordings. "everything_except_pii" stores data
750
+ * but excludes PII when possible based on PII configuration.
751
+ * "basic_attributes_only" stores only basic metadata. If not set, defaults to
752
+ * "everything".
753
+ */
754
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
755
+
756
+ /**
757
+ * Body param: If users stay silent for a period after agent speech, end the chat.
758
+ * The minimum value allowed is 360,000 ms (0.1 hours). The maximum value allowed
759
+ * is 259,200,000 ms (72 hours). By default, this is set to 3,600,000 (1 hour).
760
+ */
761
+ end_chat_after_silence_ms?: number;
762
+
763
+ /**
764
+ * Body param: Specifies what language (and dialect) the chat will operate in. For
765
+ * instance, selecting `en-GB` optimizes for British English. If unset, will use
766
+ * default value `en-US`. Select `multi` for multilingual support, currently this
767
+ * supports Spanish and English.
768
+ */
769
+ language?:
770
+ | 'en-US'
771
+ | 'en-IN'
772
+ | 'en-GB'
773
+ | 'en-AU'
774
+ | 'en-NZ'
775
+ | 'de-DE'
776
+ | 'es-ES'
777
+ | 'es-419'
778
+ | 'hi-IN'
779
+ | 'fr-FR'
780
+ | 'fr-CA'
781
+ | 'ja-JP'
782
+ | 'pt-PT'
783
+ | 'pt-BR'
784
+ | 'zh-CN'
785
+ | 'ru-RU'
786
+ | 'it-IT'
787
+ | 'ko-KR'
788
+ | 'nl-NL'
789
+ | 'nl-BE'
790
+ | 'pl-PL'
791
+ | 'tr-TR'
792
+ | 'th-TH'
793
+ | 'vi-VN'
794
+ | 'ro-RO'
795
+ | 'bg-BG'
796
+ | 'ca-ES'
797
+ | 'da-DK'
798
+ | 'fi-FI'
799
+ | 'el-GR'
800
+ | 'hu-HU'
801
+ | 'id-ID'
802
+ | 'no-NO'
803
+ | 'sk-SK'
804
+ | 'sv-SE'
805
+ | 'multi';
806
+
807
+ /**
808
+ * Body param: Whether this agent opts in to signed url for public log. If not set,
809
+ * default value of false will apply.
810
+ */
811
+ opt_in_signed_url?: boolean;
812
+
813
+ /**
814
+ * Body param: Configuration for PII scrubbing from transcripts and recordings.
815
+ */
816
+ pii_config?: ChatAgentUpdateParams.PiiConfig;
817
+
818
+ /**
819
+ * Body param: Post chat analysis data to extract from the chat. This data will
820
+ * augment the pre-defined variables extracted in the chat analysis. This will be
821
+ * available after the chat ends.
822
+ */
823
+ post_chat_analysis_data?: Array<
824
+ | ChatAgentUpdateParams.StringAnalysisData
825
+ | ChatAgentUpdateParams.EnumAnalysisData
826
+ | ChatAgentUpdateParams.BooleanAnalysisData
827
+ | ChatAgentUpdateParams.NumberAnalysisData
828
+ > | null;
829
+
830
+ /**
831
+ * Body param: The model to use for post chat analysis. Default to gpt-4.1-mini.
832
+ */
833
+ post_chat_analysis_model?:
834
+ | 'gpt-4o'
835
+ | 'gpt-4o-mini'
836
+ | 'gpt-4.1'
837
+ | 'gpt-4.1-mini'
838
+ | 'gpt-4.1-nano'
839
+ | 'gpt-5'
840
+ | 'gpt-5.1'
841
+ | 'gpt-5-mini'
842
+ | 'gpt-5-nano'
843
+ | 'claude-4.5-sonnet'
844
+ | 'claude-4.0-sonnet'
845
+ | 'claude-3.7-sonnet'
846
+ | 'claude-3.5-haiku'
847
+ | 'gemini-2.0-flash'
848
+ | 'gemini-2.0-flash-lite'
849
+ | 'gemini-2.5-flash'
850
+ | 'gemini-2.5-flash-lite';
851
+
852
+ /**
853
+ * Body param: The Response Engine to attach to the agent. It is used to generate
854
+ * responses for the agent. You need to create a Response Engine first before
855
+ * attaching it to an agent.
856
+ */
857
+ response_engine?:
858
+ | ChatAgentUpdateParams.ResponseEngineRetellLm
859
+ | ChatAgentUpdateParams.ResponseEngineCustomLm
860
+ | ChatAgentUpdateParams.ResponseEngineConversationFlow;
861
+
862
+ /**
863
+ * Body param: The timeout for the webhook in milliseconds. If not set, default
864
+ * value of 10000 will apply.
865
+ */
866
+ webhook_timeout_ms?: number;
867
+
868
+ /**
869
+ * Body param: The webhook for agent to listen to chat events. See what events it
870
+ * would get at [webhook doc](/features/webhook). If set, will binds webhook events
871
+ * for this agent to the specified url, and will ignore the account level webhook
872
+ * for this agent. Set to `null` to remove webhook url from this agent.
873
+ */
874
+ webhook_url?: string | null;
875
+ }
876
+
877
+ export namespace ChatAgentUpdateParams {
878
+ /**
879
+ * Configuration for PII scrubbing from transcripts and recordings.
880
+ */
881
+ export interface PiiConfig {
882
+ /**
883
+ * List of PII categories to scrub from transcripts and recordings.
884
+ */
885
+ categories: Array<
886
+ | 'person_name'
887
+ | 'address'
888
+ | 'email'
889
+ | 'phone_number'
890
+ | 'ssn'
891
+ | 'passport'
892
+ | 'driver_license'
893
+ | 'credit_card'
894
+ | 'bank_account'
895
+ | 'password'
896
+ | 'pin'
897
+ | 'medical_id'
898
+ | 'date_of_birth'
899
+ >;
900
+
901
+ /**
902
+ * The processing mode for PII scrubbing. Currently only post-call is supported.
903
+ */
904
+ mode: 'post_call';
905
+ }
906
+
907
+ export interface StringAnalysisData {
908
+ /**
909
+ * Description of the variable.
910
+ */
911
+ description: string;
912
+
913
+ /**
914
+ * Name of the variable.
915
+ */
916
+ name: string;
917
+
918
+ /**
919
+ * Type of the variable to extract.
920
+ */
921
+ type: 'string';
922
+
923
+ /**
924
+ * Examples of the variable value to teach model the style and syntax.
925
+ */
926
+ examples?: Array<string>;
927
+ }
928
+
929
+ export interface EnumAnalysisData {
930
+ /**
931
+ * The possible values of the variable, must be non empty array.
932
+ */
933
+ choices: Array<string>;
934
+
935
+ /**
936
+ * Description of the variable.
937
+ */
938
+ description: string;
939
+
940
+ /**
941
+ * Name of the variable.
942
+ */
943
+ name: string;
944
+
945
+ /**
946
+ * Type of the variable to extract.
947
+ */
948
+ type: 'enum';
949
+ }
950
+
951
+ export interface BooleanAnalysisData {
952
+ /**
953
+ * Description of the variable.
954
+ */
955
+ description: string;
956
+
957
+ /**
958
+ * Name of the variable.
959
+ */
960
+ name: string;
961
+
962
+ /**
963
+ * Type of the variable to extract.
964
+ */
965
+ type: 'boolean';
966
+ }
967
+
968
+ export interface NumberAnalysisData {
969
+ /**
970
+ * Description of the variable.
971
+ */
972
+ description: string;
973
+
974
+ /**
975
+ * Name of the variable.
976
+ */
977
+ name: string;
978
+
979
+ /**
980
+ * Type of the variable to extract.
981
+ */
982
+ type: 'number';
983
+ }
984
+
985
+ export interface ResponseEngineRetellLm {
986
+ /**
987
+ * id of the Retell LLM Response Engine.
988
+ */
989
+ llm_id: string;
990
+
991
+ /**
992
+ * type of the Response Engine.
993
+ */
994
+ type: 'retell-llm';
995
+
996
+ /**
997
+ * Version of the Retell LLM Response Engine.
998
+ */
999
+ version?: number | null;
1000
+ }
1001
+
1002
+ export interface ResponseEngineCustomLm {
1003
+ /**
1004
+ * LLM websocket url of the custom LLM.
1005
+ */
1006
+ llm_websocket_url: string;
1007
+
1008
+ /**
1009
+ * type of the Response Engine.
1010
+ */
1011
+ type: 'custom-llm';
1012
+ }
1013
+
1014
+ export interface ResponseEngineConversationFlow {
1015
+ /**
1016
+ * ID of the Conversation Flow Response Engine.
1017
+ */
1018
+ conversation_flow_id: string;
1019
+
1020
+ /**
1021
+ * type of the Response Engine.
1022
+ */
1023
+ type: 'conversation-flow';
1024
+
1025
+ /**
1026
+ * Version of the Conversation Flow Response Engine.
1027
+ */
1028
+ version?: number | null;
1029
+ }
1030
+ }
1031
+
1032
+ export interface ChatAgentListParams {
1033
+ /**
1034
+ * A limit on the number of objects to be returned. Limit can range between 1 and
1035
+ * 1000, and the default is 1000.
1036
+ */
1037
+ limit?: number;
1038
+
1039
+ /**
1040
+ * The pagination key to continue fetching the next page of agents. Pagination key
1041
+ * is represented by a agent id, pagination key and version pair is exclusive (not
1042
+ * included in the fetched page). If not set, will start from the beginning.
1043
+ */
1044
+ pagination_key?: string;
1045
+
1046
+ /**
1047
+ * Specifies the version of the agent associated with the pagination_key. When
1048
+ * paginating, both the pagination_key and its version must be provided to ensure
1049
+ * consistent ordering and to fetch the next page correctly.
1050
+ */
1051
+ pagination_key_version?: number;
1052
+ }
1053
+
1054
+ export declare namespace ChatAgent {
1055
+ export {
1056
+ type ChatAgentResponse as ChatAgentResponse,
1057
+ type ChatAgentListResponse as ChatAgentListResponse,
1058
+ type ChatAgentGetVersionsResponse as ChatAgentGetVersionsResponse,
1059
+ type ChatAgentCreateParams as ChatAgentCreateParams,
1060
+ type ChatAgentRetrieveParams as ChatAgentRetrieveParams,
1061
+ type ChatAgentUpdateParams as ChatAgentUpdateParams,
1062
+ type ChatAgentListParams as ChatAgentListParams,
1063
+ };
1064
+ }