retell-sdk 5.11.0 → 5.13.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 (76) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +6 -3
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -3
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -3
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/env.js +2 -2
  12. package/internal/utils/env.js.map +1 -1
  13. package/internal/utils/env.mjs +2 -2
  14. package/internal/utils/env.mjs.map +1 -1
  15. package/package.json +1 -1
  16. package/resources/agent.d.mts +22 -45
  17. package/resources/agent.d.mts.map +1 -1
  18. package/resources/agent.d.ts +22 -45
  19. package/resources/agent.d.ts.map +1 -1
  20. package/resources/batch-call.d.mts +8 -17
  21. package/resources/batch-call.d.mts.map +1 -1
  22. package/resources/batch-call.d.ts +8 -17
  23. package/resources/batch-call.d.ts.map +1 -1
  24. package/resources/call.d.mts +55 -54
  25. package/resources/call.d.mts.map +1 -1
  26. package/resources/call.d.ts +55 -54
  27. package/resources/call.d.ts.map +1 -1
  28. package/resources/chat-agent.d.mts +10 -6
  29. package/resources/chat-agent.d.mts.map +1 -1
  30. package/resources/chat-agent.d.ts +10 -6
  31. package/resources/chat-agent.d.ts.map +1 -1
  32. package/resources/chat.d.mts +90 -76
  33. package/resources/chat.d.mts.map +1 -1
  34. package/resources/chat.d.ts +90 -76
  35. package/resources/chat.d.ts.map +1 -1
  36. package/resources/conversation-flow-component.d.mts +207 -48
  37. package/resources/conversation-flow-component.d.mts.map +1 -1
  38. package/resources/conversation-flow-component.d.ts +207 -48
  39. package/resources/conversation-flow-component.d.ts.map +1 -1
  40. package/resources/conversation-flow.d.mts +417 -99
  41. package/resources/conversation-flow.d.mts.map +1 -1
  42. package/resources/conversation-flow.d.ts +417 -99
  43. package/resources/conversation-flow.d.ts.map +1 -1
  44. package/resources/llm.d.mts +153 -9
  45. package/resources/llm.d.mts.map +1 -1
  46. package/resources/llm.d.ts +153 -9
  47. package/resources/llm.d.ts.map +1 -1
  48. package/resources/phone-number.d.mts +22 -125
  49. package/resources/phone-number.d.mts.map +1 -1
  50. package/resources/phone-number.d.ts +22 -125
  51. package/resources/phone-number.d.ts.map +1 -1
  52. package/resources/phone-number.js +14 -2
  53. package/resources/phone-number.js.map +1 -1
  54. package/resources/phone-number.mjs +14 -2
  55. package/resources/phone-number.mjs.map +1 -1
  56. package/resources/tests.d.mts +4 -8
  57. package/resources/tests.d.mts.map +1 -1
  58. package/resources/tests.d.ts +4 -8
  59. package/resources/tests.d.ts.map +1 -1
  60. package/src/client.ts +11 -4
  61. package/src/internal/utils/env.ts +2 -2
  62. package/src/resources/agent.ts +23 -42
  63. package/src/resources/batch-call.ts +9 -15
  64. package/src/resources/call.ts +64 -47
  65. package/src/resources/chat-agent.ts +11 -3
  66. package/src/resources/chat.ts +106 -90
  67. package/src/resources/conversation-flow-component.ts +300 -48
  68. package/src/resources/conversation-flow.ts +606 -99
  69. package/src/resources/llm.ts +201 -6
  70. package/src/resources/phone-number.ts +22 -141
  71. package/src/resources/tests.ts +7 -9
  72. package/src/version.ts +1 -1
  73. package/version.d.mts +1 -1
  74. package/version.d.ts +1 -1
  75. package/version.js +1 -1
  76. package/version.mjs +1 -1
@@ -187,11 +187,11 @@ export interface ChatResponse {
187
187
  * Transcript of the chat weaved with tool call invocation and results.
188
188
  */
189
189
  message_with_tool_calls?: Array<
190
- | ChatResponse.Message
191
- | ChatResponse.ToolCallInvocationMessage
192
- | ChatResponse.ToolCallResultMessage
193
- | ChatResponse.NodeTransitionMessage
194
- | ChatResponse.StateTransitionMessage
190
+ | ChatResponse.MessageBase
191
+ | ChatResponse.ToolCallInvocationMessageBase
192
+ | ChatResponse.ToolCallResultMessageBase
193
+ | ChatResponse.NodeTransitionMessageBase
194
+ | ChatResponse.StateTransitionMessageBase
195
195
  >;
196
196
 
197
197
  /**
@@ -291,39 +291,34 @@ export namespace ChatResponse {
291
291
  }
292
292
  }
293
293
 
294
- export interface Message {
294
+ export interface MessageBase {
295
295
  /**
296
296
  * Content of the message
297
297
  */
298
298
  content: string;
299
299
 
300
300
  /**
301
- * Create timestamp of the message
301
+ * Documents whether this message is sent by agent or user.
302
302
  */
303
- created_timestamp: number;
303
+ role: 'agent' | 'user';
304
304
 
305
305
  /**
306
- * Unique id of the message
306
+ * Create timestamp of the message
307
307
  */
308
- message_id: string;
308
+ created_timestamp?: number;
309
309
 
310
310
  /**
311
- * Documents whether this message is sent by agent or user.
311
+ * Unique id of the message
312
312
  */
313
- role: 'agent' | 'user';
313
+ message_id?: string;
314
314
  }
315
315
 
316
- export interface ToolCallInvocationMessage {
316
+ export interface ToolCallInvocationMessageBase {
317
317
  /**
318
318
  * Arguments for this tool call, it's a stringified JSON object.
319
319
  */
320
320
  arguments: string;
321
321
 
322
- /**
323
- * Unique id of the message
324
- */
325
- message_id: string;
326
-
327
322
  /**
328
323
  * Name of the function in this tool call.
329
324
  */
@@ -344,6 +339,11 @@ export namespace ChatResponse {
344
339
  */
345
340
  created_timestamp?: number;
346
341
 
342
+ /**
343
+ * Unique id of the message
344
+ */
345
+ message_id?: string;
346
+
347
347
  /**
348
348
  * Optional thought signature from Google Gemini thinking models. This is used
349
349
  * internally to maintain reasoning chain in multi-turn function calling.
@@ -351,22 +351,12 @@ export namespace ChatResponse {
351
351
  thought_signature?: string;
352
352
  }
353
353
 
354
- export interface ToolCallResultMessage {
354
+ export interface ToolCallResultMessageBase {
355
355
  /**
356
356
  * Result of the tool call, can be a string, a stringified json, etc.
357
357
  */
358
358
  content: string;
359
359
 
360
- /**
361
- * Create timestamp of the message
362
- */
363
- created_timestamp: number;
364
-
365
- /**
366
- * Unique id of the message
367
- */
368
- message_id: string;
369
-
370
360
  /**
371
361
  * This is the result of a tool call.
372
362
  */
@@ -378,27 +368,32 @@ export namespace ChatResponse {
378
368
  tool_call_id: string;
379
369
 
380
370
  /**
381
- * Whether the tool call was successful.
371
+ * Create timestamp of the message
382
372
  */
383
- successful?: boolean;
384
- }
373
+ created_timestamp?: number;
385
374
 
386
- export interface NodeTransitionMessage {
387
375
  /**
388
- * Create timestamp of the message
376
+ * Unique id of the message
389
377
  */
390
- created_timestamp: number;
378
+ message_id?: string;
391
379
 
392
380
  /**
393
- * Unique id of the message
381
+ * Whether the tool call was successful.
394
382
  */
395
- message_id: string;
383
+ successful?: boolean;
384
+ }
396
385
 
386
+ export interface NodeTransitionMessageBase {
397
387
  /**
398
388
  * This is a node transition.
399
389
  */
400
390
  role: 'node_transition';
401
391
 
392
+ /**
393
+ * Create timestamp of the message
394
+ */
395
+ created_timestamp?: number;
396
+
402
397
  /**
403
398
  * Former node id
404
399
  */
@@ -409,6 +404,11 @@ export namespace ChatResponse {
409
404
  */
410
405
  former_node_name?: string;
411
406
 
407
+ /**
408
+ * Unique id of the message
409
+ */
410
+ message_id?: string;
411
+
412
412
  /**
413
413
  * New node id
414
414
  */
@@ -418,29 +418,37 @@ export namespace ChatResponse {
418
418
  * New node name
419
419
  */
420
420
  new_node_name?: string;
421
- }
422
421
 
423
- export interface StateTransitionMessage {
424
422
  /**
425
- * Create timestamp of the message
423
+ * How this node was reached. "global" means a global node transition,
424
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
425
+ * going back due to user interruption, and "normal" means a regular edge
426
+ * transition.
426
427
  */
427
- created_timestamp: number;
428
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
429
+ }
428
430
 
431
+ export interface StateTransitionMessageBase {
429
432
  /**
430
- * Unique id of the message
433
+ * This is a state transition.
431
434
  */
432
- message_id: string;
435
+ role: 'state_transition';
433
436
 
434
437
  /**
435
- * This is a state transition.
438
+ * Create timestamp of the message
436
439
  */
437
- role: 'state_transition';
440
+ created_timestamp?: number;
438
441
 
439
442
  /**
440
443
  * Former state name
441
444
  */
442
445
  former_state_name?: string;
443
446
 
447
+ /**
448
+ * Unique id of the message
449
+ */
450
+ message_id?: string;
451
+
444
452
  /**
445
453
  * New state name
446
454
  */
@@ -457,48 +465,43 @@ export interface ChatCreateChatCompletionResponse {
457
465
  * messages.
458
466
  */
459
467
  messages: Array<
460
- | ChatCreateChatCompletionResponse.Message
461
- | ChatCreateChatCompletionResponse.ToolCallInvocationMessage
462
- | ChatCreateChatCompletionResponse.ToolCallResultMessage
463
- | ChatCreateChatCompletionResponse.NodeTransitionMessage
464
- | ChatCreateChatCompletionResponse.StateTransitionMessage
468
+ | ChatCreateChatCompletionResponse.MessageBase
469
+ | ChatCreateChatCompletionResponse.ToolCallInvocationMessageBase
470
+ | ChatCreateChatCompletionResponse.ToolCallResultMessageBase
471
+ | ChatCreateChatCompletionResponse.NodeTransitionMessageBase
472
+ | ChatCreateChatCompletionResponse.StateTransitionMessageBase
465
473
  >;
466
474
  }
467
475
 
468
476
  export namespace ChatCreateChatCompletionResponse {
469
- export interface Message {
477
+ export interface MessageBase {
470
478
  /**
471
479
  * Content of the message
472
480
  */
473
481
  content: string;
474
482
 
475
483
  /**
476
- * Create timestamp of the message
484
+ * Documents whether this message is sent by agent or user.
477
485
  */
478
- created_timestamp: number;
486
+ role: 'agent' | 'user';
479
487
 
480
488
  /**
481
- * Unique id of the message
489
+ * Create timestamp of the message
482
490
  */
483
- message_id: string;
491
+ created_timestamp?: number;
484
492
 
485
493
  /**
486
- * Documents whether this message is sent by agent or user.
494
+ * Unique id of the message
487
495
  */
488
- role: 'agent' | 'user';
496
+ message_id?: string;
489
497
  }
490
498
 
491
- export interface ToolCallInvocationMessage {
499
+ export interface ToolCallInvocationMessageBase {
492
500
  /**
493
501
  * Arguments for this tool call, it's a stringified JSON object.
494
502
  */
495
503
  arguments: string;
496
504
 
497
- /**
498
- * Unique id of the message
499
- */
500
- message_id: string;
501
-
502
505
  /**
503
506
  * Name of the function in this tool call.
504
507
  */
@@ -519,6 +522,11 @@ export namespace ChatCreateChatCompletionResponse {
519
522
  */
520
523
  created_timestamp?: number;
521
524
 
525
+ /**
526
+ * Unique id of the message
527
+ */
528
+ message_id?: string;
529
+
522
530
  /**
523
531
  * Optional thought signature from Google Gemini thinking models. This is used
524
532
  * internally to maintain reasoning chain in multi-turn function calling.
@@ -526,22 +534,12 @@ export namespace ChatCreateChatCompletionResponse {
526
534
  thought_signature?: string;
527
535
  }
528
536
 
529
- export interface ToolCallResultMessage {
537
+ export interface ToolCallResultMessageBase {
530
538
  /**
531
539
  * Result of the tool call, can be a string, a stringified json, etc.
532
540
  */
533
541
  content: string;
534
542
 
535
- /**
536
- * Create timestamp of the message
537
- */
538
- created_timestamp: number;
539
-
540
- /**
541
- * Unique id of the message
542
- */
543
- message_id: string;
544
-
545
543
  /**
546
544
  * This is the result of a tool call.
547
545
  */
@@ -553,27 +551,32 @@ export namespace ChatCreateChatCompletionResponse {
553
551
  tool_call_id: string;
554
552
 
555
553
  /**
556
- * Whether the tool call was successful.
554
+ * Create timestamp of the message
557
555
  */
558
- successful?: boolean;
559
- }
556
+ created_timestamp?: number;
560
557
 
561
- export interface NodeTransitionMessage {
562
558
  /**
563
- * Create timestamp of the message
559
+ * Unique id of the message
564
560
  */
565
- created_timestamp: number;
561
+ message_id?: string;
566
562
 
567
563
  /**
568
- * Unique id of the message
564
+ * Whether the tool call was successful.
569
565
  */
570
- message_id: string;
566
+ successful?: boolean;
567
+ }
571
568
 
569
+ export interface NodeTransitionMessageBase {
572
570
  /**
573
571
  * This is a node transition.
574
572
  */
575
573
  role: 'node_transition';
576
574
 
575
+ /**
576
+ * Create timestamp of the message
577
+ */
578
+ created_timestamp?: number;
579
+
577
580
  /**
578
581
  * Former node id
579
582
  */
@@ -584,6 +587,11 @@ export namespace ChatCreateChatCompletionResponse {
584
587
  */
585
588
  former_node_name?: string;
586
589
 
590
+ /**
591
+ * Unique id of the message
592
+ */
593
+ message_id?: string;
594
+
587
595
  /**
588
596
  * New node id
589
597
  */
@@ -593,29 +601,37 @@ export namespace ChatCreateChatCompletionResponse {
593
601
  * New node name
594
602
  */
595
603
  new_node_name?: string;
596
- }
597
604
 
598
- export interface StateTransitionMessage {
599
605
  /**
600
- * Create timestamp of the message
606
+ * How this node was reached. "global" means a global node transition,
607
+ * "global_go_back" means returning from a global node, "interrupt_go_back" means
608
+ * going back due to user interruption, and "normal" means a regular edge
609
+ * transition.
601
610
  */
602
- created_timestamp: number;
611
+ transition_type?: 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal';
612
+ }
603
613
 
614
+ export interface StateTransitionMessageBase {
604
615
  /**
605
- * Unique id of the message
616
+ * This is a state transition.
606
617
  */
607
- message_id: string;
618
+ role: 'state_transition';
608
619
 
609
620
  /**
610
- * This is a state transition.
621
+ * Create timestamp of the message
611
622
  */
612
- role: 'state_transition';
623
+ created_timestamp?: number;
613
624
 
614
625
  /**
615
626
  * Former state name
616
627
  */
617
628
  former_state_name?: string;
618
629
 
630
+ /**
631
+ * Unique id of the message
632
+ */
633
+ message_id?: string;
634
+
619
635
  /**
620
636
  * New state name
621
637
  */