@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.
@@ -116,120 +116,6 @@ export declare const realtimeSessionKindSchema: z.ZodEnum<{
116
116
  export declare const realtimeSessionTransportSchema: z.ZodEnum<{
117
117
  websocket: "websocket";
118
118
  }>;
119
- /** A closed interval. */
120
- export declare const numberRangeSchema: z.ZodObject<{
121
- min: z.ZodNumber;
122
- max: z.ZodNumber;
123
- }, z.core.$strict>;
124
- /** One kind of tool choice: the modes, and `function` for one that names a tool. */
125
- export declare const realtimeToolChoiceKindSchema: z.ZodEnum<{
126
- function: "function";
127
- none: "none";
128
- auto: "auto";
129
- required: "required";
130
- }>;
131
- /**
132
- * One turn detection a realtime model serves (contract set 5.0.0).
133
- *
134
- * - `fixedResponses` — the detection always answers the turn it detected and
135
- * lets the caller's speech interrupt the answer: it has neither switch, so a
136
- * session must state `createResponse: true` and `interruptResponse: true`.
137
- * - `threshold` — server_vad's `threshold` range; absent, the contract's 0–1.
138
- * - `meteredUnits` — the units a session under this detection is billed in:
139
- * what a caller multiplies the model's prices by to estimate a call. A
140
- * provider that bills by the clock under one detection and by the audio
141
- * under another states each.
142
- */
143
- export declare const realtimeTurnDetectionParametersSchema: z.ZodObject<{
144
- type: z.ZodEnum<{
145
- none: "none";
146
- server_vad: "server_vad";
147
- semantic_vad: "semantic_vad";
148
- }>;
149
- fixedResponses: z.ZodBoolean;
150
- threshold: z.ZodOptional<z.ZodObject<{
151
- min: z.ZodNumber;
152
- max: z.ZodNumber;
153
- }, z.core.$strict>>;
154
- meteredUnits: z.ZodArray<z.ZodEnum<{
155
- input_tokens: "input_tokens";
156
- cached_input_tokens: "cached_input_tokens";
157
- output_tokens: "output_tokens";
158
- reasoning_tokens: "reasoning_tokens";
159
- requests: "requests";
160
- images: "images";
161
- audio_input_milliseconds: "audio_input_milliseconds";
162
- audio_output_milliseconds: "audio_output_milliseconds";
163
- video_milliseconds: "video_milliseconds";
164
- characters: "characters";
165
- embeddings: "embeddings";
166
- audio_input_tokens: "audio_input_tokens";
167
- cached_audio_input_tokens: "cached_audio_input_tokens";
168
- audio_output_tokens: "audio_output_tokens";
169
- session_milliseconds: "session_milliseconds";
170
- input_transcription_milliseconds: "input_transcription_milliseconds";
171
- }>>;
172
- }, z.core.$strict>;
173
- /**
174
- * What a realtime model's session configuration may set, and within which
175
- * bounds (contract set 5.0.0): the provider's reviewed statement, which Kaana's
176
- * adapter enforces and the catalogue publishes, so a session built from it is
177
- * one the model serves. `checkRealtimeSessionOpen` applies it.
178
- *
179
- * - `turnDetection` — every detection served.
180
- * - `outputModalities` — every set of modalities one response may produce
181
- * (each sorted): a model that answers aloud whatever it is asked does not
182
- * serve `["text"]`.
183
- * - `toolChoice` — every kind of tool choice served; always holds `auto`.
184
- * - `maxOutputTokens` — the largest per-response cap; absent, the model has
185
- * none and `maxOutputTokens` is refused.
186
- * - `inputTranscriptionPrompt` — `config.inputAudioTranscription.prompt` is
187
- * taken.
188
- */
189
- export declare const realtimeParametersSchema: z.ZodObject<{
190
- turnDetection: z.ZodArray<z.ZodObject<{
191
- type: z.ZodEnum<{
192
- none: "none";
193
- server_vad: "server_vad";
194
- semantic_vad: "semantic_vad";
195
- }>;
196
- fixedResponses: z.ZodBoolean;
197
- threshold: z.ZodOptional<z.ZodObject<{
198
- min: z.ZodNumber;
199
- max: z.ZodNumber;
200
- }, z.core.$strict>>;
201
- meteredUnits: z.ZodArray<z.ZodEnum<{
202
- input_tokens: "input_tokens";
203
- cached_input_tokens: "cached_input_tokens";
204
- output_tokens: "output_tokens";
205
- reasoning_tokens: "reasoning_tokens";
206
- requests: "requests";
207
- images: "images";
208
- audio_input_milliseconds: "audio_input_milliseconds";
209
- audio_output_milliseconds: "audio_output_milliseconds";
210
- video_milliseconds: "video_milliseconds";
211
- characters: "characters";
212
- embeddings: "embeddings";
213
- audio_input_tokens: "audio_input_tokens";
214
- cached_audio_input_tokens: "cached_audio_input_tokens";
215
- audio_output_tokens: "audio_output_tokens";
216
- session_milliseconds: "session_milliseconds";
217
- input_transcription_milliseconds: "input_transcription_milliseconds";
218
- }>>;
219
- }, z.core.$strict>>;
220
- outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
221
- text: "text";
222
- audio: "audio";
223
- }>>>;
224
- toolChoice: z.ZodArray<z.ZodEnum<{
225
- function: "function";
226
- none: "none";
227
- auto: "auto";
228
- required: "required";
229
- }>>;
230
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
231
- inputTranscriptionPrompt: z.ZodBoolean;
232
- }, z.core.$strict>;
233
119
  /**
234
120
  * What a deployment can execute as a realtime session. Present only on a model
235
121
  * that holds sessions; absent means it holds none, which is the state of every
@@ -247,8 +133,6 @@ export declare const realtimeParametersSchema: z.ZodObject<{
247
133
  * - `audioFormats` — the realtime encodings a session may name as
248
134
  * `config.inputAudioFormat` and `config.outputAudioFormat`. These are not the
249
135
  * media types of `audio.audioFormats`, which describe files.
250
- * - `parameters` (contract set 5.0.0) — what a session configuration may set
251
- * ({@link realtimeParametersSchema}). Absent: undeclared, not checked.
252
136
  */
253
137
  export declare const modelRealtimeCapabilitiesSchema: z.ZodObject<{
254
138
  transports: z.ZodArray<z.ZodEnum<{
@@ -272,50 +156,6 @@ export declare const modelRealtimeCapabilitiesSchema: z.ZodObject<{
272
156
  g711_alaw: "g711_alaw";
273
157
  }>>;
274
158
  }, z.core.$strict>>;
275
- parameters: z.ZodOptional<z.ZodObject<{
276
- turnDetection: z.ZodArray<z.ZodObject<{
277
- type: z.ZodEnum<{
278
- none: "none";
279
- server_vad: "server_vad";
280
- semantic_vad: "semantic_vad";
281
- }>;
282
- fixedResponses: z.ZodBoolean;
283
- threshold: z.ZodOptional<z.ZodObject<{
284
- min: z.ZodNumber;
285
- max: z.ZodNumber;
286
- }, z.core.$strict>>;
287
- meteredUnits: z.ZodArray<z.ZodEnum<{
288
- input_tokens: "input_tokens";
289
- cached_input_tokens: "cached_input_tokens";
290
- output_tokens: "output_tokens";
291
- reasoning_tokens: "reasoning_tokens";
292
- requests: "requests";
293
- images: "images";
294
- audio_input_milliseconds: "audio_input_milliseconds";
295
- audio_output_milliseconds: "audio_output_milliseconds";
296
- video_milliseconds: "video_milliseconds";
297
- characters: "characters";
298
- embeddings: "embeddings";
299
- audio_input_tokens: "audio_input_tokens";
300
- cached_audio_input_tokens: "cached_audio_input_tokens";
301
- audio_output_tokens: "audio_output_tokens";
302
- session_milliseconds: "session_milliseconds";
303
- input_transcription_milliseconds: "input_transcription_milliseconds";
304
- }>>;
305
- }, z.core.$strict>>;
306
- outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
307
- text: "text";
308
- audio: "audio";
309
- }>>>;
310
- toolChoice: z.ZodArray<z.ZodEnum<{
311
- function: "function";
312
- none: "none";
313
- auto: "auto";
314
- required: "required";
315
- }>>;
316
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
317
- inputTranscriptionPrompt: z.ZodBoolean;
318
- }, z.core.$strict>>;
319
159
  }, z.core.$strict>;
320
160
  /**
321
161
  * What a model can do, in the terms a caller has to decide against before
@@ -385,50 +225,6 @@ export declare const modelCapabilitiesSchema: z.ZodObject<{
385
225
  g711_alaw: "g711_alaw";
386
226
  }>>;
387
227
  }, z.core.$strict>>;
388
- parameters: z.ZodOptional<z.ZodObject<{
389
- turnDetection: z.ZodArray<z.ZodObject<{
390
- type: z.ZodEnum<{
391
- none: "none";
392
- server_vad: "server_vad";
393
- semantic_vad: "semantic_vad";
394
- }>;
395
- fixedResponses: z.ZodBoolean;
396
- threshold: z.ZodOptional<z.ZodObject<{
397
- min: z.ZodNumber;
398
- max: z.ZodNumber;
399
- }, z.core.$strict>>;
400
- meteredUnits: z.ZodArray<z.ZodEnum<{
401
- input_tokens: "input_tokens";
402
- cached_input_tokens: "cached_input_tokens";
403
- output_tokens: "output_tokens";
404
- reasoning_tokens: "reasoning_tokens";
405
- requests: "requests";
406
- images: "images";
407
- audio_input_milliseconds: "audio_input_milliseconds";
408
- audio_output_milliseconds: "audio_output_milliseconds";
409
- video_milliseconds: "video_milliseconds";
410
- characters: "characters";
411
- embeddings: "embeddings";
412
- audio_input_tokens: "audio_input_tokens";
413
- cached_audio_input_tokens: "cached_audio_input_tokens";
414
- audio_output_tokens: "audio_output_tokens";
415
- session_milliseconds: "session_milliseconds";
416
- input_transcription_milliseconds: "input_transcription_milliseconds";
417
- }>>;
418
- }, z.core.$strict>>;
419
- outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
420
- text: "text";
421
- audio: "audio";
422
- }>>>;
423
- toolChoice: z.ZodArray<z.ZodEnum<{
424
- function: "function";
425
- none: "none";
426
- auto: "auto";
427
- required: "required";
428
- }>>;
429
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
430
- inputTranscriptionPrompt: z.ZodBoolean;
431
- }, z.core.$strict>>;
432
228
  }, z.core.$strict>>;
433
229
  }, z.core.$strict>;
434
230
  /**
@@ -557,15 +353,11 @@ export declare const voiceSchema: z.ZodObject<{
557
353
  * `gender` is published only where it has been reviewed against the
558
354
  * provider's own catalogue; absent is unknown.
559
355
  *
560
- * Contract set 5.0.0:
561
- *
562
- * - `detectsLanguage` — naming no language lets the model detect it. A caller
563
- * whose language is not in `languages` omits it rather than losing the
564
- * model; absent is undeclared.
565
- * - `transcriptionPrompt` — a transcription request may carry a `prompt`.
566
- * Absent or `false`: one that does is refused before anything is held.
567
- * - A TRANSCRIPTION model's `languages` are exactly what a request may name in
568
- * `language`, and its `audioFormats.input` exactly what it uploads.
356
+ * A model's `languages` describe it; they are not a list a request must pick
357
+ * from. A request names the client's own BCP 47 tag, and Kaana sends the
358
+ * provider its spelling of that language, or none for the model to detect
359
+ * (Kaana ADR 0003). A transcription model's `audioFormats.input` are the
360
+ * uploads it reads.
569
361
  */
570
362
  export declare const modelAudioCapabilitiesSchema: z.ZodObject<{
571
363
  voices: z.ZodArray<z.ZodObject<{
@@ -579,8 +371,6 @@ export declare const modelAudioCapabilitiesSchema: z.ZodObject<{
579
371
  }>>;
580
372
  }, z.core.$strict>>;
581
373
  languages: z.ZodArray<z.ZodString>;
582
- detectsLanguage: z.ZodOptional<z.ZodBoolean>;
583
- transcriptionPrompt: z.ZodOptional<z.ZodBoolean>;
584
374
  audioFormats: z.ZodObject<{
585
375
  input: z.ZodArray<z.ZodEnum<{
586
376
  "audio/mpeg": "audio/mpeg";
@@ -692,50 +482,6 @@ export declare const modelSchema: z.ZodObject<{
692
482
  g711_alaw: "g711_alaw";
693
483
  }>>;
694
484
  }, z.core.$strict>>;
695
- parameters: z.ZodOptional<z.ZodObject<{
696
- turnDetection: z.ZodArray<z.ZodObject<{
697
- type: z.ZodEnum<{
698
- none: "none";
699
- server_vad: "server_vad";
700
- semantic_vad: "semantic_vad";
701
- }>;
702
- fixedResponses: z.ZodBoolean;
703
- threshold: z.ZodOptional<z.ZodObject<{
704
- min: z.ZodNumber;
705
- max: z.ZodNumber;
706
- }, z.core.$strict>>;
707
- meteredUnits: z.ZodArray<z.ZodEnum<{
708
- input_tokens: "input_tokens";
709
- cached_input_tokens: "cached_input_tokens";
710
- output_tokens: "output_tokens";
711
- reasoning_tokens: "reasoning_tokens";
712
- requests: "requests";
713
- images: "images";
714
- audio_input_milliseconds: "audio_input_milliseconds";
715
- audio_output_milliseconds: "audio_output_milliseconds";
716
- video_milliseconds: "video_milliseconds";
717
- characters: "characters";
718
- embeddings: "embeddings";
719
- audio_input_tokens: "audio_input_tokens";
720
- cached_audio_input_tokens: "cached_audio_input_tokens";
721
- audio_output_tokens: "audio_output_tokens";
722
- session_milliseconds: "session_milliseconds";
723
- input_transcription_milliseconds: "input_transcription_milliseconds";
724
- }>>;
725
- }, z.core.$strict>>;
726
- outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
727
- text: "text";
728
- audio: "audio";
729
- }>>>;
730
- toolChoice: z.ZodArray<z.ZodEnum<{
731
- function: "function";
732
- none: "none";
733
- auto: "auto";
734
- required: "required";
735
- }>>;
736
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
737
- inputTranscriptionPrompt: z.ZodBoolean;
738
- }, z.core.$strict>>;
739
485
  }, z.core.$strict>>;
740
486
  }, z.core.$strict>;
741
487
  audio: z.ZodOptional<z.ZodObject<{
@@ -750,8 +496,6 @@ export declare const modelSchema: z.ZodObject<{
750
496
  }>>;
751
497
  }, z.core.$strict>>;
752
498
  languages: z.ZodArray<z.ZodString>;
753
- detectsLanguage: z.ZodOptional<z.ZodBoolean>;
754
- transcriptionPrompt: z.ZodOptional<z.ZodBoolean>;
755
499
  audioFormats: z.ZodObject<{
756
500
  input: z.ZodArray<z.ZodEnum<{
757
501
  "audio/mpeg": "audio/mpeg";
@@ -835,6 +579,10 @@ export declare const modelSchema: z.ZodObject<{
835
579
  currency: z.ZodString;
836
580
  }, z.core.$strict>>;
837
581
  }, z.core.$strict>>;
582
+ pricePerMinute: z.ZodOptional<z.ZodObject<{
583
+ amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
584
+ currency: z.ZodString;
585
+ }, z.core.$strict>>;
838
586
  deprecation: z.ZodObject<{
839
587
  status: z.ZodEnum<{
840
588
  active: "active";
@@ -953,50 +701,6 @@ export declare const modelListSchema: z.ZodObject<{
953
701
  g711_alaw: "g711_alaw";
954
702
  }>>;
955
703
  }, z.core.$strict>>;
956
- parameters: z.ZodOptional<z.ZodObject<{
957
- turnDetection: z.ZodArray<z.ZodObject<{
958
- type: z.ZodEnum<{
959
- none: "none";
960
- server_vad: "server_vad";
961
- semantic_vad: "semantic_vad";
962
- }>;
963
- fixedResponses: z.ZodBoolean;
964
- threshold: z.ZodOptional<z.ZodObject<{
965
- min: z.ZodNumber;
966
- max: z.ZodNumber;
967
- }, z.core.$strict>>;
968
- meteredUnits: z.ZodArray<z.ZodEnum<{
969
- input_tokens: "input_tokens";
970
- cached_input_tokens: "cached_input_tokens";
971
- output_tokens: "output_tokens";
972
- reasoning_tokens: "reasoning_tokens";
973
- requests: "requests";
974
- images: "images";
975
- audio_input_milliseconds: "audio_input_milliseconds";
976
- audio_output_milliseconds: "audio_output_milliseconds";
977
- video_milliseconds: "video_milliseconds";
978
- characters: "characters";
979
- embeddings: "embeddings";
980
- audio_input_tokens: "audio_input_tokens";
981
- cached_audio_input_tokens: "cached_audio_input_tokens";
982
- audio_output_tokens: "audio_output_tokens";
983
- session_milliseconds: "session_milliseconds";
984
- input_transcription_milliseconds: "input_transcription_milliseconds";
985
- }>>;
986
- }, z.core.$strict>>;
987
- outputModalities: z.ZodArray<z.ZodArray<z.ZodEnum<{
988
- text: "text";
989
- audio: "audio";
990
- }>>>;
991
- toolChoice: z.ZodArray<z.ZodEnum<{
992
- function: "function";
993
- none: "none";
994
- auto: "auto";
995
- required: "required";
996
- }>>;
997
- maxOutputTokens: z.ZodOptional<z.ZodNumber>;
998
- inputTranscriptionPrompt: z.ZodBoolean;
999
- }, z.core.$strict>>;
1000
704
  }, z.core.$strict>>;
1001
705
  }, z.core.$strict>;
1002
706
  audio: z.ZodOptional<z.ZodObject<{
@@ -1011,8 +715,6 @@ export declare const modelListSchema: z.ZodObject<{
1011
715
  }>>;
1012
716
  }, z.core.$strict>>;
1013
717
  languages: z.ZodArray<z.ZodString>;
1014
- detectsLanguage: z.ZodOptional<z.ZodBoolean>;
1015
- transcriptionPrompt: z.ZodOptional<z.ZodBoolean>;
1016
718
  audioFormats: z.ZodObject<{
1017
719
  input: z.ZodArray<z.ZodEnum<{
1018
720
  "audio/mpeg": "audio/mpeg";
@@ -1096,6 +798,10 @@ export declare const modelListSchema: z.ZodObject<{
1096
798
  currency: z.ZodString;
1097
799
  }, z.core.$strict>>;
1098
800
  }, z.core.$strict>>;
801
+ pricePerMinute: z.ZodOptional<z.ZodObject<{
802
+ amount: z.core.$ZodBranded<z.ZodString, "ExactDecimal", "out">;
803
+ currency: z.ZodString;
804
+ }, z.core.$strict>>;
1099
805
  deprecation: z.ZodObject<{
1100
806
  status: z.ZodEnum<{
1101
807
  active: "active";
@@ -1206,9 +912,6 @@ export type InferenceApiFormat = z.infer<typeof inferenceApiFormatSchema>;
1206
912
  export type RealtimeSessionKind = z.infer<typeof realtimeSessionKindSchema>;
1207
913
  export type RealtimeSessionTransport = z.infer<typeof realtimeSessionTransportSchema>;
1208
914
  export type ModelRealtimeCapabilities = z.infer<typeof modelRealtimeCapabilitiesSchema>;
1209
- export type RealtimeParameters = z.infer<typeof realtimeParametersSchema>;
1210
- export type RealtimeTurnDetectionParameters = z.infer<typeof realtimeTurnDetectionParametersSchema>;
1211
- export type RealtimeToolChoiceKind = z.infer<typeof realtimeToolChoiceKindSchema>;
1212
915
  export type ModelCapabilities = z.infer<typeof modelCapabilitiesSchema>;
1213
916
  export type ModelLicense = z.infer<typeof modelLicenseSchema>;
1214
917
  export type ModelProvenance = z.infer<typeof modelProvenanceSchema>;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { z } from 'zod';
7
7
  import { inferenceDateSchema, inferenceHttpsUrlSchema, inferenceRegionSchema, inferenceTimestampSchema, modelIdSchema, modelReferenceSchema, modelRevisionLabelSchema, publisherSlugSchema, } from './identifiers.js';
8
- import { audioInputMediaTypeSchema, languageTagSchema, realtimeAudioFormatSchema, realtimeOutputModalitySchema, realtimeTurnDetectionTypeSchema, } from './audioFormats.js';
9
- import { priceSnapshotSchema, usageUnitSchema } from './money.js';
8
+ import { audioInputMediaTypeSchema, languageTagSchema, realtimeAudioFormatSchema, } from './audioFormats.js';
9
+ import { moneySchema, priceSnapshotSchema } from './money.js';
10
10
  import { inferenceAudioMediaTypeSchema } from './streamEvents.js';
11
11
  /** Input/request modalities; structured decisions are an output, never an input. */
12
12
  export const inferenceModalitySchema = z.enum(['text', 'image', 'audio', 'video', 'embedding']);
@@ -94,68 +94,6 @@ export const realtimeSessionKindSchema = z.enum(['conversation', 'transcription'
94
94
  * deployment can actually execute them.
95
95
  */
96
96
  export const realtimeSessionTransportSchema = z.enum(['websocket']);
97
- /** A closed interval. */
98
- export const numberRangeSchema = z.object({ min: z.number(), max: z.number() }).strict();
99
- /** One kind of tool choice: the modes, and `function` for one that names a tool. */
100
- export const realtimeToolChoiceKindSchema = z.enum(['auto', 'none', 'required', 'function']);
101
- /**
102
- * One turn detection a realtime model serves (contract set 5.0.0).
103
- *
104
- * - `fixedResponses` — the detection always answers the turn it detected and
105
- * lets the caller's speech interrupt the answer: it has neither switch, so a
106
- * session must state `createResponse: true` and `interruptResponse: true`.
107
- * - `threshold` — server_vad's `threshold` range; absent, the contract's 0–1.
108
- * - `meteredUnits` — the units a session under this detection is billed in:
109
- * what a caller multiplies the model's prices by to estimate a call. A
110
- * provider that bills by the clock under one detection and by the audio
111
- * under another states each.
112
- */
113
- export const realtimeTurnDetectionParametersSchema = z
114
- .object({
115
- type: realtimeTurnDetectionTypeSchema,
116
- fixedResponses: z.boolean(),
117
- threshold: numberRangeSchema.optional(),
118
- meteredUnits: z.array(usageUnitSchema).min(1),
119
- })
120
- .strict();
121
- /**
122
- * What a realtime model's session configuration may set, and within which
123
- * bounds (contract set 5.0.0): the provider's reviewed statement, which Kaana's
124
- * adapter enforces and the catalogue publishes, so a session built from it is
125
- * one the model serves. `checkRealtimeSessionOpen` applies it.
126
- *
127
- * - `turnDetection` — every detection served.
128
- * - `outputModalities` — every set of modalities one response may produce
129
- * (each sorted): a model that answers aloud whatever it is asked does not
130
- * serve `["text"]`.
131
- * - `toolChoice` — every kind of tool choice served; always holds `auto`.
132
- * - `maxOutputTokens` — the largest per-response cap; absent, the model has
133
- * none and `maxOutputTokens` is refused.
134
- * - `inputTranscriptionPrompt` — `config.inputAudioTranscription.prompt` is
135
- * taken.
136
- */
137
- export const realtimeParametersSchema = z
138
- .object({
139
- turnDetection: z.array(realtimeTurnDetectionParametersSchema).min(1),
140
- outputModalities: z.array(z.array(realtimeOutputModalitySchema).min(1).max(2)).min(1),
141
- toolChoice: z.array(realtimeToolChoiceKindSchema).min(1),
142
- maxOutputTokens: z.number().int().positive().safe().optional(),
143
- inputTranscriptionPrompt: z.boolean(),
144
- })
145
- .strict()
146
- .superRefine((parameters, ctx) => {
147
- if (!parameters.toolChoice.includes('auto')) {
148
- ctx.addIssue({ code: 'custom', path: ['toolChoice'], message: 'auto is always served' });
149
- }
150
- const kinds = parameters.turnDetection.map((detection) => detection.type);
151
- if (new Set(kinds).size !== kinds.length) {
152
- ctx.addIssue({
153
- code: 'custom',
154
- path: ['turnDetection'],
155
- message: 'each detection is declared once',
156
- });
157
- }
158
- });
159
97
  /**
160
98
  * What a deployment can execute as a realtime session. Present only on a model
161
99
  * that holds sessions; absent means it holds none, which is the state of every
@@ -173,8 +111,6 @@ export const realtimeParametersSchema = z
173
111
  * - `audioFormats` — the realtime encodings a session may name as
174
112
  * `config.inputAudioFormat` and `config.outputAudioFormat`. These are not the
175
113
  * media types of `audio.audioFormats`, which describe files.
176
- * - `parameters` (contract set 5.0.0) — what a session configuration may set
177
- * ({@link realtimeParametersSchema}). Absent: undeclared, not checked.
178
114
  */
179
115
  export const modelRealtimeCapabilitiesSchema = z
180
116
  .object({
@@ -188,7 +124,6 @@ export const modelRealtimeCapabilitiesSchema = z
188
124
  })
189
125
  .strict()
190
126
  .optional(),
191
- parameters: realtimeParametersSchema.optional(),
192
127
  })
193
128
  .strict();
194
129
  /**
@@ -444,22 +379,16 @@ export const voiceSchema = z
444
379
  * `gender` is published only where it has been reviewed against the
445
380
  * provider's own catalogue; absent is unknown.
446
381
  *
447
- * Contract set 5.0.0:
448
- *
449
- * - `detectsLanguage` — naming no language lets the model detect it. A caller
450
- * whose language is not in `languages` omits it rather than losing the
451
- * model; absent is undeclared.
452
- * - `transcriptionPrompt` — a transcription request may carry a `prompt`.
453
- * Absent or `false`: one that does is refused before anything is held.
454
- * - A TRANSCRIPTION model's `languages` are exactly what a request may name in
455
- * `language`, and its `audioFormats.input` exactly what it uploads.
382
+ * A model's `languages` describe it; they are not a list a request must pick
383
+ * from. A request names the client's own BCP 47 tag, and Kaana sends the
384
+ * provider its spelling of that language, or none for the model to detect
385
+ * (Kaana ADR 0003). A transcription model's `audioFormats.input` are the
386
+ * uploads it reads.
456
387
  */
457
388
  export const modelAudioCapabilitiesSchema = z
458
389
  .object({
459
390
  voices: z.array(voiceSchema),
460
391
  languages: z.array(languageTagSchema),
461
- detectsLanguage: z.boolean().optional(),
462
- transcriptionPrompt: z.boolean().optional(),
463
392
  audioFormats: z
464
393
  .object({
465
394
  input: z.array(audioInputMediaTypeSchema),
@@ -546,6 +475,14 @@ export const modelSchema = z.object({
546
475
  dataPolicy: inferenceDataPolicySchema,
547
476
  /** Oxy's list price. Absent for a model a customer cannot buy per unit (BYOK-only). */
548
477
  pricing: priceSnapshotSchema.optional(),
478
+ /**
479
+ * Kaana's price of one minute of this model's work, whatever units its
480
+ * provider bills (contract set 6.0.0): for a realtime model, a minute of a
481
+ * conversation under `server_vad`, Kaana's default turn detection; for a
482
+ * transcription model, a minute of audio. An estimate to reserve or show
483
+ * with, rounded up; what a request costs is what it measured, in `pricing`.
484
+ */
485
+ pricePerMinute: moneySchema.optional(),
549
486
  deprecation: modelDeprecationSchema,
550
487
  evaluations: z.array(modelEvaluationResultSchema).default([]),
551
488
  safety: modelSafetyMetadataSchema.optional(),
@@ -172,8 +172,8 @@ export declare const chatCompletionsRequestSchema: z.ZodObject<{
172
172
  }, z.core.$strict>;
173
173
  }, z.core.$strict>>>;
174
174
  tool_choice: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
175
- none: "none";
176
175
  auto: "auto";
176
+ none: "none";
177
177
  required: "required";
178
178
  }>, z.ZodObject<{
179
179
  type: z.ZodLiteral<"function">;
@@ -205,8 +205,8 @@ export declare const toolDefinitionSchema: z.ZodObject<{
205
205
  }, z.core.$strict>;
206
206
  /** Whether, and which, tool the model must call. */
207
207
  export declare const toolChoiceSchema: z.ZodUnion<readonly [z.ZodEnum<{
208
- none: "none";
209
208
  auto: "auto";
209
+ none: "none";
210
210
  required: "required";
211
211
  }>, z.ZodObject<{
212
212
  type: z.ZodLiteral<"function">;