@roarkanalytics/sdk 5.24.0 → 6.0.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 (58) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/lib/config.d.mts +2 -0
  7. package/lib/config.d.mts.map +1 -1
  8. package/lib/config.d.ts +2 -0
  9. package/lib/config.d.ts.map +1 -1
  10. package/lib/config.js +7 -1
  11. package/lib/config.js.map +1 -1
  12. package/lib/config.mjs +5 -0
  13. package/lib/config.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/agent-draft.d.mts +701 -275
  16. package/resources/agent-draft.d.mts.map +1 -1
  17. package/resources/agent-draft.d.ts +701 -275
  18. package/resources/agent-draft.d.ts.map +1 -1
  19. package/resources/agent-draft.js +1 -1
  20. package/resources/agent-draft.js.map +1 -1
  21. package/resources/agent-draft.mjs +1 -1
  22. package/resources/agent-draft.mjs.map +1 -1
  23. package/resources/agent-version.d.mts +404 -168
  24. package/resources/agent-version.d.mts.map +1 -1
  25. package/resources/agent-version.d.ts +404 -168
  26. package/resources/agent-version.d.ts.map +1 -1
  27. package/resources/agent-version.js +8 -9
  28. package/resources/agent-version.js.map +1 -1
  29. package/resources/agent-version.mjs +8 -9
  30. package/resources/agent-version.mjs.map +1 -1
  31. package/resources/agent.d.mts +39 -0
  32. package/resources/agent.d.mts.map +1 -1
  33. package/resources/agent.d.ts +39 -0
  34. package/resources/agent.d.ts.map +1 -1
  35. package/resources/config.d.mts +90 -6
  36. package/resources/config.d.mts.map +1 -1
  37. package/resources/config.d.ts +90 -6
  38. package/resources/config.d.ts.map +1 -1
  39. package/resources/index.d.mts +1 -1
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +1 -1
  42. package/resources/index.d.ts.map +1 -1
  43. package/src/client.ts +4 -4
  44. package/src/lib/config.ts +9 -0
  45. package/src/resources/agent-draft.ts +876 -384
  46. package/src/resources/agent-version.ts +495 -226
  47. package/src/resources/agent.ts +46 -0
  48. package/src/resources/config.ts +198 -0
  49. package/src/resources/index.ts +2 -2
  50. package/src/version.ts +1 -1
  51. package/version.d.mts +1 -1
  52. package/version.d.mts.map +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.d.ts.map +1 -1
  55. package/version.js +1 -1
  56. package/version.js.map +1 -1
  57. package/version.mjs +1 -1
  58. package/version.mjs.map +1 -1
@@ -43,7 +43,7 @@ export class AgentDraft extends APIResource {
43
43
  body: AgentDraftUpdateParams,
44
44
  options?: RequestOptions,
45
45
  ): APIPromise<AgentDraftUpdateResponse> {
46
- return this._client.patch(path`/v1/agent/${agentID}/draft`, { body, ...options });
46
+ return this._client.put(path`/v1/agent/${agentID}/draft`, { body, ...options });
47
47
  }
48
48
 
49
49
  /**
@@ -203,30 +203,6 @@ export namespace AgentDraftCreateResponse {
203
203
  */
204
204
  language: string | null;
205
205
 
206
- /**
207
- * OpenAI Live models only: the text model they delegate to.
208
- */
209
- llmBackendModel: string | null;
210
-
211
- llmMaxTokens: number | null;
212
-
213
- /**
214
- * Any model id the provider accepts. One model serves every speaker.
215
- */
216
- llmModel: string | null;
217
-
218
- llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
219
-
220
- /**
221
- * 0 to 2.
222
- */
223
- llmTemperature: number | null;
224
-
225
- /**
226
- * Speech-to-speech models only: the model's own voice.
227
- */
228
- llmVoice: string | null;
229
-
230
206
  /**
231
207
  * Whether the agent takes calls, chats, or both.
232
208
  */
@@ -241,11 +217,6 @@ export namespace AgentDraftCreateResponse {
241
217
 
242
218
  publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
243
219
 
244
- /**
245
- * Set when this version restores an older one.
246
- */
247
- restoredFromVersionId: string | null;
248
-
249
220
  /**
250
221
  * Increases with every edit to a draft. Send it back as expectedRevision when you
251
222
  * publish.
@@ -253,24 +224,14 @@ export namespace AgentDraftCreateResponse {
253
224
  revision: number;
254
225
 
255
226
  /**
256
- * DRAFT while being edited, PUBLISHED once it has been live.
227
+ * Set when this version rolls the agent back to an older one.
257
228
  */
258
- status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
259
-
260
- sttEndpointingMs: number | null;
229
+ rolledBackFromVersionId: string | null;
261
230
 
262
231
  /**
263
- * Words and phrases the transcriber should listen for.
232
+ * DRAFT while being edited, PUBLISHED once it has been live.
264
233
  */
265
- sttKeyterms: Array<string>;
266
-
267
- sttModel: string | null;
268
-
269
- sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
270
-
271
- sttSmartFormat: boolean | null;
272
-
273
- sttTurnDetection: 'pipeline' | 'provider' | null;
234
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
274
235
 
275
236
  /**
276
237
  * The main agent (key `main`) first, then the sub-agents it can hand the call to.
@@ -305,8 +266,8 @@ export namespace AgentDraftCreateResponse {
305
266
 
306
267
  export namespace Data {
307
268
  /**
308
- * A speaker in the conversation. On a sub-agent, null voice settings use the main
309
- * agent's.
269
+ * A speaker in the conversation. A sub-agent without model configs runs on the
270
+ * main agent's.
310
271
  */
311
272
  export interface SubAgent {
312
273
  handoffs: Array<SubAgent.Handoff>;
@@ -321,6 +282,12 @@ export namespace AgentDraftCreateResponse {
321
282
  */
322
283
  key: string;
323
284
 
285
+ /**
286
+ * Up to three, in the order a call tries them. Empty on a sub-agent: it runs on
287
+ * the main agent's. The main agent needs one.
288
+ */
289
+ modelConfigs: Array<SubAgent.AgentCascadeModelConfig | SubAgent.AgentSpeechToSpeechModelConfig>;
290
+
324
291
  /**
325
292
  * How the agent refers to this speaker.
326
293
  */
@@ -332,30 +299,6 @@ export namespace AgentDraftCreateResponse {
332
299
  systemPrompt: string | null;
333
300
 
334
301
  tools: Array<SubAgent.Tool>;
335
-
336
- ttsModel: string | null;
337
-
338
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
339
-
340
- /**
341
- * 0 to 1, ElevenLabs.
342
- */
343
- ttsSimilarityBoost: number | null;
344
-
345
- /**
346
- * 0.5 to 2.
347
- */
348
- ttsSpeed: number | null;
349
-
350
- /**
351
- * 0 to 1, ElevenLabs.
352
- */
353
- ttsStability: number | null;
354
-
355
- /**
356
- * Any voice id the provider accepts, including your own voices.
357
- */
358
- ttsVoiceId: string | null;
359
302
  }
360
303
 
361
304
  export namespace SubAgent {
@@ -386,6 +329,153 @@ export namespace AgentDraftCreateResponse {
386
329
  to: string;
387
330
  }
388
331
 
332
+ /**
333
+ * A transcriber, a text model and a voice. A component that fails during a call
334
+ * moves to its next entry; the others stay.
335
+ */
336
+ export interface AgentCascadeModelConfig {
337
+ /**
338
+ * One to three text models, in the order a call tries them.
339
+ */
340
+ llm: Array<AgentCascadeModelConfig.Llm>;
341
+
342
+ /**
343
+ * One to three transcribers, in the order a call tries them.
344
+ */
345
+ stt: Array<AgentCascadeModelConfig.Stt>;
346
+
347
+ /**
348
+ * One to three voices, in the order a call tries them.
349
+ */
350
+ tts: Array<AgentCascadeModelConfig.Tt>;
351
+
352
+ type: 'CASCADE';
353
+ }
354
+
355
+ export namespace AgentCascadeModelConfig {
356
+ /**
357
+ * A text model. Null settings use the default.
358
+ */
359
+ export interface Llm {
360
+ maxTokens: number | null;
361
+
362
+ /**
363
+ * Any text model id the provider accepts.
364
+ */
365
+ model: string;
366
+
367
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
368
+
369
+ /**
370
+ * 0 to 2.
371
+ */
372
+ temperature: number | null;
373
+ }
374
+
375
+ /**
376
+ * A transcriber. Null settings use the default.
377
+ */
378
+ export interface Stt {
379
+ /**
380
+ * How long the transcriber waits before it ends a turn.
381
+ */
382
+ endpointingMs: number | null;
383
+
384
+ /**
385
+ * Words and phrases the transcriber should listen for.
386
+ */
387
+ keyterms: Array<string>;
388
+
389
+ /**
390
+ * Any transcriber model id the provider accepts.
391
+ */
392
+ model: string;
393
+
394
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
395
+
396
+ smartFormat: boolean | null;
397
+
398
+ turnDetection: 'pipeline' | 'provider' | null;
399
+ }
400
+
401
+ /**
402
+ * A voice. Null settings use the default.
403
+ */
404
+ export interface Tt {
405
+ /**
406
+ * Any voice model id the provider accepts.
407
+ */
408
+ model: string;
409
+
410
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
411
+
412
+ /**
413
+ * 0 to 1, ElevenLabs.
414
+ */
415
+ similarityBoost: number | null;
416
+
417
+ /**
418
+ * 0.5 to 2.
419
+ */
420
+ speed: number | null;
421
+
422
+ /**
423
+ * 0 to 1, ElevenLabs.
424
+ */
425
+ stability: number | null;
426
+
427
+ /**
428
+ * Any voice id the provider accepts, including your own voices.
429
+ */
430
+ voiceId: string;
431
+ }
432
+ }
433
+
434
+ /**
435
+ * One model that hears the caller and speaks with its own voice.
436
+ */
437
+ export interface AgentSpeechToSpeechModelConfig {
438
+ /**
439
+ * A model that hears the caller and speaks with its own voice. Null settings use
440
+ * the default.
441
+ */
442
+ speechToSpeech: AgentSpeechToSpeechModelConfig.SpeechToSpeech;
443
+
444
+ type: 'SPEECH_TO_SPEECH';
445
+ }
446
+
447
+ export namespace AgentSpeechToSpeechModelConfig {
448
+ /**
449
+ * A model that hears the caller and speaks with its own voice. Null settings use
450
+ * the default.
451
+ */
452
+ export interface SpeechToSpeech {
453
+ /**
454
+ * OpenAI Live models only: the text model they delegate to.
455
+ */
456
+ backendModel: string | null;
457
+
458
+ maxOutputTokens: number | null;
459
+
460
+ /**
461
+ * Any speech-to-speech model id the provider accepts.
462
+ */
463
+ model: string;
464
+
465
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
466
+
467
+ /**
468
+ * 0 to 2.
469
+ */
470
+ temperature: number | null;
471
+
472
+ /**
473
+ * The model's own voice.
474
+ */
475
+ voice: string | null;
476
+ }
477
+ }
478
+
389
479
  export interface Tool {
390
480
  /**
391
481
  * The tool version the agent runs; null runs the tool's latest declared version.
@@ -516,30 +606,6 @@ export namespace AgentDraftUpdateResponse {
516
606
  */
517
607
  language: string | null;
518
608
 
519
- /**
520
- * OpenAI Live models only: the text model they delegate to.
521
- */
522
- llmBackendModel: string | null;
523
-
524
- llmMaxTokens: number | null;
525
-
526
- /**
527
- * Any model id the provider accepts. One model serves every speaker.
528
- */
529
- llmModel: string | null;
530
-
531
- llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
532
-
533
- /**
534
- * 0 to 2.
535
- */
536
- llmTemperature: number | null;
537
-
538
- /**
539
- * Speech-to-speech models only: the model's own voice.
540
- */
541
- llmVoice: string | null;
542
-
543
609
  /**
544
610
  * Whether the agent takes calls, chats, or both.
545
611
  */
@@ -554,11 +620,6 @@ export namespace AgentDraftUpdateResponse {
554
620
 
555
621
  publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
556
622
 
557
- /**
558
- * Set when this version restores an older one.
559
- */
560
- restoredFromVersionId: string | null;
561
-
562
623
  /**
563
624
  * Increases with every edit to a draft. Send it back as expectedRevision when you
564
625
  * publish.
@@ -566,24 +627,14 @@ export namespace AgentDraftUpdateResponse {
566
627
  revision: number;
567
628
 
568
629
  /**
569
- * DRAFT while being edited, PUBLISHED once it has been live.
630
+ * Set when this version rolls the agent back to an older one.
570
631
  */
571
- status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
572
-
573
- sttEndpointingMs: number | null;
632
+ rolledBackFromVersionId: string | null;
574
633
 
575
634
  /**
576
- * Words and phrases the transcriber should listen for.
635
+ * DRAFT while being edited, PUBLISHED once it has been live.
577
636
  */
578
- sttKeyterms: Array<string>;
579
-
580
- sttModel: string | null;
581
-
582
- sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
583
-
584
- sttSmartFormat: boolean | null;
585
-
586
- sttTurnDetection: 'pipeline' | 'provider' | null;
637
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
587
638
 
588
639
  /**
589
640
  * The main agent (key `main`) first, then the sub-agents it can hand the call to.
@@ -618,8 +669,8 @@ export namespace AgentDraftUpdateResponse {
618
669
 
619
670
  export namespace Data {
620
671
  /**
621
- * A speaker in the conversation. On a sub-agent, null voice settings use the main
622
- * agent's.
672
+ * A speaker in the conversation. A sub-agent without model configs runs on the
673
+ * main agent's.
623
674
  */
624
675
  export interface SubAgent {
625
676
  handoffs: Array<SubAgent.Handoff>;
@@ -634,6 +685,12 @@ export namespace AgentDraftUpdateResponse {
634
685
  */
635
686
  key: string;
636
687
 
688
+ /**
689
+ * Up to three, in the order a call tries them. Empty on a sub-agent: it runs on
690
+ * the main agent's. The main agent needs one.
691
+ */
692
+ modelConfigs: Array<SubAgent.AgentCascadeModelConfig | SubAgent.AgentSpeechToSpeechModelConfig>;
693
+
637
694
  /**
638
695
  * How the agent refers to this speaker.
639
696
  */
@@ -645,30 +702,6 @@ export namespace AgentDraftUpdateResponse {
645
702
  systemPrompt: string | null;
646
703
 
647
704
  tools: Array<SubAgent.Tool>;
648
-
649
- ttsModel: string | null;
650
-
651
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
652
-
653
- /**
654
- * 0 to 1, ElevenLabs.
655
- */
656
- ttsSimilarityBoost: number | null;
657
-
658
- /**
659
- * 0.5 to 2.
660
- */
661
- ttsSpeed: number | null;
662
-
663
- /**
664
- * 0 to 1, ElevenLabs.
665
- */
666
- ttsStability: number | null;
667
-
668
- /**
669
- * Any voice id the provider accepts, including your own voices.
670
- */
671
- ttsVoiceId: string | null;
672
705
  }
673
706
 
674
707
  export namespace SubAgent {
@@ -699,6 +732,153 @@ export namespace AgentDraftUpdateResponse {
699
732
  to: string;
700
733
  }
701
734
 
735
+ /**
736
+ * A transcriber, a text model and a voice. A component that fails during a call
737
+ * moves to its next entry; the others stay.
738
+ */
739
+ export interface AgentCascadeModelConfig {
740
+ /**
741
+ * One to three text models, in the order a call tries them.
742
+ */
743
+ llm: Array<AgentCascadeModelConfig.Llm>;
744
+
745
+ /**
746
+ * One to three transcribers, in the order a call tries them.
747
+ */
748
+ stt: Array<AgentCascadeModelConfig.Stt>;
749
+
750
+ /**
751
+ * One to three voices, in the order a call tries them.
752
+ */
753
+ tts: Array<AgentCascadeModelConfig.Tt>;
754
+
755
+ type: 'CASCADE';
756
+ }
757
+
758
+ export namespace AgentCascadeModelConfig {
759
+ /**
760
+ * A text model. Null settings use the default.
761
+ */
762
+ export interface Llm {
763
+ maxTokens: number | null;
764
+
765
+ /**
766
+ * Any text model id the provider accepts.
767
+ */
768
+ model: string;
769
+
770
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
771
+
772
+ /**
773
+ * 0 to 2.
774
+ */
775
+ temperature: number | null;
776
+ }
777
+
778
+ /**
779
+ * A transcriber. Null settings use the default.
780
+ */
781
+ export interface Stt {
782
+ /**
783
+ * How long the transcriber waits before it ends a turn.
784
+ */
785
+ endpointingMs: number | null;
786
+
787
+ /**
788
+ * Words and phrases the transcriber should listen for.
789
+ */
790
+ keyterms: Array<string>;
791
+
792
+ /**
793
+ * Any transcriber model id the provider accepts.
794
+ */
795
+ model: string;
796
+
797
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
798
+
799
+ smartFormat: boolean | null;
800
+
801
+ turnDetection: 'pipeline' | 'provider' | null;
802
+ }
803
+
804
+ /**
805
+ * A voice. Null settings use the default.
806
+ */
807
+ export interface Tt {
808
+ /**
809
+ * Any voice model id the provider accepts.
810
+ */
811
+ model: string;
812
+
813
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
814
+
815
+ /**
816
+ * 0 to 1, ElevenLabs.
817
+ */
818
+ similarityBoost: number | null;
819
+
820
+ /**
821
+ * 0.5 to 2.
822
+ */
823
+ speed: number | null;
824
+
825
+ /**
826
+ * 0 to 1, ElevenLabs.
827
+ */
828
+ stability: number | null;
829
+
830
+ /**
831
+ * Any voice id the provider accepts, including your own voices.
832
+ */
833
+ voiceId: string;
834
+ }
835
+ }
836
+
837
+ /**
838
+ * One model that hears the caller and speaks with its own voice.
839
+ */
840
+ export interface AgentSpeechToSpeechModelConfig {
841
+ /**
842
+ * A model that hears the caller and speaks with its own voice. Null settings use
843
+ * the default.
844
+ */
845
+ speechToSpeech: AgentSpeechToSpeechModelConfig.SpeechToSpeech;
846
+
847
+ type: 'SPEECH_TO_SPEECH';
848
+ }
849
+
850
+ export namespace AgentSpeechToSpeechModelConfig {
851
+ /**
852
+ * A model that hears the caller and speaks with its own voice. Null settings use
853
+ * the default.
854
+ */
855
+ export interface SpeechToSpeech {
856
+ /**
857
+ * OpenAI Live models only: the text model they delegate to.
858
+ */
859
+ backendModel: string | null;
860
+
861
+ maxOutputTokens: number | null;
862
+
863
+ /**
864
+ * Any speech-to-speech model id the provider accepts.
865
+ */
866
+ model: string;
867
+
868
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
869
+
870
+ /**
871
+ * 0 to 2.
872
+ */
873
+ temperature: number | null;
874
+
875
+ /**
876
+ * The model's own voice.
877
+ */
878
+ voice: string | null;
879
+ }
880
+ }
881
+
702
882
  export interface Tool {
703
883
  /**
704
884
  * The tool version the agent runs; null runs the tool's latest declared version.
@@ -829,30 +1009,6 @@ export namespace AgentDraftDeleteResponse {
829
1009
  */
830
1010
  language: string | null;
831
1011
 
832
- /**
833
- * OpenAI Live models only: the text model they delegate to.
834
- */
835
- llmBackendModel: string | null;
836
-
837
- llmMaxTokens: number | null;
838
-
839
- /**
840
- * Any model id the provider accepts. One model serves every speaker.
841
- */
842
- llmModel: string | null;
843
-
844
- llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
845
-
846
- /**
847
- * 0 to 2.
848
- */
849
- llmTemperature: number | null;
850
-
851
- /**
852
- * Speech-to-speech models only: the model's own voice.
853
- */
854
- llmVoice: string | null;
855
-
856
1012
  /**
857
1013
  * Whether the agent takes calls, chats, or both.
858
1014
  */
@@ -867,11 +1023,6 @@ export namespace AgentDraftDeleteResponse {
867
1023
 
868
1024
  publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
869
1025
 
870
- /**
871
- * Set when this version restores an older one.
872
- */
873
- restoredFromVersionId: string | null;
874
-
875
1026
  /**
876
1027
  * Increases with every edit to a draft. Send it back as expectedRevision when you
877
1028
  * publish.
@@ -879,24 +1030,14 @@ export namespace AgentDraftDeleteResponse {
879
1030
  revision: number;
880
1031
 
881
1032
  /**
882
- * DRAFT while being edited, PUBLISHED once it has been live.
1033
+ * Set when this version rolls the agent back to an older one.
883
1034
  */
884
- status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
885
-
886
- sttEndpointingMs: number | null;
1035
+ rolledBackFromVersionId: string | null;
887
1036
 
888
1037
  /**
889
- * Words and phrases the transcriber should listen for.
1038
+ * DRAFT while being edited, PUBLISHED once it has been live.
890
1039
  */
891
- sttKeyterms: Array<string>;
892
-
893
- sttModel: string | null;
894
-
895
- sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
896
-
897
- sttSmartFormat: boolean | null;
898
-
899
- sttTurnDetection: 'pipeline' | 'provider' | null;
1040
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
900
1041
 
901
1042
  /**
902
1043
  * The main agent (key `main`) first, then the sub-agents it can hand the call to.
@@ -931,8 +1072,8 @@ export namespace AgentDraftDeleteResponse {
931
1072
 
932
1073
  export namespace Data {
933
1074
  /**
934
- * A speaker in the conversation. On a sub-agent, null voice settings use the main
935
- * agent's.
1075
+ * A speaker in the conversation. A sub-agent without model configs runs on the
1076
+ * main agent's.
936
1077
  */
937
1078
  export interface SubAgent {
938
1079
  handoffs: Array<SubAgent.Handoff>;
@@ -947,6 +1088,12 @@ export namespace AgentDraftDeleteResponse {
947
1088
  */
948
1089
  key: string;
949
1090
 
1091
+ /**
1092
+ * Up to three, in the order a call tries them. Empty on a sub-agent: it runs on
1093
+ * the main agent's. The main agent needs one.
1094
+ */
1095
+ modelConfigs: Array<SubAgent.AgentCascadeModelConfig | SubAgent.AgentSpeechToSpeechModelConfig>;
1096
+
950
1097
  /**
951
1098
  * How the agent refers to this speaker.
952
1099
  */
@@ -958,30 +1105,6 @@ export namespace AgentDraftDeleteResponse {
958
1105
  systemPrompt: string | null;
959
1106
 
960
1107
  tools: Array<SubAgent.Tool>;
961
-
962
- ttsModel: string | null;
963
-
964
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
965
-
966
- /**
967
- * 0 to 1, ElevenLabs.
968
- */
969
- ttsSimilarityBoost: number | null;
970
-
971
- /**
972
- * 0.5 to 2.
973
- */
974
- ttsSpeed: number | null;
975
-
976
- /**
977
- * 0 to 1, ElevenLabs.
978
- */
979
- ttsStability: number | null;
980
-
981
- /**
982
- * Any voice id the provider accepts, including your own voices.
983
- */
984
- ttsVoiceId: string | null;
985
1108
  }
986
1109
 
987
1110
  export namespace SubAgent {
@@ -1012,6 +1135,153 @@ export namespace AgentDraftDeleteResponse {
1012
1135
  to: string;
1013
1136
  }
1014
1137
 
1138
+ /**
1139
+ * A transcriber, a text model and a voice. A component that fails during a call
1140
+ * moves to its next entry; the others stay.
1141
+ */
1142
+ export interface AgentCascadeModelConfig {
1143
+ /**
1144
+ * One to three text models, in the order a call tries them.
1145
+ */
1146
+ llm: Array<AgentCascadeModelConfig.Llm>;
1147
+
1148
+ /**
1149
+ * One to three transcribers, in the order a call tries them.
1150
+ */
1151
+ stt: Array<AgentCascadeModelConfig.Stt>;
1152
+
1153
+ /**
1154
+ * One to three voices, in the order a call tries them.
1155
+ */
1156
+ tts: Array<AgentCascadeModelConfig.Tt>;
1157
+
1158
+ type: 'CASCADE';
1159
+ }
1160
+
1161
+ export namespace AgentCascadeModelConfig {
1162
+ /**
1163
+ * A text model. Null settings use the default.
1164
+ */
1165
+ export interface Llm {
1166
+ maxTokens: number | null;
1167
+
1168
+ /**
1169
+ * Any text model id the provider accepts.
1170
+ */
1171
+ model: string;
1172
+
1173
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
1174
+
1175
+ /**
1176
+ * 0 to 2.
1177
+ */
1178
+ temperature: number | null;
1179
+ }
1180
+
1181
+ /**
1182
+ * A transcriber. Null settings use the default.
1183
+ */
1184
+ export interface Stt {
1185
+ /**
1186
+ * How long the transcriber waits before it ends a turn.
1187
+ */
1188
+ endpointingMs: number | null;
1189
+
1190
+ /**
1191
+ * Words and phrases the transcriber should listen for.
1192
+ */
1193
+ keyterms: Array<string>;
1194
+
1195
+ /**
1196
+ * Any transcriber model id the provider accepts.
1197
+ */
1198
+ model: string;
1199
+
1200
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
1201
+
1202
+ smartFormat: boolean | null;
1203
+
1204
+ turnDetection: 'pipeline' | 'provider' | null;
1205
+ }
1206
+
1207
+ /**
1208
+ * A voice. Null settings use the default.
1209
+ */
1210
+ export interface Tt {
1211
+ /**
1212
+ * Any voice model id the provider accepts.
1213
+ */
1214
+ model: string;
1215
+
1216
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
1217
+
1218
+ /**
1219
+ * 0 to 1, ElevenLabs.
1220
+ */
1221
+ similarityBoost: number | null;
1222
+
1223
+ /**
1224
+ * 0.5 to 2.
1225
+ */
1226
+ speed: number | null;
1227
+
1228
+ /**
1229
+ * 0 to 1, ElevenLabs.
1230
+ */
1231
+ stability: number | null;
1232
+
1233
+ /**
1234
+ * Any voice id the provider accepts, including your own voices.
1235
+ */
1236
+ voiceId: string;
1237
+ }
1238
+ }
1239
+
1240
+ /**
1241
+ * One model that hears the caller and speaks with its own voice.
1242
+ */
1243
+ export interface AgentSpeechToSpeechModelConfig {
1244
+ /**
1245
+ * A model that hears the caller and speaks with its own voice. Null settings use
1246
+ * the default.
1247
+ */
1248
+ speechToSpeech: AgentSpeechToSpeechModelConfig.SpeechToSpeech;
1249
+
1250
+ type: 'SPEECH_TO_SPEECH';
1251
+ }
1252
+
1253
+ export namespace AgentSpeechToSpeechModelConfig {
1254
+ /**
1255
+ * A model that hears the caller and speaks with its own voice. Null settings use
1256
+ * the default.
1257
+ */
1258
+ export interface SpeechToSpeech {
1259
+ /**
1260
+ * OpenAI Live models only: the text model they delegate to.
1261
+ */
1262
+ backendModel: string | null;
1263
+
1264
+ maxOutputTokens: number | null;
1265
+
1266
+ /**
1267
+ * Any speech-to-speech model id the provider accepts.
1268
+ */
1269
+ model: string;
1270
+
1271
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
1272
+
1273
+ /**
1274
+ * 0 to 2.
1275
+ */
1276
+ temperature: number | null;
1277
+
1278
+ /**
1279
+ * The model's own voice.
1280
+ */
1281
+ voice: string | null;
1282
+ }
1283
+ }
1284
+
1015
1285
  export interface Tool {
1016
1286
  /**
1017
1287
  * The tool version the agent runs; null runs the tool's latest declared version.
@@ -1142,30 +1412,6 @@ export namespace AgentDraftGetResponse {
1142
1412
  */
1143
1413
  language: string | null;
1144
1414
 
1145
- /**
1146
- * OpenAI Live models only: the text model they delegate to.
1147
- */
1148
- llmBackendModel: string | null;
1149
-
1150
- llmMaxTokens: number | null;
1151
-
1152
- /**
1153
- * Any model id the provider accepts. One model serves every speaker.
1154
- */
1155
- llmModel: string | null;
1156
-
1157
- llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1158
-
1159
- /**
1160
- * 0 to 2.
1161
- */
1162
- llmTemperature: number | null;
1163
-
1164
- /**
1165
- * Speech-to-speech models only: the model's own voice.
1166
- */
1167
- llmVoice: string | null;
1168
-
1169
1415
  /**
1170
1416
  * Whether the agent takes calls, chats, or both.
1171
1417
  */
@@ -1180,11 +1426,6 @@ export namespace AgentDraftGetResponse {
1180
1426
 
1181
1427
  publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
1182
1428
 
1183
- /**
1184
- * Set when this version restores an older one.
1185
- */
1186
- restoredFromVersionId: string | null;
1187
-
1188
1429
  /**
1189
1430
  * Increases with every edit to a draft. Send it back as expectedRevision when you
1190
1431
  * publish.
@@ -1192,24 +1433,14 @@ export namespace AgentDraftGetResponse {
1192
1433
  revision: number;
1193
1434
 
1194
1435
  /**
1195
- * DRAFT while being edited, PUBLISHED once it has been live.
1436
+ * Set when this version rolls the agent back to an older one.
1196
1437
  */
1197
- status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1198
-
1199
- sttEndpointingMs: number | null;
1438
+ rolledBackFromVersionId: string | null;
1200
1439
 
1201
1440
  /**
1202
- * Words and phrases the transcriber should listen for.
1441
+ * DRAFT while being edited, PUBLISHED once it has been live.
1203
1442
  */
1204
- sttKeyterms: Array<string>;
1205
-
1206
- sttModel: string | null;
1207
-
1208
- sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1209
-
1210
- sttSmartFormat: boolean | null;
1211
-
1212
- sttTurnDetection: 'pipeline' | 'provider' | null;
1443
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1213
1444
 
1214
1445
  /**
1215
1446
  * The main agent (key `main`) first, then the sub-agents it can hand the call to.
@@ -1244,8 +1475,8 @@ export namespace AgentDraftGetResponse {
1244
1475
 
1245
1476
  export namespace Data {
1246
1477
  /**
1247
- * A speaker in the conversation. On a sub-agent, null voice settings use the main
1248
- * agent's.
1478
+ * A speaker in the conversation. A sub-agent without model configs runs on the
1479
+ * main agent's.
1249
1480
  */
1250
1481
  export interface SubAgent {
1251
1482
  handoffs: Array<SubAgent.Handoff>;
@@ -1260,6 +1491,12 @@ export namespace AgentDraftGetResponse {
1260
1491
  */
1261
1492
  key: string;
1262
1493
 
1494
+ /**
1495
+ * Up to three, in the order a call tries them. Empty on a sub-agent: it runs on
1496
+ * the main agent's. The main agent needs one.
1497
+ */
1498
+ modelConfigs: Array<SubAgent.AgentCascadeModelConfig | SubAgent.AgentSpeechToSpeechModelConfig>;
1499
+
1263
1500
  /**
1264
1501
  * How the agent refers to this speaker.
1265
1502
  */
@@ -1271,30 +1508,6 @@ export namespace AgentDraftGetResponse {
1271
1508
  systemPrompt: string | null;
1272
1509
 
1273
1510
  tools: Array<SubAgent.Tool>;
1274
-
1275
- ttsModel: string | null;
1276
-
1277
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1278
-
1279
- /**
1280
- * 0 to 1, ElevenLabs.
1281
- */
1282
- ttsSimilarityBoost: number | null;
1283
-
1284
- /**
1285
- * 0.5 to 2.
1286
- */
1287
- ttsSpeed: number | null;
1288
-
1289
- /**
1290
- * 0 to 1, ElevenLabs.
1291
- */
1292
- ttsStability: number | null;
1293
-
1294
- /**
1295
- * Any voice id the provider accepts, including your own voices.
1296
- */
1297
- ttsVoiceId: string | null;
1298
1511
  }
1299
1512
 
1300
1513
  export namespace SubAgent {
@@ -1325,6 +1538,153 @@ export namespace AgentDraftGetResponse {
1325
1538
  to: string;
1326
1539
  }
1327
1540
 
1541
+ /**
1542
+ * A transcriber, a text model and a voice. A component that fails during a call
1543
+ * moves to its next entry; the others stay.
1544
+ */
1545
+ export interface AgentCascadeModelConfig {
1546
+ /**
1547
+ * One to three text models, in the order a call tries them.
1548
+ */
1549
+ llm: Array<AgentCascadeModelConfig.Llm>;
1550
+
1551
+ /**
1552
+ * One to three transcribers, in the order a call tries them.
1553
+ */
1554
+ stt: Array<AgentCascadeModelConfig.Stt>;
1555
+
1556
+ /**
1557
+ * One to three voices, in the order a call tries them.
1558
+ */
1559
+ tts: Array<AgentCascadeModelConfig.Tt>;
1560
+
1561
+ type: 'CASCADE';
1562
+ }
1563
+
1564
+ export namespace AgentCascadeModelConfig {
1565
+ /**
1566
+ * A text model. Null settings use the default.
1567
+ */
1568
+ export interface Llm {
1569
+ maxTokens: number | null;
1570
+
1571
+ /**
1572
+ * Any text model id the provider accepts.
1573
+ */
1574
+ model: string;
1575
+
1576
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
1577
+
1578
+ /**
1579
+ * 0 to 2.
1580
+ */
1581
+ temperature: number | null;
1582
+ }
1583
+
1584
+ /**
1585
+ * A transcriber. Null settings use the default.
1586
+ */
1587
+ export interface Stt {
1588
+ /**
1589
+ * How long the transcriber waits before it ends a turn.
1590
+ */
1591
+ endpointingMs: number | null;
1592
+
1593
+ /**
1594
+ * Words and phrases the transcriber should listen for.
1595
+ */
1596
+ keyterms: Array<string>;
1597
+
1598
+ /**
1599
+ * Any transcriber model id the provider accepts.
1600
+ */
1601
+ model: string;
1602
+
1603
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
1604
+
1605
+ smartFormat: boolean | null;
1606
+
1607
+ turnDetection: 'pipeline' | 'provider' | null;
1608
+ }
1609
+
1610
+ /**
1611
+ * A voice. Null settings use the default.
1612
+ */
1613
+ export interface Tt {
1614
+ /**
1615
+ * Any voice model id the provider accepts.
1616
+ */
1617
+ model: string;
1618
+
1619
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
1620
+
1621
+ /**
1622
+ * 0 to 1, ElevenLabs.
1623
+ */
1624
+ similarityBoost: number | null;
1625
+
1626
+ /**
1627
+ * 0.5 to 2.
1628
+ */
1629
+ speed: number | null;
1630
+
1631
+ /**
1632
+ * 0 to 1, ElevenLabs.
1633
+ */
1634
+ stability: number | null;
1635
+
1636
+ /**
1637
+ * Any voice id the provider accepts, including your own voices.
1638
+ */
1639
+ voiceId: string;
1640
+ }
1641
+ }
1642
+
1643
+ /**
1644
+ * One model that hears the caller and speaks with its own voice.
1645
+ */
1646
+ export interface AgentSpeechToSpeechModelConfig {
1647
+ /**
1648
+ * A model that hears the caller and speaks with its own voice. Null settings use
1649
+ * the default.
1650
+ */
1651
+ speechToSpeech: AgentSpeechToSpeechModelConfig.SpeechToSpeech;
1652
+
1653
+ type: 'SPEECH_TO_SPEECH';
1654
+ }
1655
+
1656
+ export namespace AgentSpeechToSpeechModelConfig {
1657
+ /**
1658
+ * A model that hears the caller and speaks with its own voice. Null settings use
1659
+ * the default.
1660
+ */
1661
+ export interface SpeechToSpeech {
1662
+ /**
1663
+ * OpenAI Live models only: the text model they delegate to.
1664
+ */
1665
+ backendModel: string | null;
1666
+
1667
+ maxOutputTokens: number | null;
1668
+
1669
+ /**
1670
+ * Any speech-to-speech model id the provider accepts.
1671
+ */
1672
+ model: string;
1673
+
1674
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
1675
+
1676
+ /**
1677
+ * 0 to 2.
1678
+ */
1679
+ temperature: number | null;
1680
+
1681
+ /**
1682
+ * The model's own voice.
1683
+ */
1684
+ voice: string | null;
1685
+ }
1686
+ }
1687
+
1328
1688
  export interface Tool {
1329
1689
  /**
1330
1690
  * The tool version the agent runs; null runs the tool's latest declared version.
@@ -1455,30 +1815,6 @@ export namespace AgentDraftPublishResponse {
1455
1815
  */
1456
1816
  language: string | null;
1457
1817
 
1458
- /**
1459
- * OpenAI Live models only: the text model they delegate to.
1460
- */
1461
- llmBackendModel: string | null;
1462
-
1463
- llmMaxTokens: number | null;
1464
-
1465
- /**
1466
- * Any model id the provider accepts. One model serves every speaker.
1467
- */
1468
- llmModel: string | null;
1469
-
1470
- llmProvider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1471
-
1472
- /**
1473
- * 0 to 2.
1474
- */
1475
- llmTemperature: number | null;
1476
-
1477
- /**
1478
- * Speech-to-speech models only: the model's own voice.
1479
- */
1480
- llmVoice: string | null;
1481
-
1482
1818
  /**
1483
1819
  * Whether the agent takes calls, chats, or both.
1484
1820
  */
@@ -1493,11 +1829,6 @@ export namespace AgentDraftPublishResponse {
1493
1829
 
1494
1830
  publishedByType: 'USER' | 'API' | 'CONFIG' | 'AUTOIMPROVE' | 'INTEGRATION' | 'SYSTEM' | null;
1495
1831
 
1496
- /**
1497
- * Set when this version restores an older one.
1498
- */
1499
- restoredFromVersionId: string | null;
1500
-
1501
1832
  /**
1502
1833
  * Increases with every edit to a draft. Send it back as expectedRevision when you
1503
1834
  * publish.
@@ -1505,24 +1836,14 @@ export namespace AgentDraftPublishResponse {
1505
1836
  revision: number;
1506
1837
 
1507
1838
  /**
1508
- * DRAFT while being edited, PUBLISHED once it has been live.
1839
+ * Set when this version rolls the agent back to an older one.
1509
1840
  */
1510
- status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1511
-
1512
- sttEndpointingMs: number | null;
1841
+ rolledBackFromVersionId: string | null;
1513
1842
 
1514
1843
  /**
1515
- * Words and phrases the transcriber should listen for.
1844
+ * DRAFT while being edited, PUBLISHED once it has been live.
1516
1845
  */
1517
- sttKeyterms: Array<string>;
1518
-
1519
- sttModel: string | null;
1520
-
1521
- sttProvider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1522
-
1523
- sttSmartFormat: boolean | null;
1524
-
1525
- sttTurnDetection: 'pipeline' | 'provider' | null;
1846
+ status: 'DRAFT' | 'PUBLISHED' | 'DISCARDED';
1526
1847
 
1527
1848
  /**
1528
1849
  * The main agent (key `main`) first, then the sub-agents it can hand the call to.
@@ -1557,8 +1878,8 @@ export namespace AgentDraftPublishResponse {
1557
1878
 
1558
1879
  export namespace Data {
1559
1880
  /**
1560
- * A speaker in the conversation. On a sub-agent, null voice settings use the main
1561
- * agent's.
1881
+ * A speaker in the conversation. A sub-agent without model configs runs on the
1882
+ * main agent's.
1562
1883
  */
1563
1884
  export interface SubAgent {
1564
1885
  handoffs: Array<SubAgent.Handoff>;
@@ -1573,6 +1894,12 @@ export namespace AgentDraftPublishResponse {
1573
1894
  */
1574
1895
  key: string;
1575
1896
 
1897
+ /**
1898
+ * Up to three, in the order a call tries them. Empty on a sub-agent: it runs on
1899
+ * the main agent's. The main agent needs one.
1900
+ */
1901
+ modelConfigs: Array<SubAgent.AgentCascadeModelConfig | SubAgent.AgentSpeechToSpeechModelConfig>;
1902
+
1576
1903
  /**
1577
1904
  * How the agent refers to this speaker.
1578
1905
  */
@@ -1584,30 +1911,6 @@ export namespace AgentDraftPublishResponse {
1584
1911
  systemPrompt: string | null;
1585
1912
 
1586
1913
  tools: Array<SubAgent.Tool>;
1587
-
1588
- ttsModel: string | null;
1589
-
1590
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1591
-
1592
- /**
1593
- * 0 to 1, ElevenLabs.
1594
- */
1595
- ttsSimilarityBoost: number | null;
1596
-
1597
- /**
1598
- * 0.5 to 2.
1599
- */
1600
- ttsSpeed: number | null;
1601
-
1602
- /**
1603
- * 0 to 1, ElevenLabs.
1604
- */
1605
- ttsStability: number | null;
1606
-
1607
- /**
1608
- * Any voice id the provider accepts, including your own voices.
1609
- */
1610
- ttsVoiceId: string | null;
1611
1914
  }
1612
1915
 
1613
1916
  export namespace SubAgent {
@@ -1638,6 +1941,153 @@ export namespace AgentDraftPublishResponse {
1638
1941
  to: string;
1639
1942
  }
1640
1943
 
1944
+ /**
1945
+ * A transcriber, a text model and a voice. A component that fails during a call
1946
+ * moves to its next entry; the others stay.
1947
+ */
1948
+ export interface AgentCascadeModelConfig {
1949
+ /**
1950
+ * One to three text models, in the order a call tries them.
1951
+ */
1952
+ llm: Array<AgentCascadeModelConfig.Llm>;
1953
+
1954
+ /**
1955
+ * One to three transcribers, in the order a call tries them.
1956
+ */
1957
+ stt: Array<AgentCascadeModelConfig.Stt>;
1958
+
1959
+ /**
1960
+ * One to three voices, in the order a call tries them.
1961
+ */
1962
+ tts: Array<AgentCascadeModelConfig.Tt>;
1963
+
1964
+ type: 'CASCADE';
1965
+ }
1966
+
1967
+ export namespace AgentCascadeModelConfig {
1968
+ /**
1969
+ * A text model. Null settings use the default.
1970
+ */
1971
+ export interface Llm {
1972
+ maxTokens: number | null;
1973
+
1974
+ /**
1975
+ * Any text model id the provider accepts.
1976
+ */
1977
+ model: string;
1978
+
1979
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
1980
+
1981
+ /**
1982
+ * 0 to 2.
1983
+ */
1984
+ temperature: number | null;
1985
+ }
1986
+
1987
+ /**
1988
+ * A transcriber. Null settings use the default.
1989
+ */
1990
+ export interface Stt {
1991
+ /**
1992
+ * How long the transcriber waits before it ends a turn.
1993
+ */
1994
+ endpointingMs: number | null;
1995
+
1996
+ /**
1997
+ * Words and phrases the transcriber should listen for.
1998
+ */
1999
+ keyterms: Array<string>;
2000
+
2001
+ /**
2002
+ * Any transcriber model id the provider accepts.
2003
+ */
2004
+ model: string;
2005
+
2006
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
2007
+
2008
+ smartFormat: boolean | null;
2009
+
2010
+ turnDetection: 'pipeline' | 'provider' | null;
2011
+ }
2012
+
2013
+ /**
2014
+ * A voice. Null settings use the default.
2015
+ */
2016
+ export interface Tt {
2017
+ /**
2018
+ * Any voice model id the provider accepts.
2019
+ */
2020
+ model: string;
2021
+
2022
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
2023
+
2024
+ /**
2025
+ * 0 to 1, ElevenLabs.
2026
+ */
2027
+ similarityBoost: number | null;
2028
+
2029
+ /**
2030
+ * 0.5 to 2.
2031
+ */
2032
+ speed: number | null;
2033
+
2034
+ /**
2035
+ * 0 to 1, ElevenLabs.
2036
+ */
2037
+ stability: number | null;
2038
+
2039
+ /**
2040
+ * Any voice id the provider accepts, including your own voices.
2041
+ */
2042
+ voiceId: string;
2043
+ }
2044
+ }
2045
+
2046
+ /**
2047
+ * One model that hears the caller and speaks with its own voice.
2048
+ */
2049
+ export interface AgentSpeechToSpeechModelConfig {
2050
+ /**
2051
+ * A model that hears the caller and speaks with its own voice. Null settings use
2052
+ * the default.
2053
+ */
2054
+ speechToSpeech: AgentSpeechToSpeechModelConfig.SpeechToSpeech;
2055
+
2056
+ type: 'SPEECH_TO_SPEECH';
2057
+ }
2058
+
2059
+ export namespace AgentSpeechToSpeechModelConfig {
2060
+ /**
2061
+ * A model that hears the caller and speaks with its own voice. Null settings use
2062
+ * the default.
2063
+ */
2064
+ export interface SpeechToSpeech {
2065
+ /**
2066
+ * OpenAI Live models only: the text model they delegate to.
2067
+ */
2068
+ backendModel: string | null;
2069
+
2070
+ maxOutputTokens: number | null;
2071
+
2072
+ /**
2073
+ * Any speech-to-speech model id the provider accepts.
2074
+ */
2075
+ model: string;
2076
+
2077
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
2078
+
2079
+ /**
2080
+ * 0 to 2.
2081
+ */
2082
+ temperature: number | null;
2083
+
2084
+ /**
2085
+ * The model's own voice.
2086
+ */
2087
+ voice: string | null;
2088
+ }
2089
+ }
2090
+
1641
2091
  export interface Tool {
1642
2092
  /**
1643
2093
  * The tool version the agent runs; null runs the tool's latest declared version.
@@ -1672,7 +2122,9 @@ export interface AgentDraftCreateParams {
1672
2122
  export interface AgentDraftUpdateParams {
1673
2123
  /**
1674
2124
  * The settings to change. Omitted settings stay as they are; null clears one to
1675
- * the runtime default. subAgents replaces every speaker and must include `main`.
2125
+ * the runtime default. subAgents replaces every speaker, model configs included,
2126
+ * and must include `main`; in a model config, omitted fields use the runtime
2127
+ * default.
1676
2128
  */
1677
2129
  settings: AgentDraftUpdateParams.Settings;
1678
2130
 
@@ -1686,7 +2138,9 @@ export interface AgentDraftUpdateParams {
1686
2138
  export namespace AgentDraftUpdateParams {
1687
2139
  /**
1688
2140
  * The settings to change. Omitted settings stay as they are; null clears one to
1689
- * the runtime default. subAgents replaces every speaker and must include `main`.
2141
+ * the runtime default. subAgents replaces every speaker, model configs included,
2142
+ * and must include `main`; in a model config, omitted fields use the runtime
2143
+ * default.
1690
2144
  */
1691
2145
  export interface Settings {
1692
2146
  backgroundNoise?:
@@ -1738,32 +2192,8 @@ export namespace AgentDraftUpdateParams {
1738
2192
 
1739
2193
  language?: string | null;
1740
2194
 
1741
- llmBackendModel?: string | null;
1742
-
1743
- llmMaxTokens?: number | null;
1744
-
1745
- llmModel?: string | null;
1746
-
1747
- llmProvider?: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS' | null;
1748
-
1749
- llmTemperature?: number | null;
1750
-
1751
- llmVoice?: string | null;
1752
-
1753
2195
  modalities?: Array<'call' | 'chat'>;
1754
2196
 
1755
- sttEndpointingMs?: number | null;
1756
-
1757
- sttKeyterms?: Array<string>;
1758
-
1759
- sttModel?: string | null;
1760
-
1761
- sttProvider?: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS' | null;
1762
-
1763
- sttSmartFormat?: boolean | null;
1764
-
1765
- sttTurnDetection?: 'pipeline' | 'provider' | null;
1766
-
1767
2197
  subAgents?: Array<Settings.SubAgent>;
1768
2198
 
1769
2199
  vadStartSecs?: number | null;
@@ -1779,23 +2209,13 @@ export namespace AgentDraftUpdateParams {
1779
2209
 
1780
2210
  key: 'main' | string;
1781
2211
 
2212
+ modelConfigs: Array<SubAgent.UnionMember0 | SubAgent.UnionMember1>;
2213
+
1782
2214
  name: string | null;
1783
2215
 
1784
2216
  systemPrompt: string | null;
1785
2217
 
1786
2218
  tools: Array<SubAgent.Tool>;
1787
-
1788
- ttsModel: string | null;
1789
-
1790
- ttsProvider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME' | null;
1791
-
1792
- ttsSimilarityBoost: number | null;
1793
-
1794
- ttsSpeed: number | null;
1795
-
1796
- ttsStability: number | null;
1797
-
1798
- ttsVoiceId: string | null;
1799
2219
  }
1800
2220
 
1801
2221
  export namespace SubAgent {
@@ -1811,6 +2231,78 @@ export namespace AgentDraftUpdateParams {
1811
2231
  to: 'main' | string;
1812
2232
  }
1813
2233
 
2234
+ export interface UnionMember0 {
2235
+ llm: Array<UnionMember0.Llm>;
2236
+
2237
+ stt: Array<UnionMember0.Stt>;
2238
+
2239
+ tts: Array<UnionMember0.Tt>;
2240
+
2241
+ type: 'CASCADE';
2242
+ }
2243
+
2244
+ export namespace UnionMember0 {
2245
+ export interface Llm {
2246
+ model: string;
2247
+
2248
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
2249
+
2250
+ maxTokens?: number | null;
2251
+
2252
+ temperature?: number | null;
2253
+ }
2254
+
2255
+ export interface Stt {
2256
+ model: string;
2257
+
2258
+ provider: 'DEEPGRAM' | 'OPENAI_WHISPER' | 'SPEECHMATICS' | 'ASSEMBLYAI' | 'ELEVENLABS';
2259
+
2260
+ endpointingMs?: number | null;
2261
+
2262
+ keyterms?: Array<string>;
2263
+
2264
+ smartFormat?: boolean | null;
2265
+
2266
+ turnDetection?: 'pipeline' | 'provider' | null;
2267
+ }
2268
+
2269
+ export interface Tt {
2270
+ model: string;
2271
+
2272
+ provider: 'CARTESIA' | 'ELEVENLABS' | 'OPENAI' | 'RIME';
2273
+
2274
+ voiceId: string;
2275
+
2276
+ similarityBoost?: number | null;
2277
+
2278
+ speed?: number | null;
2279
+
2280
+ stability?: number | null;
2281
+ }
2282
+ }
2283
+
2284
+ export interface UnionMember1 {
2285
+ speechToSpeech: UnionMember1.SpeechToSpeech;
2286
+
2287
+ type: 'SPEECH_TO_SPEECH';
2288
+ }
2289
+
2290
+ export namespace UnionMember1 {
2291
+ export interface SpeechToSpeech {
2292
+ model: string;
2293
+
2294
+ provider: 'OPENAI' | 'ANTHROPIC' | 'GOOGLE' | 'XAI' | 'ULTRAVOX' | 'AWS' | 'ELEVENLABS';
2295
+
2296
+ backendModel?: string | null;
2297
+
2298
+ maxOutputTokens?: number | null;
2299
+
2300
+ temperature?: number | null;
2301
+
2302
+ voice?: string | null;
2303
+ }
2304
+ }
2305
+
1814
2306
  export interface Tool {
1815
2307
  pinnedVersion: number | null;
1816
2308