@kaana.ai/contracts 8.15.0 → 8.17.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 +28 -0
- package/dist/internal/catalogue.js +24 -1
- package/dist/internal/grant.d.ts +3 -0
- package/dist/internal/realtime.d.ts +42 -0
- package/dist/internal/realtime.js +3 -1
- package/dist/public/catalogue.d.ts +73 -2
- package/dist/public/catalogue.js +54 -3
- package/dist/public/realtime.d.ts +205 -1
- package/dist/public/realtime.js +185 -3
- package/dist/public/version.d.ts +24 -3
- package/dist/public/version.js +24 -3
- package/openapi.json +236 -2
- package/package.json +1 -1
|
@@ -98,7 +98,14 @@ export declare const catalogueModelSchema: z.ZodObject<{
|
|
|
98
98
|
conversation: "conversation";
|
|
99
99
|
transcription: "transcription";
|
|
100
100
|
translation: "translation";
|
|
101
|
+
live: "live";
|
|
101
102
|
}>>;
|
|
103
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
104
|
+
conversation: "conversation";
|
|
105
|
+
transcription: "transcription";
|
|
106
|
+
translation: "translation";
|
|
107
|
+
live: "live";
|
|
108
|
+
}>>>;
|
|
102
109
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
103
110
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
104
111
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -428,7 +435,14 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
428
435
|
conversation: "conversation";
|
|
429
436
|
transcription: "transcription";
|
|
430
437
|
translation: "translation";
|
|
438
|
+
live: "live";
|
|
431
439
|
}>>;
|
|
440
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
441
|
+
conversation: "conversation";
|
|
442
|
+
transcription: "transcription";
|
|
443
|
+
translation: "translation";
|
|
444
|
+
live: "live";
|
|
445
|
+
}>>>;
|
|
432
446
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
433
447
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
434
448
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -704,7 +718,14 @@ export declare const declaredModelSchema: z.ZodObject<{
|
|
|
704
718
|
conversation: "conversation";
|
|
705
719
|
transcription: "transcription";
|
|
706
720
|
translation: "translation";
|
|
721
|
+
live: "live";
|
|
707
722
|
}>>;
|
|
723
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
724
|
+
conversation: "conversation";
|
|
725
|
+
transcription: "transcription";
|
|
726
|
+
translation: "translation";
|
|
727
|
+
live: "live";
|
|
728
|
+
}>>>;
|
|
708
729
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
709
730
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
710
731
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -943,7 +964,14 @@ export declare const declaredCatalogueSchema: z.ZodObject<{
|
|
|
943
964
|
conversation: "conversation";
|
|
944
965
|
transcription: "transcription";
|
|
945
966
|
translation: "translation";
|
|
967
|
+
live: "live";
|
|
946
968
|
}>>;
|
|
969
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
970
|
+
conversation: "conversation";
|
|
971
|
+
transcription: "transcription";
|
|
972
|
+
translation: "translation";
|
|
973
|
+
live: "live";
|
|
974
|
+
}>>>;
|
|
947
975
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
948
976
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
949
977
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -417,4 +417,27 @@ export const declaredCatalogueSchema = z
|
|
|
417
417
|
schemaVersion: z.literal(1),
|
|
418
418
|
models: z.array(declaredModelSchema),
|
|
419
419
|
})
|
|
420
|
-
.strict()
|
|
420
|
+
.strict()
|
|
421
|
+
.superRefine((catalogue, ctx) => {
|
|
422
|
+
// A kind has one default (contract set 8.16.0, Kaana ADR 0012): a client
|
|
423
|
+
// opens the default line of a kind, so two active defaults would leave the
|
|
424
|
+
// choice to whichever the client read first.
|
|
425
|
+
const defaults = new Map();
|
|
426
|
+
for (const [index, model] of catalogue.models.entries()) {
|
|
427
|
+
if (model.deprecation.status !== 'active')
|
|
428
|
+
continue;
|
|
429
|
+
for (const kind of model.capabilities.realtime?.defaultKinds ?? []) {
|
|
430
|
+
const first = defaults.get(kind);
|
|
431
|
+
if (first !== undefined) {
|
|
432
|
+
ctx.addIssue({
|
|
433
|
+
code: 'custom',
|
|
434
|
+
path: ['models', index, 'capabilities', 'realtime', 'defaultKinds'],
|
|
435
|
+
message: `models[${first}] is already the default ${kind} line: at most one active line is the default of a kind`,
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
defaults.set(kind, index);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
});
|
package/dist/internal/grant.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export declare const grantRequestFactsSchema: z.ZodObject<{
|
|
|
82
82
|
conversation: "conversation";
|
|
83
83
|
transcription: "transcription";
|
|
84
84
|
translation: "translation";
|
|
85
|
+
live: "live";
|
|
85
86
|
}>>;
|
|
86
87
|
}, z.core.$strict>;
|
|
87
88
|
/**
|
|
@@ -135,6 +136,7 @@ export declare const inferenceAuthorizationRequestSchema: z.ZodObject<{
|
|
|
135
136
|
conversation: "conversation";
|
|
136
137
|
transcription: "transcription";
|
|
137
138
|
translation: "translation";
|
|
139
|
+
live: "live";
|
|
138
140
|
}>>;
|
|
139
141
|
}, z.core.$strict>;
|
|
140
142
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
@@ -216,6 +218,7 @@ export declare const authorizationRequestSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
216
218
|
conversation: "conversation";
|
|
217
219
|
transcription: "transcription";
|
|
218
220
|
translation: "translation";
|
|
221
|
+
live: "live";
|
|
219
222
|
}>>;
|
|
220
223
|
}, z.core.$strict>;
|
|
221
224
|
idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
@@ -64,6 +64,7 @@ export declare const realtimeSessionRequestSchema: z.ZodObject<{
|
|
|
64
64
|
conversation: "conversation";
|
|
65
65
|
transcription: "transcription";
|
|
66
66
|
translation: "translation";
|
|
67
|
+
live: "live";
|
|
67
68
|
}>;
|
|
68
69
|
transport: z.ZodEnum<{
|
|
69
70
|
websocket: "websocket";
|
|
@@ -128,6 +129,12 @@ export declare const realtimeSessionRequestSchema: z.ZodObject<{
|
|
|
128
129
|
name: z.ZodString;
|
|
129
130
|
}, z.core.$strict>]>>;
|
|
130
131
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
acknowledgement: z.ZodEnum<{
|
|
134
|
+
auto: "auto";
|
|
135
|
+
none: "none";
|
|
136
|
+
}>;
|
|
137
|
+
}, z.core.$strict>>;
|
|
131
138
|
}, z.core.$strict>;
|
|
132
139
|
limits: z.ZodObject<{
|
|
133
140
|
maxDurationMs: z.ZodNumber;
|
|
@@ -208,6 +215,7 @@ export declare const realtimeSessionCreatedEventSchema: z.ZodObject<{
|
|
|
208
215
|
conversation: "conversation";
|
|
209
216
|
transcription: "transcription";
|
|
210
217
|
translation: "translation";
|
|
218
|
+
live: "live";
|
|
211
219
|
}>;
|
|
212
220
|
config: z.ZodObject<{
|
|
213
221
|
instructions: z.ZodOptional<z.ZodString>;
|
|
@@ -269,6 +277,12 @@ export declare const realtimeSessionCreatedEventSchema: z.ZodObject<{
|
|
|
269
277
|
name: z.ZodString;
|
|
270
278
|
}, z.core.$strict>]>>;
|
|
271
279
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
acknowledgement: z.ZodEnum<{
|
|
282
|
+
auto: "auto";
|
|
283
|
+
none: "none";
|
|
284
|
+
}>;
|
|
285
|
+
}, z.core.$strict>>;
|
|
272
286
|
}, z.core.$strict>;
|
|
273
287
|
limits: z.ZodObject<{
|
|
274
288
|
maxDurationMs: z.ZodNumber;
|
|
@@ -468,6 +482,7 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
468
482
|
conversation: "conversation";
|
|
469
483
|
transcription: "transcription";
|
|
470
484
|
translation: "translation";
|
|
485
|
+
live: "live";
|
|
471
486
|
}>;
|
|
472
487
|
config: z.ZodObject<{
|
|
473
488
|
instructions: z.ZodOptional<z.ZodString>;
|
|
@@ -529,6 +544,12 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
529
544
|
name: z.ZodString;
|
|
530
545
|
}, z.core.$strict>]>>;
|
|
531
546
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
547
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
548
|
+
acknowledgement: z.ZodEnum<{
|
|
549
|
+
auto: "auto";
|
|
550
|
+
none: "none";
|
|
551
|
+
}>;
|
|
552
|
+
}, z.core.$strict>>;
|
|
532
553
|
}, z.core.$strict>;
|
|
533
554
|
limits: z.ZodObject<{
|
|
534
555
|
maxDurationMs: z.ZodNumber;
|
|
@@ -606,6 +627,12 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
606
627
|
name: z.ZodString;
|
|
607
628
|
}, z.core.$strict>]>>;
|
|
608
629
|
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
630
|
+
delegation: z.ZodOptional<z.ZodObject<{
|
|
631
|
+
acknowledgement: z.ZodEnum<{
|
|
632
|
+
auto: "auto";
|
|
633
|
+
none: "none";
|
|
634
|
+
}>;
|
|
635
|
+
}, z.core.$strict>>;
|
|
609
636
|
}, z.core.$strict>;
|
|
610
637
|
schemaVersion: z.ZodLiteral<1>;
|
|
611
638
|
requestId: z.ZodString;
|
|
@@ -865,6 +892,21 @@ export declare const realtimeServerEventSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
865
892
|
requestId: z.ZodString;
|
|
866
893
|
sequence: z.ZodNumber;
|
|
867
894
|
commandId: z.ZodOptional<z.ZodString>;
|
|
895
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
896
|
+
type: z.ZodLiteral<"delegation.requested">;
|
|
897
|
+
delegationId: z.ZodString;
|
|
898
|
+
text: z.ZodString;
|
|
899
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
900
|
+
requestId: z.ZodString;
|
|
901
|
+
sequence: z.ZodNumber;
|
|
902
|
+
commandId: z.ZodOptional<z.ZodString>;
|
|
903
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
904
|
+
type: z.ZodLiteral<"delegation.superseded">;
|
|
905
|
+
delegationId: z.ZodString;
|
|
906
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
907
|
+
requestId: z.ZodString;
|
|
908
|
+
sequence: z.ZodNumber;
|
|
909
|
+
commandId: z.ZodOptional<z.ZodString>;
|
|
868
910
|
}, z.core.$strip>, z.ZodObject<{
|
|
869
911
|
type: z.ZodLiteral<"response.done">;
|
|
870
912
|
responseId: z.ZodString;
|
|
@@ -11,7 +11,7 @@ import { inferenceTimestampSchema, modelReferenceSchema, requestIdSchema, } from
|
|
|
11
11
|
import { usageQuantitySchema, usageSourceSchema } from '../public/money.js';
|
|
12
12
|
import { routingPolicyReferenceSchema } from '../public/policy.js';
|
|
13
13
|
import { inferenceFinishReasonSchema } from '../public/streamEvents.js';
|
|
14
|
-
import { MAX_REALTIME_RESUME_WINDOW_MS, realtimeCommandAcceptedEventSchema, realtimeCommandIdSchema, realtimeConfigIssues, realtimeInputAudioClearedEventSchema, realtimeInputAudioCommittedEventSchema, realtimeItemAddedEventSchema, realtimeItemDeletedEventSchema, realtimeItemDoneEventSchema, realtimeItemTruncatedEventSchema, realtimeOutputAudioDeltaEventSchema, realtimeOutputAudioDoneEventSchema, realtimeResponseCreatedEventSchema, realtimeResponseIdSchema, realtimeResponseStatusSchema, realtimeSessionCloseReasonSchema, realtimeSessionConfigSchema, realtimeSessionLimitsSchema, realtimeSessionResumedEventSchema, realtimeSessionUpdatedEventSchema, realtimeSpeechStartedEventSchema, realtimeSpeechStoppedEventSchema, realtimeTextDeltaEventSchema, realtimeToolCallEventSchema, realtimeTranscriptDeltaEventSchema, realtimeTranscriptDoneEventSchema, realtimeTranscriptInterimEventSchema, } from '../public/realtime.js';
|
|
14
|
+
import { MAX_REALTIME_RESUME_WINDOW_MS, realtimeCommandAcceptedEventSchema, realtimeCommandIdSchema, realtimeConfigIssues, realtimeDelegationRequestedEventSchema, realtimeDelegationSupersededEventSchema, realtimeInputAudioClearedEventSchema, realtimeInputAudioCommittedEventSchema, realtimeItemAddedEventSchema, realtimeItemDeletedEventSchema, realtimeItemDoneEventSchema, realtimeItemTruncatedEventSchema, realtimeOutputAudioDeltaEventSchema, realtimeOutputAudioDoneEventSchema, realtimeResponseCreatedEventSchema, realtimeResponseIdSchema, realtimeResponseStatusSchema, realtimeSessionCloseReasonSchema, realtimeSessionConfigSchema, realtimeSessionLimitsSchema, realtimeSessionResumedEventSchema, realtimeSessionUpdatedEventSchema, realtimeSpeechStartedEventSchema, realtimeSpeechStoppedEventSchema, realtimeTextDeltaEventSchema, realtimeToolCallEventSchema, realtimeTranscriptDeltaEventSchema, realtimeTranscriptDoneEventSchema, realtimeTranscriptInterimEventSchema, } from '../public/realtime.js';
|
|
15
15
|
import { inferenceAttributionSchema } from './attribution.js';
|
|
16
16
|
import { inferenceErrorSchema } from './errors.js';
|
|
17
17
|
import { deploymentIdSchema, inferenceProviderSlugSchema } from './identifiers.js';
|
|
@@ -168,6 +168,8 @@ export const realtimeServerEventSchema = z
|
|
|
168
168
|
realtimeTranscriptInterimEventSchema,
|
|
169
169
|
realtimeTextDeltaEventSchema,
|
|
170
170
|
realtimeToolCallEventSchema,
|
|
171
|
+
realtimeDelegationRequestedEventSchema,
|
|
172
|
+
realtimeDelegationSupersededEventSchema,
|
|
171
173
|
realtimeResponseDoneEventSchema,
|
|
172
174
|
realtimeErrorEventSchema,
|
|
173
175
|
realtimeSessionClosedEventSchema,
|
|
@@ -93,19 +93,23 @@ export declare const inferenceApiFormatSchema: z.ZodEnum<{
|
|
|
93
93
|
batches: "batches";
|
|
94
94
|
}>;
|
|
95
95
|
/**
|
|
96
|
-
* What a realtime session is FOR.
|
|
97
|
-
*
|
|
96
|
+
* What a realtime session is FOR. They are different upstream products with
|
|
97
|
+
* different event families and different metering, not options of one:
|
|
98
98
|
*
|
|
99
99
|
* - `conversation` — a speech-to-speech (or text) model holding a dialogue,
|
|
100
100
|
* with responses, tool calls and interruption.
|
|
101
101
|
* - `transcription` — live speech-to-text; the model never responds, it only
|
|
102
102
|
* transcribes committed input audio.
|
|
103
103
|
* - `translation` — live speech-to-speech translation into one target language.
|
|
104
|
+
* - `live` — a spoken conversation whose turns the CALLER's backend answers
|
|
105
|
+
* (contract set 8.16.0, Kaana ADR 0012): the voice hands each turn over as
|
|
106
|
+
* `delegation.requested` and speaks the `delegation.reply` it is given.
|
|
104
107
|
*/
|
|
105
108
|
export declare const realtimeSessionKindSchema: z.ZodEnum<{
|
|
106
109
|
conversation: "conversation";
|
|
107
110
|
transcription: "transcription";
|
|
108
111
|
translation: "translation";
|
|
112
|
+
live: "live";
|
|
109
113
|
}>;
|
|
110
114
|
/**
|
|
111
115
|
* How a realtime session is carried. One member today: a WebSocket, whose every
|
|
@@ -133,6 +137,13 @@ export declare const realtimeSessionTransportSchema: z.ZodEnum<{
|
|
|
133
137
|
* - `audioFormats` — the realtime encodings a session may name as
|
|
134
138
|
* `config.inputAudioFormat` and `config.outputAudioFormat`. These are not the
|
|
135
139
|
* media types of `audio.audioFormats`, which describe files.
|
|
140
|
+
*
|
|
141
|
+
* `defaultKinds` arrived in contract set 8.16.0 (Kaana ADR 0012): the session
|
|
142
|
+
* kinds for which this line is Kaana's default, each one of its `sessionKinds`.
|
|
143
|
+
* A client opens the default line of a kind after reading `GET /v1/models`, so
|
|
144
|
+
* which provider serves a kind is a catalogue decision and never a client
|
|
145
|
+
* constant. At most one active line is the default of a kind. Absent means the
|
|
146
|
+
* line is the default of none.
|
|
136
147
|
*/
|
|
137
148
|
export declare const modelRealtimeCapabilitiesSchema: z.ZodObject<{
|
|
138
149
|
transports: z.ZodArray<z.ZodEnum<{
|
|
@@ -142,7 +153,14 @@ export declare const modelRealtimeCapabilitiesSchema: z.ZodObject<{
|
|
|
142
153
|
conversation: "conversation";
|
|
143
154
|
transcription: "transcription";
|
|
144
155
|
translation: "translation";
|
|
156
|
+
live: "live";
|
|
145
157
|
}>>;
|
|
158
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
159
|
+
conversation: "conversation";
|
|
160
|
+
transcription: "transcription";
|
|
161
|
+
translation: "translation";
|
|
162
|
+
live: "live";
|
|
163
|
+
}>>>;
|
|
146
164
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
147
165
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
148
166
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -216,7 +234,14 @@ export declare const modelCapabilitiesSchema: z.ZodObject<{
|
|
|
216
234
|
conversation: "conversation";
|
|
217
235
|
transcription: "transcription";
|
|
218
236
|
translation: "translation";
|
|
237
|
+
live: "live";
|
|
219
238
|
}>>;
|
|
239
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
240
|
+
conversation: "conversation";
|
|
241
|
+
transcription: "transcription";
|
|
242
|
+
translation: "translation";
|
|
243
|
+
live: "live";
|
|
244
|
+
}>>>;
|
|
220
245
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
221
246
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
222
247
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -480,7 +505,14 @@ export declare const modelSchema: z.ZodObject<{
|
|
|
480
505
|
conversation: "conversation";
|
|
481
506
|
transcription: "transcription";
|
|
482
507
|
translation: "translation";
|
|
508
|
+
live: "live";
|
|
483
509
|
}>>;
|
|
510
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
511
|
+
conversation: "conversation";
|
|
512
|
+
transcription: "transcription";
|
|
513
|
+
translation: "translation";
|
|
514
|
+
live: "live";
|
|
515
|
+
}>>>;
|
|
484
516
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
485
517
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
486
518
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -707,7 +739,14 @@ export declare const modelListSchema: z.ZodObject<{
|
|
|
707
739
|
conversation: "conversation";
|
|
708
740
|
transcription: "transcription";
|
|
709
741
|
translation: "translation";
|
|
742
|
+
live: "live";
|
|
710
743
|
}>>;
|
|
744
|
+
defaultKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
745
|
+
conversation: "conversation";
|
|
746
|
+
transcription: "transcription";
|
|
747
|
+
translation: "translation";
|
|
748
|
+
live: "live";
|
|
749
|
+
}>>>;
|
|
711
750
|
inputAudioTranscription: z.ZodOptional<z.ZodBoolean>;
|
|
712
751
|
audioFormats: z.ZodOptional<z.ZodObject<{
|
|
713
752
|
input: z.ZodArray<z.ZodEnum<{
|
|
@@ -872,6 +911,38 @@ export declare const modelListSchema: z.ZodObject<{
|
|
|
872
911
|
}>>;
|
|
873
912
|
}, z.core.$strip>>;
|
|
874
913
|
}, z.core.$strict>;
|
|
914
|
+
/**
|
|
915
|
+
* One value `GET /v1/models` gained after a contract set (contract set 8.17.0).
|
|
916
|
+
*
|
|
917
|
+
* The catalogue's leaves are strict and its enums closed, so a reader refuses
|
|
918
|
+
* the WHOLE list on the first field or member its own set lacks. Kaana
|
|
919
|
+
* therefore renders the catalogue in the set the caller states in
|
|
920
|
+
* `Kaana-Contract-Version` (`@kaana.ai/sdk` 2.0.0 and later send it on every
|
|
921
|
+
* request): a value listed here reaches only a caller whose set is `since` or
|
|
922
|
+
* later. A caller that states no set, or one that does not parse, receives
|
|
923
|
+
* none of them.
|
|
924
|
+
*
|
|
925
|
+
* - `path` names a field of a model; a list on the way is crossed, applying the
|
|
926
|
+
* rest of the path to each element.
|
|
927
|
+
* - Without `member`, the field is the addition and is left out.
|
|
928
|
+
* - With `member`, the value at `path` is an enum and `member` is the addition:
|
|
929
|
+
* the list element that holds it is left out (the member itself in a list of
|
|
930
|
+
* members; the object carrying it in a list of objects). When that empties
|
|
931
|
+
* the list, the field at `emptied` (the nearest optional field holding the
|
|
932
|
+
* list) is left out with it.
|
|
933
|
+
*
|
|
934
|
+
* Adding a member to an enum the catalogue reaches, or a field to one of its
|
|
935
|
+
* strict objects, appends an entry here in the same change; the
|
|
936
|
+
* `@kaana.ai/sdk` compatibility suite compares this list with the published
|
|
937
|
+
* releases deployed readers run.
|
|
938
|
+
*/
|
|
939
|
+
export interface CatalogueAddition {
|
|
940
|
+
readonly since: string;
|
|
941
|
+
readonly path: readonly string[];
|
|
942
|
+
readonly member?: string;
|
|
943
|
+
readonly emptied?: readonly string[];
|
|
944
|
+
}
|
|
945
|
+
export declare const CATALOGUE_ADDITIONS: readonly CatalogueAddition[];
|
|
875
946
|
/**
|
|
876
947
|
* One power level as `GET /v1/power-levels` lists it for the calling
|
|
877
948
|
* credential: the level, the class it draws from, the effort it asks for, and
|
package/dist/public/catalogue.js
CHANGED
|
@@ -78,16 +78,24 @@ export const inferenceApiFormatSchema = z.enum([
|
|
|
78
78
|
'batches',
|
|
79
79
|
]);
|
|
80
80
|
/**
|
|
81
|
-
* What a realtime session is FOR.
|
|
82
|
-
*
|
|
81
|
+
* What a realtime session is FOR. They are different upstream products with
|
|
82
|
+
* different event families and different metering, not options of one:
|
|
83
83
|
*
|
|
84
84
|
* - `conversation` — a speech-to-speech (or text) model holding a dialogue,
|
|
85
85
|
* with responses, tool calls and interruption.
|
|
86
86
|
* - `transcription` — live speech-to-text; the model never responds, it only
|
|
87
87
|
* transcribes committed input audio.
|
|
88
88
|
* - `translation` — live speech-to-speech translation into one target language.
|
|
89
|
+
* - `live` — a spoken conversation whose turns the CALLER's backend answers
|
|
90
|
+
* (contract set 8.16.0, Kaana ADR 0012): the voice hands each turn over as
|
|
91
|
+
* `delegation.requested` and speaks the `delegation.reply` it is given.
|
|
89
92
|
*/
|
|
90
|
-
export const realtimeSessionKindSchema = z.enum([
|
|
93
|
+
export const realtimeSessionKindSchema = z.enum([
|
|
94
|
+
'conversation',
|
|
95
|
+
'transcription',
|
|
96
|
+
'translation',
|
|
97
|
+
'live',
|
|
98
|
+
]);
|
|
91
99
|
/**
|
|
92
100
|
* How a realtime session is carried. One member today: a WebSocket, whose every
|
|
93
101
|
* frame is one JSON message (see `realtime.ts`). WebRTC and SIP are separate
|
|
@@ -112,11 +120,19 @@ export const realtimeSessionTransportSchema = z.enum(['websocket']);
|
|
|
112
120
|
* - `audioFormats` — the realtime encodings a session may name as
|
|
113
121
|
* `config.inputAudioFormat` and `config.outputAudioFormat`. These are not the
|
|
114
122
|
* media types of `audio.audioFormats`, which describe files.
|
|
123
|
+
*
|
|
124
|
+
* `defaultKinds` arrived in contract set 8.16.0 (Kaana ADR 0012): the session
|
|
125
|
+
* kinds for which this line is Kaana's default, each one of its `sessionKinds`.
|
|
126
|
+
* A client opens the default line of a kind after reading `GET /v1/models`, so
|
|
127
|
+
* which provider serves a kind is a catalogue decision and never a client
|
|
128
|
+
* constant. At most one active line is the default of a kind. Absent means the
|
|
129
|
+
* line is the default of none.
|
|
115
130
|
*/
|
|
116
131
|
export const modelRealtimeCapabilitiesSchema = z
|
|
117
132
|
.object({
|
|
118
133
|
transports: z.array(realtimeSessionTransportSchema).min(1),
|
|
119
134
|
sessionKinds: z.array(realtimeSessionKindSchema).min(1),
|
|
135
|
+
defaultKinds: z.array(realtimeSessionKindSchema).min(1).optional(),
|
|
120
136
|
inputAudioTranscription: z.boolean().optional(),
|
|
121
137
|
audioFormats: z
|
|
122
138
|
.object({
|
|
@@ -229,6 +245,25 @@ export const modelCapabilitiesSchema = z
|
|
|
229
245
|
message: 'each session kind is declared at most once',
|
|
230
246
|
});
|
|
231
247
|
}
|
|
248
|
+
const defaults = realtime.defaultKinds;
|
|
249
|
+
if (defaults !== undefined) {
|
|
250
|
+
if (new Set(defaults).size !== defaults.length) {
|
|
251
|
+
ctx.addIssue({
|
|
252
|
+
code: 'custom',
|
|
253
|
+
path: ['realtime', 'defaultKinds'],
|
|
254
|
+
message: 'each default kind is declared at most once',
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
for (const [index, kind] of defaults.entries()) {
|
|
258
|
+
if (!realtime.sessionKinds.includes(kind)) {
|
|
259
|
+
ctx.addIssue({
|
|
260
|
+
code: 'custom',
|
|
261
|
+
path: ['realtime', 'defaultKinds', index],
|
|
262
|
+
message: `a line is the default only of a kind it holds, and it holds no ${kind} session`,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
232
267
|
if (new Set(realtime.transports).size !== realtime.transports.length) {
|
|
233
268
|
ctx.addIssue({
|
|
234
269
|
code: 'custom',
|
|
@@ -537,6 +572,22 @@ export const modelSchema = z.object({
|
|
|
537
572
|
});
|
|
538
573
|
/** `GET /v1/models`. */
|
|
539
574
|
export const modelListSchema = z.object({ data: z.array(modelSchema) }).strict();
|
|
575
|
+
export const CATALOGUE_ADDITIONS = [
|
|
576
|
+
{ since: '8.4.0', path: ['capabilities', 'unreported'] },
|
|
577
|
+
{
|
|
578
|
+
since: '8.4.0',
|
|
579
|
+
path: ['pricing', 'unitPrices', 'unit'],
|
|
580
|
+
member: 'cache_write_input_tokens',
|
|
581
|
+
emptied: ['pricing'],
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
since: '8.16.0',
|
|
585
|
+
path: ['capabilities', 'realtime', 'sessionKinds'],
|
|
586
|
+
member: 'live',
|
|
587
|
+
emptied: ['capabilities', 'realtime'],
|
|
588
|
+
},
|
|
589
|
+
{ since: '8.16.0', path: ['capabilities', 'realtime', 'defaultKinds'] },
|
|
590
|
+
];
|
|
540
591
|
/**
|
|
541
592
|
* One power level as `GET /v1/power-levels` lists it for the calling
|
|
542
593
|
* credential: the level, the class it draws from, the effort it asks for, and
|