@kaana.ai/contracts 6.0.0 → 6.1.1
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/public/realtime.d.ts +12 -2
- package/dist/public/realtime.js +16 -4
- package/package.json +3 -2
|
@@ -23,6 +23,13 @@ export declare const MAX_REALTIME_SESSION_DURATION_MS = 3600000;
|
|
|
23
23
|
export declare const MAX_REALTIME_SESSION_AUDIO_BYTES = 172800000;
|
|
24
24
|
/** The longest a dropped connection may be resumed after: one minute. */
|
|
25
25
|
export declare const MAX_REALTIME_RESUME_WINDOW_MS = 60000;
|
|
26
|
+
/**
|
|
27
|
+
* The most characters (UTF-16 code units, a JavaScript string's `length`) the
|
|
28
|
+
* text of one conversation item may hold: an `input_text` part, or a
|
|
29
|
+
* `function_call_output`'s `output`. A client that bounds a tool's result
|
|
30
|
+
* reads it here, never copies it.
|
|
31
|
+
*/
|
|
32
|
+
export declare const MAX_REALTIME_ITEM_TEXT_CHARS = 1048576;
|
|
26
33
|
/** A client-chosen command identity, unique within one session. */
|
|
27
34
|
export declare const realtimeCommandIdSchema: z.ZodString;
|
|
28
35
|
/** A conversation item's identity within one session. */
|
|
@@ -71,8 +78,11 @@ export declare const realtimeTurnDetectionSchema: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
71
78
|
* so (`capabilities.realtime.inputAudioTranscription`, contract set 4.1.0),
|
|
72
79
|
* and each transcribed turn arrives as deltas that only append and EXACTLY
|
|
73
80
|
* ONE `transcript.done` with `source: 'input_audio'`, the final transcript of
|
|
74
|
-
* that item (contract set 6.0.0), whatever its provider sends.
|
|
75
|
-
*
|
|
81
|
+
* that item (contract set 6.0.0), whatever its provider sends. Both hold only
|
|
82
|
+
* the words of that item's own audio, never an earlier item's
|
|
83
|
+
* (`@kaana.ai/contracts` 6.1.0), even where the provider transcribes a turn
|
|
84
|
+
* the caller went on with as one text. What it costs is settled with the
|
|
85
|
+
* session: where the provider bills the transcription
|
|
76
86
|
* apart from the session model, as `input_transcription_milliseconds` (see
|
|
77
87
|
* `USAGE_UNITS`); where the session's own price includes it, as nothing more.
|
|
78
88
|
*/
|
package/dist/public/realtime.js
CHANGED
|
@@ -28,6 +28,13 @@ export const MAX_REALTIME_SESSION_DURATION_MS = 3_600_000;
|
|
|
28
28
|
export const MAX_REALTIME_SESSION_AUDIO_BYTES = 172_800_000;
|
|
29
29
|
/** The longest a dropped connection may be resumed after: one minute. */
|
|
30
30
|
export const MAX_REALTIME_RESUME_WINDOW_MS = 60_000;
|
|
31
|
+
/**
|
|
32
|
+
* The most characters (UTF-16 code units, a JavaScript string's `length`) the
|
|
33
|
+
* text of one conversation item may hold: an `input_text` part, or a
|
|
34
|
+
* `function_call_output`'s `output`. A client that bounds a tool's result
|
|
35
|
+
* reads it here, never copies it.
|
|
36
|
+
*/
|
|
37
|
+
export const MAX_REALTIME_ITEM_TEXT_CHARS = 1_048_576;
|
|
31
38
|
/** A client-chosen command identity, unique within one session. */
|
|
32
39
|
export const realtimeCommandIdSchema = z.string().min(1).max(128);
|
|
33
40
|
/** A conversation item's identity within one session. */
|
|
@@ -84,8 +91,11 @@ export const realtimeTurnDetectionSchema = z.discriminatedUnion('type', [
|
|
|
84
91
|
* so (`capabilities.realtime.inputAudioTranscription`, contract set 4.1.0),
|
|
85
92
|
* and each transcribed turn arrives as deltas that only append and EXACTLY
|
|
86
93
|
* ONE `transcript.done` with `source: 'input_audio'`, the final transcript of
|
|
87
|
-
* that item (contract set 6.0.0), whatever its provider sends.
|
|
88
|
-
*
|
|
94
|
+
* that item (contract set 6.0.0), whatever its provider sends. Both hold only
|
|
95
|
+
* the words of that item's own audio, never an earlier item's
|
|
96
|
+
* (`@kaana.ai/contracts` 6.1.0), even where the provider transcribes a turn
|
|
97
|
+
* the caller went on with as one text. What it costs is settled with the
|
|
98
|
+
* session: where the provider bills the transcription
|
|
89
99
|
* apart from the session model, as `input_transcription_milliseconds` (see
|
|
90
100
|
* `USAGE_UNITS`); where the session's own price includes it, as nothing more.
|
|
91
101
|
*/
|
|
@@ -188,7 +198,9 @@ export const realtimeSessionLimitsSchema = z
|
|
|
188
198
|
* item echoing it carries only the format and, once known, the transcript.
|
|
189
199
|
*/
|
|
190
200
|
export const realtimeContentPartSchema = z.discriminatedUnion('type', [
|
|
191
|
-
z
|
|
201
|
+
z
|
|
202
|
+
.object({ type: z.literal('input_text'), text: z.string().max(MAX_REALTIME_ITEM_TEXT_CHARS) })
|
|
203
|
+
.strict(),
|
|
192
204
|
z
|
|
193
205
|
.object({
|
|
194
206
|
type: z.literal('input_audio'),
|
|
@@ -237,7 +249,7 @@ export const realtimeConversationItemSchema = z
|
|
|
237
249
|
type: z.literal('function_call_output'),
|
|
238
250
|
itemId: realtimeItemIdSchema.optional(),
|
|
239
251
|
callId: z.string().min(1).max(128),
|
|
240
|
-
output: z.string().max(
|
|
252
|
+
output: z.string().max(MAX_REALTIME_ITEM_TEXT_CHARS),
|
|
241
253
|
})
|
|
242
254
|
.strict(),
|
|
243
255
|
])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaana.ai/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "Kaana inference contract: the Zod schemas of the public API at https://kaana.ai/v1 and, under /internal, of the Oxy-Kaana grant, settlement and signed lane.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
40
40
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
41
|
-
"test": "bun test src"
|
|
41
|
+
"test": "bun test src",
|
|
42
|
+
"prepublishOnly": "bun run typecheck && bun run test && bun run build && make -C ../.. contract-generate"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"zod": ">=4.4.3 <4.5.0"
|