@kaana.ai/contracts 5.0.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.
- package/dist/internal/catalogue.d.ts +8 -180
- package/dist/internal/realtime.d.ts +8 -8
- package/dist/internal/request.d.ts +11 -11
- package/dist/public/audio.d.ts +9 -13
- package/dist/public/audio.js +15 -28
- package/dist/public/audioFormats.d.ts +2 -13
- package/dist/public/audioFormats.js +2 -9
- package/dist/public/catalogue.d.ts +13 -310
- package/dist/public/catalogue.js +15 -78
- package/dist/public/chatCompletions.d.ts +1 -1
- package/dist/public/messages.d.ts +1 -1
- package/dist/public/realtime.d.ts +43 -53
- package/dist/public/realtime.js +26 -86
- package/dist/public/responses.d.ts +1 -1
- package/dist/public/version.d.ts +18 -4
- package/dist/public/version.js +18 -4
- package/openapi.json +4 -116
- package/package.json +1 -1
|
@@ -112,50 +112,6 @@ export declare const catalogueModelSchema: z.ZodObject<{
|
|
|
112
112
|
g711_alaw: "g711_alaw";
|
|
113
113
|
}>>;
|
|
114
114
|
}, z.core.$strict>>;
|
|
115
|
-
parameters: z.ZodOptional<z.ZodObject<{
|
|
116
|
-
turnDetection: z.ZodArray<z.ZodObject<{
|
|
117
|
-
type: z.ZodEnum<{
|
|
118
|
-
none: "none";
|
|
119
|
-
server_vad: "server_vad";
|
|
120
|
-
semantic_vad: "semantic_vad";
|
|
121
|
-
}>;
|
|
122
|
-
fixedResponses: z.ZodBoolean;
|
|
123
|
-
threshold: z.ZodOptional<z.ZodObject<{
|
|
124
|
-
min: z.ZodNumber;
|
|
125
|
-
max: z.ZodNumber;
|
|
126
|
-
}, z.core.$strict>>;
|
|
127
|
-
meteredUnits: z.ZodArray<z.ZodEnum<{
|
|
128
|
-
input_tokens: "input_tokens";
|
|
129
|
-
cached_input_tokens: "cached_input_tokens";
|
|
130
|
-
output_tokens: "output_tokens";
|
|
131
|
-
reasoning_tokens: "reasoning_tokens";
|
|
132
|
-
requests: "requests";
|
|
133
|
-
images: "images";
|
|
134
|
-
audio_input_milliseconds: "audio_input_milliseconds";
|
|
135
|
-
audio_output_milliseconds: "audio_output_milliseconds";
|
|
136
|
-
video_milliseconds: "video_milliseconds";
|
|
137
|
-
characters: "characters";
|
|
138
|
-
embeddings: "embeddings";
|
|
139
|
-
audio_input_tokens: "audio_input_tokens";
|
|
140
|
-
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
141
|
-
audio_output_tokens: "audio_output_tokens";
|
|
142
|
-
session_milliseconds: "session_milliseconds";
|
|
143
|
-
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
144
|
-
}>>;
|
|
145
|
-
}, z.core.$strict>>;
|
|
146
|
-
outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
|
|
147
|
-
text: "text";
|
|
148
|
-
audio: "audio";
|
|
149
|
-
}>>>;
|
|
150
|
-
toolChoice: z.ZodArray<z.ZodEnum<{
|
|
151
|
-
function: "function";
|
|
152
|
-
none: "none";
|
|
153
|
-
auto: "auto";
|
|
154
|
-
required: "required";
|
|
155
|
-
}>>;
|
|
156
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
157
|
-
inputTranscriptionPrompt: z.ZodBoolean;
|
|
158
|
-
}, z.core.$strict>>;
|
|
159
115
|
}, z.core.$strict>>;
|
|
160
116
|
}, z.core.$strict>;
|
|
161
117
|
license: z.ZodObject<{
|
|
@@ -509,50 +465,6 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
509
465
|
g711_alaw: "g711_alaw";
|
|
510
466
|
}>>;
|
|
511
467
|
}, z.core.$strict>>;
|
|
512
|
-
parameters: z.ZodOptional<z.ZodObject<{
|
|
513
|
-
turnDetection: z.ZodArray<z.ZodObject<{
|
|
514
|
-
type: z.ZodEnum<{
|
|
515
|
-
none: "none";
|
|
516
|
-
server_vad: "server_vad";
|
|
517
|
-
semantic_vad: "semantic_vad";
|
|
518
|
-
}>;
|
|
519
|
-
fixedResponses: z.ZodBoolean;
|
|
520
|
-
threshold: z.ZodOptional<z.ZodObject<{
|
|
521
|
-
min: z.ZodNumber;
|
|
522
|
-
max: z.ZodNumber;
|
|
523
|
-
}, z.core.$strict>>;
|
|
524
|
-
meteredUnits: z.ZodArray<z.ZodEnum<{
|
|
525
|
-
input_tokens: "input_tokens";
|
|
526
|
-
cached_input_tokens: "cached_input_tokens";
|
|
527
|
-
output_tokens: "output_tokens";
|
|
528
|
-
reasoning_tokens: "reasoning_tokens";
|
|
529
|
-
requests: "requests";
|
|
530
|
-
images: "images";
|
|
531
|
-
audio_input_milliseconds: "audio_input_milliseconds";
|
|
532
|
-
audio_output_milliseconds: "audio_output_milliseconds";
|
|
533
|
-
video_milliseconds: "video_milliseconds";
|
|
534
|
-
characters: "characters";
|
|
535
|
-
embeddings: "embeddings";
|
|
536
|
-
audio_input_tokens: "audio_input_tokens";
|
|
537
|
-
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
538
|
-
audio_output_tokens: "audio_output_tokens";
|
|
539
|
-
session_milliseconds: "session_milliseconds";
|
|
540
|
-
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
541
|
-
}>>;
|
|
542
|
-
}, z.core.$strict>>;
|
|
543
|
-
outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
|
|
544
|
-
text: "text";
|
|
545
|
-
audio: "audio";
|
|
546
|
-
}>>>;
|
|
547
|
-
toolChoice: z.ZodArray<z.ZodEnum<{
|
|
548
|
-
function: "function";
|
|
549
|
-
none: "none";
|
|
550
|
-
auto: "auto";
|
|
551
|
-
required: "required";
|
|
552
|
-
}>>;
|
|
553
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
554
|
-
inputTranscriptionPrompt: z.ZodBoolean;
|
|
555
|
-
}, z.core.$strict>>;
|
|
556
468
|
}, z.core.$strict>>;
|
|
557
469
|
}, z.core.$strict>;
|
|
558
470
|
license: z.ZodObject<{
|
|
@@ -705,8 +617,6 @@ export declare const declaredModelSchema: z.ZodObject<{
|
|
|
705
617
|
}>>;
|
|
706
618
|
}, z.core.$strict>>;
|
|
707
619
|
languages: z.ZodArray<z.ZodString>;
|
|
708
|
-
detectsLanguage: z.ZodOptional<z.ZodBoolean>;
|
|
709
|
-
transcriptionPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
710
620
|
audioFormats: z.ZodObject<{
|
|
711
621
|
input: z.ZodArray<z.ZodEnum<{
|
|
712
622
|
"audio/mpeg": "audio/mpeg";
|
|
@@ -803,50 +713,6 @@ export declare const declaredModelSchema: z.ZodObject<{
|
|
|
803
713
|
g711_alaw: "g711_alaw";
|
|
804
714
|
}>>;
|
|
805
715
|
}, z.core.$strict>>;
|
|
806
|
-
parameters: z.ZodOptional<z.ZodObject<{
|
|
807
|
-
turnDetection: z.ZodArray<z.ZodObject<{
|
|
808
|
-
type: z.ZodEnum<{
|
|
809
|
-
none: "none";
|
|
810
|
-
server_vad: "server_vad";
|
|
811
|
-
semantic_vad: "semantic_vad";
|
|
812
|
-
}>;
|
|
813
|
-
fixedResponses: z.ZodBoolean;
|
|
814
|
-
threshold: z.ZodOptional<z.ZodObject<{
|
|
815
|
-
min: z.ZodNumber;
|
|
816
|
-
max: z.ZodNumber;
|
|
817
|
-
}, z.core.$strict>>;
|
|
818
|
-
meteredUnits: z.ZodArray<z.ZodEnum<{
|
|
819
|
-
input_tokens: "input_tokens";
|
|
820
|
-
cached_input_tokens: "cached_input_tokens";
|
|
821
|
-
output_tokens: "output_tokens";
|
|
822
|
-
reasoning_tokens: "reasoning_tokens";
|
|
823
|
-
requests: "requests";
|
|
824
|
-
images: "images";
|
|
825
|
-
audio_input_milliseconds: "audio_input_milliseconds";
|
|
826
|
-
audio_output_milliseconds: "audio_output_milliseconds";
|
|
827
|
-
video_milliseconds: "video_milliseconds";
|
|
828
|
-
characters: "characters";
|
|
829
|
-
embeddings: "embeddings";
|
|
830
|
-
audio_input_tokens: "audio_input_tokens";
|
|
831
|
-
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
832
|
-
audio_output_tokens: "audio_output_tokens";
|
|
833
|
-
session_milliseconds: "session_milliseconds";
|
|
834
|
-
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
835
|
-
}>>;
|
|
836
|
-
}, z.core.$strict>>;
|
|
837
|
-
outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
|
|
838
|
-
text: "text";
|
|
839
|
-
audio: "audio";
|
|
840
|
-
}>>>;
|
|
841
|
-
toolChoice: z.ZodArray<z.ZodEnum<{
|
|
842
|
-
function: "function";
|
|
843
|
-
none: "none";
|
|
844
|
-
auto: "auto";
|
|
845
|
-
required: "required";
|
|
846
|
-
}>>;
|
|
847
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
848
|
-
inputTranscriptionPrompt: z.ZodBoolean;
|
|
849
|
-
}, z.core.$strict>>;
|
|
850
716
|
}, z.core.$strict>>;
|
|
851
717
|
}, z.core.$strict>;
|
|
852
718
|
license: z.ZodObject<{
|
|
@@ -917,6 +783,10 @@ export declare const declaredModelSchema: z.ZodObject<{
|
|
|
917
783
|
currency: z.ZodString;
|
|
918
784
|
}, z.core.$strict>>;
|
|
919
785
|
}, z.core.$strict>>;
|
|
786
|
+
pricePerMinute: z.ZodOptional<z.ZodObject<{
|
|
787
|
+
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
788
|
+
currency: z.ZodString;
|
|
789
|
+
}, z.core.$strict>>;
|
|
920
790
|
evaluations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
921
791
|
suite: z.ZodString;
|
|
922
792
|
metric: z.ZodString;
|
|
@@ -975,8 +845,6 @@ export declare const declaredCatalogueSchema: z.ZodObject<{
|
|
|
975
845
|
}>>;
|
|
976
846
|
}, z.core.$strict>>;
|
|
977
847
|
languages: z.ZodArray<z.ZodString>;
|
|
978
|
-
detectsLanguage: z.ZodOptional<z.ZodBoolean>;
|
|
979
|
-
transcriptionPrompt: z.ZodOptional<z.ZodBoolean>;
|
|
980
848
|
audioFormats: z.ZodObject<{
|
|
981
849
|
input: z.ZodArray<z.ZodEnum<{
|
|
982
850
|
"audio/mpeg": "audio/mpeg";
|
|
@@ -1073,50 +941,6 @@ export declare const declaredCatalogueSchema: z.ZodObject<{
|
|
|
1073
941
|
g711_alaw: "g711_alaw";
|
|
1074
942
|
}>>;
|
|
1075
943
|
}, z.core.$strict>>;
|
|
1076
|
-
parameters: z.ZodOptional<z.ZodObject<{
|
|
1077
|
-
turnDetection: z.ZodArray<z.ZodObject<{
|
|
1078
|
-
type: z.ZodEnum<{
|
|
1079
|
-
none: "none";
|
|
1080
|
-
server_vad: "server_vad";
|
|
1081
|
-
semantic_vad: "semantic_vad";
|
|
1082
|
-
}>;
|
|
1083
|
-
fixedResponses: z.ZodBoolean;
|
|
1084
|
-
threshold: z.ZodOptional<z.ZodObject<{
|
|
1085
|
-
min: z.ZodNumber;
|
|
1086
|
-
max: z.ZodNumber;
|
|
1087
|
-
}, z.core.$strict>>;
|
|
1088
|
-
meteredUnits: z.ZodArray<z.ZodEnum<{
|
|
1089
|
-
input_tokens: "input_tokens";
|
|
1090
|
-
cached_input_tokens: "cached_input_tokens";
|
|
1091
|
-
output_tokens: "output_tokens";
|
|
1092
|
-
reasoning_tokens: "reasoning_tokens";
|
|
1093
|
-
requests: "requests";
|
|
1094
|
-
images: "images";
|
|
1095
|
-
audio_input_milliseconds: "audio_input_milliseconds";
|
|
1096
|
-
audio_output_milliseconds: "audio_output_milliseconds";
|
|
1097
|
-
video_milliseconds: "video_milliseconds";
|
|
1098
|
-
characters: "characters";
|
|
1099
|
-
embeddings: "embeddings";
|
|
1100
|
-
audio_input_tokens: "audio_input_tokens";
|
|
1101
|
-
cached_audio_input_tokens: "cached_audio_input_tokens";
|
|
1102
|
-
audio_output_tokens: "audio_output_tokens";
|
|
1103
|
-
session_milliseconds: "session_milliseconds";
|
|
1104
|
-
input_transcription_milliseconds: "input_transcription_milliseconds";
|
|
1105
|
-
}>>;
|
|
1106
|
-
}, z.core.$strict>>;
|
|
1107
|
-
outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
|
|
1108
|
-
text: "text";
|
|
1109
|
-
audio: "audio";
|
|
1110
|
-
}>>>;
|
|
1111
|
-
toolChoice: z.ZodArray<z.ZodEnum<{
|
|
1112
|
-
function: "function";
|
|
1113
|
-
none: "none";
|
|
1114
|
-
auto: "auto";
|
|
1115
|
-
required: "required";
|
|
1116
|
-
}>>;
|
|
1117
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1118
|
-
inputTranscriptionPrompt: z.ZodBoolean;
|
|
1119
|
-
}, z.core.$strict>>;
|
|
1120
944
|
}, z.core.$strict>>;
|
|
1121
945
|
}, z.core.$strict>;
|
|
1122
946
|
license: z.ZodObject<{
|
|
@@ -1187,6 +1011,10 @@ export declare const declaredCatalogueSchema: z.ZodObject<{
|
|
|
1187
1011
|
currency: z.ZodString;
|
|
1188
1012
|
}, z.core.$strict>>;
|
|
1189
1013
|
}, z.core.$strict>>;
|
|
1014
|
+
pricePerMinute: z.ZodOptional<z.ZodObject<{
|
|
1015
|
+
amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
|
|
1016
|
+
currency: z.ZodString;
|
|
1017
|
+
}, z.core.$strict>>;
|
|
1190
1018
|
evaluations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
1191
1019
|
suite: z.ZodString;
|
|
1192
1020
|
metric: z.ZodString;
|
|
@@ -102,12 +102,12 @@ export declare const realtimeSessionRequestSchema: z.ZodObject<{
|
|
|
102
102
|
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
103
103
|
type: z.ZodLiteral<"function">;
|
|
104
104
|
name: z.ZodString;
|
|
105
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
106
105
|
description: z.ZodOptional<z.ZodString>;
|
|
106
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
107
107
|
}, z.core.$strict>>>;
|
|
108
108
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
109
|
-
none: "none";
|
|
110
109
|
auto: "auto";
|
|
110
|
+
none: "none";
|
|
111
111
|
required: "required";
|
|
112
112
|
}>, z.ZodObject<{
|
|
113
113
|
type: z.ZodLiteral<"function">;
|
|
@@ -242,12 +242,12 @@ export declare const realtimeSessionCreatedEventSchema: z.ZodObject<{
|
|
|
242
242
|
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
243
243
|
type: z.ZodLiteral<"function">;
|
|
244
244
|
name: z.ZodString;
|
|
245
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
246
245
|
description: z.ZodOptional<z.ZodString>;
|
|
246
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
247
247
|
}, z.core.$strict>>>;
|
|
248
248
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
249
|
-
none: "none";
|
|
250
249
|
auto: "auto";
|
|
250
|
+
none: "none";
|
|
251
251
|
required: "required";
|
|
252
252
|
}>, z.ZodObject<{
|
|
253
253
|
type: z.ZodLiteral<"function">;
|
|
@@ -499,12 +499,12 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
499
499
|
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
500
500
|
type: z.ZodLiteral<"function">;
|
|
501
501
|
name: z.ZodString;
|
|
502
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
503
502
|
description: z.ZodOptional<z.ZodString>;
|
|
503
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
504
504
|
}, z.core.$strict>>>;
|
|
505
505
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
506
|
-
none: "none";
|
|
507
506
|
auto: "auto";
|
|
507
|
+
none: "none";
|
|
508
508
|
required: "required";
|
|
509
509
|
}>, z.ZodObject<{
|
|
510
510
|
type: z.ZodLiteral<"function">;
|
|
@@ -575,12 +575,12 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
575
575
|
tools: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
576
576
|
type: z.ZodLiteral<"function">;
|
|
577
577
|
name: z.ZodString;
|
|
578
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
579
578
|
description: z.ZodOptional<z.ZodString>;
|
|
579
|
+
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
580
580
|
}, z.core.$strict>>>;
|
|
581
581
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
582
|
-
none: "none";
|
|
583
582
|
auto: "auto";
|
|
583
|
+
none: "none";
|
|
584
584
|
required: "required";
|
|
585
585
|
}>, z.ZodObject<{
|
|
586
586
|
type: z.ZodLiteral<"function">;
|
|
@@ -366,8 +366,8 @@ export declare const inferenceRequestSchema: z.ZodObject<{
|
|
|
366
366
|
strict: z.ZodOptional<z.ZodBoolean>;
|
|
367
367
|
}, z.core.$strict>>>;
|
|
368
368
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
369
|
-
none: "none";
|
|
370
369
|
auto: "auto";
|
|
370
|
+
none: "none";
|
|
371
371
|
required: "required";
|
|
372
372
|
}>, z.ZodObject<{
|
|
373
373
|
type: z.ZodLiteral<"function">;
|
|
@@ -645,8 +645,8 @@ export declare const scopedInferenceRequestSchema: z.ZodObject<{
|
|
|
645
645
|
strict: z.ZodOptional<z.ZodBoolean>;
|
|
646
646
|
}, z.core.$strict>>>;
|
|
647
647
|
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
648
|
-
none: "none";
|
|
649
648
|
auto: "auto";
|
|
649
|
+
none: "none";
|
|
650
650
|
required: "required";
|
|
651
651
|
}>, z.ZodObject<{
|
|
652
652
|
type: z.ZodLiteral<"function">;
|
|
@@ -876,15 +876,6 @@ export declare const privateAutoInferenceRequestSchema: z.ZodObject<{
|
|
|
876
876
|
language: z.ZodOptional<z.ZodString>;
|
|
877
877
|
prompt: z.ZodOptional<z.ZodString>;
|
|
878
878
|
}, z.core.$strict>>;
|
|
879
|
-
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
880
|
-
none: "none";
|
|
881
|
-
auto: "auto";
|
|
882
|
-
required: "required";
|
|
883
|
-
}>, z.ZodObject<{
|
|
884
|
-
type: z.ZodLiteral<"function">;
|
|
885
|
-
name: z.ZodString;
|
|
886
|
-
}, z.core.$strict>]>>;
|
|
887
|
-
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
888
879
|
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
889
880
|
type: z.ZodLiteral<"function">;
|
|
890
881
|
name: z.ZodString;
|
|
@@ -892,6 +883,7 @@ export declare const privateAutoInferenceRequestSchema: z.ZodObject<{
|
|
|
892
883
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
893
884
|
strict: z.ZodOptional<z.ZodBoolean>;
|
|
894
885
|
}, z.core.$strict>>>;
|
|
886
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
895
887
|
stream: z.ZodBoolean;
|
|
896
888
|
responseFormat: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
897
889
|
type: z.ZodLiteral<"text">;
|
|
@@ -903,6 +895,14 @@ export declare const privateAutoInferenceRequestSchema: z.ZodObject<{
|
|
|
903
895
|
schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
904
896
|
strict: z.ZodBoolean;
|
|
905
897
|
}, z.core.$strict>], "type">>;
|
|
898
|
+
toolChoice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
899
|
+
auto: "auto";
|
|
900
|
+
none: "none";
|
|
901
|
+
required: "required";
|
|
902
|
+
}>, z.ZodObject<{
|
|
903
|
+
type: z.ZodLiteral<"function">;
|
|
904
|
+
name: z.ZodString;
|
|
905
|
+
}, z.core.$strict>]>>;
|
|
906
906
|
routingPolicy: z.ZodObject<{
|
|
907
907
|
routingPolicyId: z.ZodString;
|
|
908
908
|
policyVersion: z.ZodNumber;
|
package/dist/public/audio.d.ts
CHANGED
|
@@ -320,23 +320,19 @@ export declare const transcriptionSchema: z.ZodObject<{
|
|
|
320
320
|
/** Why a transcription request cannot be served by a model, before anything is held. */
|
|
321
321
|
export interface TranscriptionRequestIssue {
|
|
322
322
|
/** The request's field at fault, as `invalid_request.param` names it. */
|
|
323
|
-
readonly param: 'file'
|
|
323
|
+
readonly param: 'file';
|
|
324
324
|
readonly message: string;
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
|
-
* Check a transcription
|
|
328
|
-
* transcription counterpart of {@link checkSpeechRequest}. Kaana refuses
|
|
329
|
-
*
|
|
330
|
-
* Oxy for a grant
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* `mediaType` is the upload's
|
|
334
|
-
* `audio.mediaType` of the JSON form). Returns every issue, in field order.
|
|
327
|
+
* Check a transcription upload against the model's published `audio` — the
|
|
328
|
+
* transcription counterpart of {@link checkSpeechRequest}. Kaana refuses an
|
|
329
|
+
* upload in a format the model does not read with `invalid_request` and
|
|
330
|
+
* `param: 'file'` BEFORE asking Oxy for a grant. A language or a prompt is
|
|
331
|
+
* never refused: Kaana sends the provider its spelling of the language, or
|
|
332
|
+
* none for the model to detect, and the prompt where it is taken (Kaana ADR
|
|
333
|
+
* 0003). `mediaType` is the upload's.
|
|
335
334
|
*/
|
|
336
|
-
export declare function checkTranscriptionRequest(
|
|
337
|
-
readonly language?: string;
|
|
338
|
-
readonly prompt?: string;
|
|
339
|
-
}, mediaType: AudioInputMediaType, audio: ModelAudioCapabilities): TranscriptionRequestIssue[];
|
|
335
|
+
export declare function checkTranscriptionRequest(mediaType: AudioInputMediaType, audio: ModelAudioCapabilities): TranscriptionRequestIssue[];
|
|
340
336
|
export type SpeechStreamFormat = z.infer<typeof speechStreamFormatSchema>;
|
|
341
337
|
export type SpeechRequest = z.infer<typeof speechRequestSchema>;
|
|
342
338
|
export type SpeechAudioDeltaEvent = z.infer<typeof speechAudioDeltaEventSchema>;
|
package/dist/public/audio.js
CHANGED
|
@@ -161,13 +161,13 @@ export const transcriptionRequestSchema = z
|
|
|
161
161
|
.object({
|
|
162
162
|
model: modelReferenceSchema,
|
|
163
163
|
/**
|
|
164
|
-
* The spoken language, when known
|
|
165
|
-
*
|
|
164
|
+
* The spoken language, when known, as the client's own BCP 47 tag. Kaana
|
|
165
|
+
* sends the provider its spelling of it, or none for the model to detect.
|
|
166
166
|
*/
|
|
167
167
|
language: languageTagSchema.optional(),
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
169
|
+
* A hint — vocabulary or context that helps the model, never an
|
|
170
|
+
* instruction — used where the model takes one.
|
|
171
171
|
*/
|
|
172
172
|
prompt: z.string().max(4096).optional(),
|
|
173
173
|
})
|
|
@@ -221,29 +221,16 @@ export const transcriptionSchema = z
|
|
|
221
221
|
})
|
|
222
222
|
.strict();
|
|
223
223
|
/**
|
|
224
|
-
* Check a transcription
|
|
225
|
-
* transcription counterpart of {@link checkSpeechRequest}. Kaana refuses
|
|
226
|
-
*
|
|
227
|
-
* Oxy for a grant
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* `mediaType` is the upload's
|
|
231
|
-
* `audio.mediaType` of the JSON form). Returns every issue, in field order.
|
|
224
|
+
* Check a transcription upload against the model's published `audio` — the
|
|
225
|
+
* transcription counterpart of {@link checkSpeechRequest}. Kaana refuses an
|
|
226
|
+
* upload in a format the model does not read with `invalid_request` and
|
|
227
|
+
* `param: 'file'` BEFORE asking Oxy for a grant. A language or a prompt is
|
|
228
|
+
* never refused: Kaana sends the provider its spelling of the language, or
|
|
229
|
+
* none for the model to detect, and the prompt where it is taken (Kaana ADR
|
|
230
|
+
* 0003). `mediaType` is the upload's.
|
|
232
231
|
*/
|
|
233
|
-
export function checkTranscriptionRequest(
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
if (request.language !== undefined && !audio.languages.includes(request.language)) {
|
|
239
|
-
issues.push({
|
|
240
|
-
param: 'language',
|
|
241
|
-
message: `this model does not declare the language ${request.language}` +
|
|
242
|
-
(audio.detectsLanguage === true ? '; omit it to let the model detect the language' : ''),
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
if (request.prompt !== undefined && audio.transcriptionPrompt !== true) {
|
|
246
|
-
issues.push({ param: 'prompt', message: 'this model takes no prompt' });
|
|
247
|
-
}
|
|
248
|
-
return issues;
|
|
232
|
+
export function checkTranscriptionRequest(mediaType, audio) {
|
|
233
|
+
return audio.audioFormats.input.includes(mediaType)
|
|
234
|
+
? []
|
|
235
|
+
: [{ param: 'file', message: `this model does not take ${mediaType} audio` }];
|
|
249
236
|
}
|
|
@@ -51,24 +51,13 @@ export declare const realtimeAudioFormatSchema: z.ZodEnum<{
|
|
|
51
51
|
g711_alaw: "g711_alaw";
|
|
52
52
|
}>;
|
|
53
53
|
/**
|
|
54
|
-
* What a session's responses produce. Declared here, beside the encodings
|
|
55
|
-
*
|
|
56
|
-
* sets of them a model serves (`capabilities.realtime.parameters`).
|
|
54
|
+
* What a session's responses produce. Declared here, beside the encodings,
|
|
55
|
+
* since contract set 5.0.0.
|
|
57
56
|
*/
|
|
58
57
|
export declare const realtimeOutputModalitySchema: z.ZodEnum<{
|
|
59
58
|
text: "text";
|
|
60
59
|
audio: "audio";
|
|
61
60
|
}>;
|
|
62
|
-
/**
|
|
63
|
-
* How the end of a caller's turn is detected: the discriminant of
|
|
64
|
-
* `realtimeTurnDetectionSchema`, published per model by the catalogue
|
|
65
|
-
* (contract set 5.0.0).
|
|
66
|
-
*/
|
|
67
|
-
export declare const realtimeTurnDetectionTypeSchema: z.ZodEnum<{
|
|
68
|
-
none: "none";
|
|
69
|
-
server_vad: "server_vad";
|
|
70
|
-
semantic_vad: "semantic_vad";
|
|
71
|
-
}>;
|
|
72
61
|
/**
|
|
73
62
|
* The media type a speech request's `response_format` produces. A client
|
|
74
63
|
* knows it before the first byte, which is why the speech stream events do
|
|
@@ -43,17 +43,10 @@ export const audioInputMediaTypeSchema = z.enum([
|
|
|
43
43
|
*/
|
|
44
44
|
export const realtimeAudioFormatSchema = z.enum(['pcm16_24khz', 'g711_ulaw', 'g711_alaw']);
|
|
45
45
|
/**
|
|
46
|
-
* What a session's responses produce. Declared here, beside the encodings
|
|
47
|
-
*
|
|
48
|
-
* sets of them a model serves (`capabilities.realtime.parameters`).
|
|
46
|
+
* What a session's responses produce. Declared here, beside the encodings,
|
|
47
|
+
* since contract set 5.0.0.
|
|
49
48
|
*/
|
|
50
49
|
export const realtimeOutputModalitySchema = z.enum(['text', 'audio']);
|
|
51
|
-
/**
|
|
52
|
-
* How the end of a caller's turn is detected: the discriminant of
|
|
53
|
-
* `realtimeTurnDetectionSchema`, published per model by the catalogue
|
|
54
|
-
* (contract set 5.0.0).
|
|
55
|
-
*/
|
|
56
|
-
export const realtimeTurnDetectionTypeSchema = z.enum(['none', 'server_vad', 'semantic_vad']);
|
|
57
50
|
const SPEECH_MEDIA_TYPES = {
|
|
58
51
|
mp3: 'audio/mpeg',
|
|
59
52
|
opus: 'audio/ogg',
|