-
Notifications
You must be signed in to change notification settings - Fork 2
/
api.ts
3317 lines (3189 loc) · 97.7 KB
/
api.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* eslint-disable */
/* tslint:disable */
/*
* ---------------------------------------------------------------
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
* ## ##
* ## AUTHOR: acacode ##
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
* ---------------------------------------------------------------
*/
export interface DeepgramVoice {
/** This is the voice provider that will be used. */
provider: 'deepgram';
/** This is the provider-specific ID that will be used. */
voiceId: 'asteria' | 'luna' | 'hera' | 'athena' | 'varun' | 'leo' | 'perseus' | 'helios' | 'angus' | string;
}
export interface OpenAIMessage {
content: string | null;
role: 'assistant' | 'function' | 'user' | 'system';
function_call?: object;
tool_calls?: object[];
}
export interface JsonSchema {
type: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
items?: object;
/** This is an array of type JsonSchema. However, Swagger doesn't support circular references. */
prefixItems?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
contains?: object;
/** This is a map of string to JsonSchema. However, Swagger doesn't support circular references. */
properties?: object;
/** This is a map of string to JsonSchema objects. However, Swagger doesn't support circular references. */
patternProperties?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
additionalProperties?: object;
/** This is a map of string to JsonSchema objects. However, Swagger doesn't support circular references. */
dependentSchemas?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
propertyNames?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
unevaluatedProperties?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
const?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
not?: object;
/** This is an array of type JsonSchema. However, Swagger doesn't support circular references. */
oneOf?: object;
/** This is an array of type JsonSchema. However, Swagger doesn't support circular references. */
anyOf?: object;
/** This is an array of type JsonSchema. However, Swagger doesn't support circular references. */
allOf?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
if?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
then?: object;
/** This is of type JsonSchema. However, Swagger doesn't support circular references. */
else?: object;
title?: string;
description?: string;
multipleOf?: number;
maximum?: number;
exclusiveMaximum?: number;
minimum?: number;
exclusiveMinimum?: number;
maxLength?: number;
/** @min 0 */
minLength?: number;
pattern?: string;
format?: string;
maxItems?: number;
/** @min 0 */
minItems?: number;
minContains?: number;
maxContains?: number;
maxProperties?: number;
/** @min 0 */
minProperties?: number;
required?: object[];
dependentRequired?: object;
enum?: object[];
$id?: string;
$ref?: string;
$schema?: string;
$comment?: string;
default?: object;
examples?: object[];
readOnly?: boolean;
writeOnly?: boolean;
contentEncoding?: string;
contentMediaType?: string;
}
export interface OpenAIFunctionParameters {
/** This must be set to 'object'. It instructs the model to return a JSON object containing the function call properties. */
type: 'object';
/**
* This provides a description of the properties required by the function.
* JSON Schema can be used to specify expectations for each property.
* Refer to [this doc](https://ajv.js.org/json-schema.html#json-data-type) for a comprehensive guide on JSON Schema.
*/
properties: Record<string, JsonSchema>;
/** This specifies the properties that are required by the function. */
required?: string[];
}
export interface OpenAIFunction {
/**
* This is the the name of the function to be called.
*
* Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
* @maxLength 64
* @pattern /^[a-zA-Z0-9_-]{1,64}$/
*/
name: string;
/** Setting async: true will cause the function to be called asynchronously, meaning that the Assistant will not wait for the function to return before continuing. */
async?: boolean;
/**
* This is the description of what the function does, used by the AI to choose when and how to call the function.
* @maxLength 1000
*/
description?: string;
/**
* These are the parameters the functions accepts, described as a JSON Schema object.
*
* See the [OpenAI guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema) for documentation about the format.
*
* Omitting parameters defines a function with an empty parameter list.
*/
parameters?: OpenAIFunctionParameters;
}
export interface TogetherAIModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
provider: 'together-ai';
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface AnyscaleModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
provider: 'anyscale';
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface OpenRouterModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
provider: 'openrouter';
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface PerplexityAIModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
provider: 'perplexity-ai';
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface DeepInfraModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
provider: 'deepinfra';
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface CustomLLMModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
/** This is the provider that will be used for the model. Any service, including your own server, that is compatible with the OpenAI API can be used. */
provider: 'custom-llm';
/** These is the URL we'll use for the OpenAI client's `baseURL`. Ex. https://openrouter.ai/api/v1 */
url: string;
/** This sets whether the call object is sent in requests to the custom provider. Default is true. */
urlRequestMetadataEnabled: boolean;
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: string;
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface GroqModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
/** The key of the model from the custom provider. Ex. cognitivecomputations/dolphin-mixtral-8x7b */
model: 'mixtral-8x7b-32768';
provider: 'groq';
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface DeepgramTranscriber {
/** This is the transcription provider that will be used. */
provider: 'deepgram';
/** This is the Deepgram model that will be used. A list of models can be found here: https://developers.deepgram.com/docs/models-languages-overview */
model?:
| 'nova-2'
| 'nova-2-general'
| 'nova-2-meeting'
| 'nova-2-phonecall'
| 'nova-2-finance'
| 'nova-2-conversationalai'
| 'nova-2-voicemail'
| 'nova-2-video'
| 'nova-2-medical'
| 'nova-2-drivethru'
| 'nova-2-automotive'
| string;
/** This is the language that will be set for the transcription. The list of languages Deepgram supports can be found here: https://developers.deepgram.com/docs/models-languages-overview */
language?:
| 'cs'
| 'da'
| 'da-DK'
| 'nl'
| 'en'
| 'en-US'
| 'en-AU'
| 'en-GB'
| 'en-NZ'
| 'en-IN'
| 'nl-BE'
| 'fr'
| 'fr-CA'
| 'de'
| 'el'
| 'hi'
| 'hi-Latn'
| 'id'
| 'it'
| 'ja'
| 'ko'
| 'ko-KR'
| 'no'
| 'pl'
| 'pt'
| 'pt-BR'
| 'ru'
| 'es'
| 'es-419'
| 'sv'
| 'sv-SE'
| 'tr'
| 'uk';
/** These keywords are passed to the transcription model to help it pick up use-case specific words. Anything that may not be a common word, like your company name, should be added here. */
keywords?: string[];
}
export interface TalkscriberTranscriber {
/** This is the transcription provider that will be used. */
provider: 'talkscriber';
/** This is the model that will be used for the transcription. */
model?: 'whisper';
/** This is the language that will be set for the transcription. The list of languages Whisper supports can be found here: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py */
language?:
| 'en'
| 'zh'
| 'de'
| 'es'
| 'ru'
| 'ko'
| 'fr'
| 'ja'
| 'pt'
| 'tr'
| 'pl'
| 'ca'
| 'nl'
| 'ar'
| 'sv'
| 'it'
| 'id'
| 'hi'
| 'fi'
| 'vi'
| 'he'
| 'uk'
| 'el'
| 'ms'
| 'cs'
| 'ro'
| 'da'
| 'hu'
| 'ta'
| 'no'
| 'th'
| 'ur'
| 'hr'
| 'bg'
| 'lt'
| 'la'
| 'mi'
| 'ml'
| 'cy'
| 'sk'
| 'te'
| 'fa'
| 'lv'
| 'bn'
| 'sr'
| 'az'
| 'sl'
| 'kn'
| 'et'
| 'mk'
| 'br'
| 'eu'
| 'is'
| 'hy'
| 'ne'
| 'mn'
| 'bs'
| 'kk'
| 'sq'
| 'sw'
| 'gl'
| 'mr'
| 'pa'
| 'si'
| 'km'
| 'sn'
| 'yo'
| 'so'
| 'af'
| 'oc'
| 'ka'
| 'be'
| 'tg'
| 'sd'
| 'gu'
| 'am'
| 'yi'
| 'lo'
| 'uz'
| 'fo'
| 'ht'
| 'ps'
| 'tk'
| 'nn'
| 'mt'
| 'sa'
| 'lb'
| 'my'
| 'bo'
| 'tl'
| 'mg'
| 'as'
| 'tt'
| 'haw'
| 'ln'
| 'ha'
| 'ba'
| 'jw'
| 'su'
| 'yue';
/** This is the mode that will be used for Whisper. If 'transcribe' is selected, the audio will be transcribed in the language selected in 'language' field. If 'translate' is selected, the audio will be translated from language selected in 'language' field to English. Default is 'translate'. */
mode?: 'transcribe' | 'translate';
}
export interface ElevenLabsVoice {
/** This is the voice provider that will be used. */
provider: '11labs';
/** This is the provider-specific ID that will be used. Ensure the Voice is present in your 11Labs Voice Library. */
voiceId:
| 'burt'
| 'marissa'
| 'andrea'
| 'sarah'
| 'phillip'
| 'steve'
| 'joseph'
| 'myra'
| 'paula'
| 'ryan'
| 'drew'
| 'paul'
| 'mrb'
| 'matilda'
| 'mark'
| string;
/**
* Defines the stability for voice settings.
* @min 0
* @max 1
* @example 0.5
*/
stability?: number;
/**
* Defines the similarity boost for voice settings.
* @min 0
* @max 1
* @example 0.75
*/
similarityBoost?: number;
/**
* Defines the style for voice settings.
* @min 0
* @max 1
* @example 0
*/
style?: number;
/**
* Defines the use speaker boost for voice settings.
* @example false
*/
useSpeakerBoost?: boolean;
/**
* Defines the optimize streaming latency for voice settings.
* @min 1
* @max 4
* @example 4
*/
optimizeStreamingLatency?: number;
/**
* This is the model that will be used. Defaults to 'eleven_multilingual_v2' if transcriber.language is non-English, otherwise 'eleven_turbo_v2'.
* @example "eleven_turbo_v2"
*/
model?: 'eleven_multilingual_v2' | 'eleven_turbo_v2';
}
export interface OpenAIModel {
/** This is the starting state for the conversation. */
messages?: OpenAIMessage[];
/** This is the provider that will be used for the model. */
provider: 'openai';
/** This is the OpenAI model that will be used. */
model: 'gpt-4' | 'gpt-3.5-turbo';
/**
* This is the temperature that will be used for calls. Default is 0 to leverage caching for lower latency.
* @min 0
* @max 2
*/
temperature?: number;
/** These are the functions that the assistant can execute during the call. */
functions?: OpenAIFunction[];
/**
* This is the max number of tokens that the assistant will be allowed to generate in each turn of the conversation. Default is 250.
* @min 50
* @max 1000
*/
maxTokens?: number;
}
export interface PlayHTVoice {
/** This is the voice provider that will be used. */
provider: 'playht';
/** This is the provider-specific ID that will be used. */
voiceId:
| 'jennifer'
| 'melissa'
| 'will'
| 'chris'
| 'matt'
| 'jack'
| 'ruby'
| 'davis'
| 'donna'
| 'michael'
| string;
/**
* This is the speed multiplier that will be used.
* @min 0
* @max 5
* @example null
*/
speed?: number;
/**
* A floating point number between 0, exclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.
* @min 0.1
* @max 2
* @example null
*/
temperature?: number;
/**
* An emotion to be applied to the speech.
* @example null
*/
emotion?:
| 'female_happy'
| 'female_sad'
| 'female_angry'
| 'female_fearful'
| 'female_disgust'
| 'female_surprised'
| 'male_happy'
| 'male_sad'
| 'male_angry'
| 'male_fearful'
| 'male_disgust'
| 'male_surprised';
/**
* A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices.
* @min 1
* @max 6
* @example null
*/
voiceGuidance?: number;
/**
* A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance.
* @min 1
* @max 30
* @example null
*/
styleGuidance?: number;
/**
* A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text.
* @min 1
* @max 2
* @example null
*/
textGuidance?: number;
}
export interface RimeAIVoice {
/** This is the voice provider that will be used. */
provider: 'rime-ai';
/** This is the provider-specific ID that will be used. */
voiceId:
| 'kai'
| 'zion'
| 'xavier'
| 'marty'
| 'hudson'
| 'savannah'
| 'colette'
| 'daphne'
| 'aurora'
| 'nova'
| string;
/**
* This is the speed multiplier that will be used.
* @min 0
* @example null
*/
speed?: number;
}
export interface OpenAIVoice {
/** This is the voice provider that will be used. */
provider: 'openai';
/** This is the provider-specific ID that will be used. */
voiceId: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer' | string;
/**
* This is the speed multiplier that will be used.
* @min 0.25
* @max 4
* @example null
*/
speed?: number;
}
export interface AzureVoice {
/** This is the voice provider that will be used. */
provider: 'azure';
/** This is the provider-specific ID that will be used. */
voiceId: 'andrew' | 'brian' | 'emma' | string;
}
export interface LMNTVoice {
/** This is the voice provider that will be used. */
provider: 'lmnt';
/** This is the provider-specific ID that will be used. */
voiceId: 'lily' | 'daniel' | string;
/**
* This is the speed multiplier that will be used.
* @min 0.25
* @max 2
* @example null
*/
speed?: number;
}
export interface ForwardingPhoneNumber {
number: string;
message?: string;
}
export interface CreateAssistantDTO {
/** These are the options for the assistant's transcriber. */
transcriber?: DeepgramTranscriber | TalkscriberTranscriber;
/** These are the options for the assistant's LLM. */
model?:
| OpenAIModel
| TogetherAIModel
| AnyscaleModel
| OpenRouterModel
| PerplexityAIModel
| DeepInfraModel
| GroqModel
| CustomLLMModel;
/**
* These are the options for the assistant's voice.
* @default {"provider":"playht","voiceId":"jennifer"}
*/
voice?: AzureVoice | ElevenLabsVoice | PlayHTVoice | RimeAIVoice | DeepgramVoice | OpenAIVoice | LMNTVoice;
/**
* This is the number to forward to if assistant runs into issues.
* @example null
*/
forwardingPhoneNumber?: string;
/**
* This sets whether the assistant's calls are recorded. Defaults to true.
* @example true
*/
recordingEnabled?: boolean;
/**
* This sets whether the assistant will be able to hang up the call. Defaults to false.
* @example false
*/
endCallFunctionEnabled?: boolean;
/**
* This sets whether the assistant can dial digits on the keypad. Defaults to false.
* @default null
*/
dialKeypadFunctionEnabled?: boolean;
/**
* When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.
* @example false
*/
hipaaEnabled?: boolean;
/**
* These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call', 'speech-update', 'metadata', 'conversation-update']
* @example ["transcript","hang","function-call","speech-update","metadata","conversation-update"]
*/
clientMessages?: (
| 'status-update'
| 'speech-update'
| 'transcript'
| 'hang'
| 'function-call'
| 'metadata'
| 'conversation-update'
)[];
/**
* These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call']
* @example ["end-of-call-report","status-update","hang","function-call"]
*/
serverMessages?: (
| 'status-update'
| 'transcript'
| 'hang'
| 'function-call'
| 'end-of-call-report'
| 'conversation-update'
)[];
/**
* How many seconds of silence to wait before ending the call. Defaults to 30.
* @min 10
* @max 600
* @example 30
*/
silenceTimeoutSeconds?: number;
/**
* The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
* @min 0
* @max 2
* @example 0.4
*/
responseDelaySeconds?: number;
/**
* The minimum number of seconds to wait after punctuation before sending a request to the LLM. Defaults to 0.1.
* @min 0
* @max 3
* @example 0.1
*/
llmRequestDelaySeconds?: number;
/**
* The number of words to wait for before interrupting the assistant. Words like "stop", "actually", "no", etc. will always interrupt immediately regardless of this value. Words like "okay", "yeah", "right" will never interrupt. Defaults to 2.
* @min 1
* @max 10
* @example 2
*/
numWordsToInterruptAssistant?: number;
/**
* This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
* @min 10
* @max 3600
* @example 1800
*/
maxDurationSeconds?: number;
/**
* This is the name of the assistant. This is just for your own reference.
* @maxLength 100
*/
name?: string;
/** You can provide a set of phone numbers to forward to. You'll want to tell the assistant when to use each of these numbers in the system prompt. */
forwardingPhoneNumbers?: ForwardingPhoneNumber[];
/**
* This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
*
* If unspecified, it will wait for the user to speak.
* @maxLength 1000
*/
firstMessage?: string;
/**
* This is the message that the assistant will say if the call is forwarded to voicemail.
*
* If unspecified, it will hang up.
* @maxLength 1000
*/
voicemailMessage?: string;
/**
* This is the message that the assistant will say if it ends the call.
*
* If unspecified, it will hang up without saying anything.
* @maxLength 400
*/
endCallMessage?: string;
/** This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. */
endCallPhrases?: string[];
/** This is the metadata associated with the call. */
metadata?: object;
/**
* This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.
*
* All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.
*
* This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl
*/
serverUrl?: string;
/**
* This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.
*
* Same precendence logic as serverUrl.
*/
serverUrlSecret?: string;
}
export interface Assistant {
/** These are the options for the assistant's transcriber. */
transcriber?: DeepgramTranscriber | TalkscriberTranscriber;
/** These are the options for the assistant's LLM. */
model?:
| OpenAIModel
| TogetherAIModel
| AnyscaleModel
| OpenRouterModel
| PerplexityAIModel
| DeepInfraModel
| GroqModel
| CustomLLMModel;
/**
* These are the options for the assistant's voice.
* @default {"provider":"playht","voiceId":"jennifer"}
*/
voice?: AzureVoice | ElevenLabsVoice | PlayHTVoice | RimeAIVoice | DeepgramVoice | OpenAIVoice | LMNTVoice;
/**
* This is the number to forward to if assistant runs into issues.
* @example null
*/
forwardingPhoneNumber?: string;
/**
* This sets whether the assistant's calls are recorded. Defaults to true.
* @example true
*/
recordingEnabled?: boolean;
/**
* This sets whether the assistant will be able to hang up the call. Defaults to false.
* @example false
*/
endCallFunctionEnabled?: boolean;
/**
* This sets whether the assistant can dial digits on the keypad. Defaults to false.
* @default null
*/
dialKeypadFunctionEnabled?: boolean;
/**
* When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false.
* @example false
*/
hipaaEnabled?: boolean;
/**
* These are the messages that will be sent to the Client SDKs. Default is ['transcript', 'hang', 'function-call', 'speech-update', 'metadata', 'conversation-update']
* @example ["transcript","hang","function-call","speech-update","metadata","conversation-update"]
*/
clientMessages?: (
| 'status-update'
| 'speech-update'
| 'transcript'
| 'hang'
| 'function-call'
| 'metadata'
| 'conversation-update'
)[];
/**
* These are the messages that will be sent to your Server URL. Default is ['end-of-call-report', 'status-update', 'hang', 'function-call']
* @example ["end-of-call-report","status-update","hang","function-call"]
*/
serverMessages?: (
| 'status-update'
| 'transcript'
| 'hang'
| 'function-call'
| 'end-of-call-report'
| 'conversation-update'
)[];
/**
* How many seconds of silence to wait before ending the call. Defaults to 30.
* @min 10
* @max 600
* @example 30
*/
silenceTimeoutSeconds?: number;
/**
* The minimum number of seconds after user speech to wait before the assistant starts speaking. Defaults to 0.4.
* @min 0
* @max 2
* @example 0.4
*/
responseDelaySeconds?: number;
/**
* The minimum number of seconds to wait after punctuation before sending a request to the LLM. Defaults to 0.1.
* @min 0
* @max 3
* @example 0.1
*/
llmRequestDelaySeconds?: number;
/**
* The number of words to wait for before interrupting the assistant. Words like "stop", "actually", "no", etc. will always interrupt immediately regardless of this value. Words like "okay", "yeah", "right" will never interrupt. Defaults to 2.
* @min 1
* @max 10
* @example 2
*/
numWordsToInterruptAssistant?: number;
/**
* This is the maximum number of seconds that the call will last. When the call reaches this duration, it will be ended.
* @min 10
* @max 3600
* @example 1800
*/
maxDurationSeconds?: number;
/**
* This is the name of the assistant. This is just for your own reference.
* @maxLength 100
*/
name?: string;
/** You can provide a set of phone numbers to forward to. You'll want to tell the assistant when to use each of these numbers in the system prompt. */
forwardingPhoneNumbers?: ForwardingPhoneNumber[];
/**
* This is the first message that the assistant will say. This can also be a URL to a containerized audio file (mp3, wav, etc.).
*
* If unspecified, it will wait for the user to speak.
* @maxLength 1000
*/
firstMessage?: string;
/**
* This is the message that the assistant will say if the call is forwarded to voicemail.
*
* If unspecified, it will hang up.
* @maxLength 1000
*/
voicemailMessage?: string;
/**
* This is the message that the assistant will say if it ends the call.
*
* If unspecified, it will hang up without saying anything.
* @maxLength 400
*/
endCallMessage?: string;
/** This list contains phrases that, if spoken by the assistant, will trigger the call to be hung up. Case insensitive. */
endCallPhrases?: string[];
/** This is the metadata associated with the call. */
metadata?: object;
/**
* This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports.
*
* All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.
*
* This overrides the serverUrl set on the org and the phoneNumber. Order of precedence: assistant.serverUrl > phoneNumber.serverUrl > org.serverUrl
*/
serverUrl?: string;
/**
* This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.
*
* Same precendence logic as serverUrl.
*/
serverUrlSecret?: string;
/** This is the unique identifier for the assistant. */
id: string;
/** This is the unique identifier for the org that this assistant belongs to. */
orgId: string;
/**
* This is the ISO 8601 date-time string of when the assistant was created.
* @format date-time
*/
createdAt: string;
/**
* This is the ISO 8601 date-time string of when the assistant was last updated.
* @format date-time
*/
updatedAt: string;
}
export interface UpdateAssistantDTO {
/** These are the options for the assistant's transcriber. */
transcriber?: DeepgramTranscriber | TalkscriberTranscriber;
/** These are the options for the assistant's LLM. */
model?: