@qvac/inference 0.19.0 → 0.20.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/NOTICE +95 -39
- package/dist/api/audio-gen.d.ts +42 -1
- package/dist/api/audio-gen.js +137 -51
- package/dist/api/delete-cache.d.ts +7 -1
- package/dist/api/delete-cache.js +11 -1
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.js +2 -1
- package/dist/api/text-to-speech.d.ts +31 -4
- package/dist/api/text-to-speech.js +117 -21
- package/dist/api/vector-index.d.ts +142 -0
- package/dist/api/vector-index.js +168 -0
- package/dist/api/world.d.ts +2 -2
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.js +21 -0
- package/dist/handlers/delete-cache.js +3 -0
- package/dist/handlers/vector-index.d.ts +2 -0
- package/dist/handlers/vector-index.js +40 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/registry/models.d.ts +351 -12
- package/dist/models/registry/models.js +2271 -1957
- package/dist/models/registry/resource-profiles.js +135 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.d.ts +2 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +65 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +9 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +24 -7
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.d.ts +46 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.js +218 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.d.ts +1 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +56 -225
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.d.ts +8 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +28 -0
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +248 -0
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +17 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +5 -2
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +1 -2
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.js +1 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +6 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.d.ts +1 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +0 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +6 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +9 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +96 -89
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +0 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +0 -31
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +48 -27
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +239 -135
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +11 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +18 -16
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +11 -4
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +1 -2
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +1 -2
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -38
- package/dist/plugins/builtin/llamacpp-embedding/transform.d.ts +9 -0
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +42 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +1 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +1 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +1 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +8 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +9 -4
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +51 -19
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.d.ts +29 -0
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.js +66 -0
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +10 -0
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +3 -5
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +143 -28
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.d.ts +5 -2
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +182 -66
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +267 -22
- package/dist/plugins/builtin/tts-ggml/plugin.js +94 -35
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +1 -2
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/ops/load-model.js +22 -2
- package/dist/plugins/ops/translate.js +58 -12
- package/dist/plugins/ops/translatepsy-utils.d.ts +17 -0
- package/dist/plugins/ops/translatepsy-utils.js +32 -0
- package/dist/plugins/registry.d.ts +15 -0
- package/dist/plugins/registry.js +133 -15
- package/dist/plugins/turbovec-backend.d.ts +17 -0
- package/dist/plugins/turbovec-backend.js +99 -0
- package/dist/registry.js +4 -0
- package/dist/resources/model-fit/assess.js +169 -68
- package/dist/resources/model-fit/estimators/llm.d.ts +1 -0
- package/dist/resources/model-fit/estimators/llm.js +3 -1
- package/dist/resources/model-fit/floor.d.ts +31 -0
- package/dist/resources/model-fit/floor.js +65 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +46 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.js +214 -0
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +26 -0
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +171 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +42 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +192 -0
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +70 -0
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +372 -0
- package/dist/resources/native.js +5 -4
- package/dist/resources/types.d.ts +1 -3
- package/dist/runtime/env.d.ts +2 -0
- package/dist/runtime/env.js +9 -2
- package/dist/runtime/lifecycle.js +2 -0
- package/dist/runtime/model-registry.d.ts +3 -1
- package/dist/runtime/model-registry.js +2 -1
- package/dist/runtime/request-context.js +17 -0
- package/dist/runtime/vector-index-backend.d.ts +25 -0
- package/dist/runtime/vector-index-backend.js +1 -0
- package/dist/runtime/vector-index-registry.d.ts +76 -0
- package/dist/runtime/vector-index-registry.js +161 -0
- package/dist/schemas/assess-model-fit.d.ts +84 -0
- package/dist/schemas/assess-model-fit.js +72 -3
- package/dist/schemas/audio-gen.d.ts +482 -7
- package/dist/schemas/audio-gen.js +376 -17
- package/dist/schemas/batch-completion-stream.d.ts +10 -0
- package/dist/schemas/batch-completion-stream.js +5 -3
- package/dist/schemas/bci.d.ts +1 -1
- package/dist/schemas/common.d.ts +782 -19
- package/dist/schemas/common.js +8 -1
- package/dist/schemas/completion-event.d.ts +14 -1
- package/dist/schemas/completion-event.js +4 -0
- package/dist/schemas/completion-stream.d.ts +22 -0
- package/dist/schemas/completion-stream.js +41 -4
- package/dist/schemas/config.d.ts +48 -30
- package/dist/schemas/errors.d.ts +4 -0
- package/dist/schemas/errors.js +22 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/llamacpp-config.d.ts +4 -8
- package/dist/schemas/llamacpp-config.js +4 -4
- package/dist/schemas/load-model.d.ts +2604 -180
- package/dist/schemas/model-config-schemas.d.ts +228 -5
- package/dist/schemas/model-ops.d.ts +3 -0
- package/dist/schemas/model-ops.js +6 -0
- package/dist/schemas/plugin.d.ts +21 -11
- package/dist/schemas/sdcpp-config.d.ts +221 -4
- package/dist/schemas/sdcpp-config.js +128 -22
- package/dist/schemas/text-to-speech.d.ts +780 -19
- package/dist/schemas/text-to-speech.js +298 -44
- package/dist/schemas/transcription-config.js +7 -4
- package/dist/schemas/vector-index.d.ts +194 -0
- package/dist/schemas/vector-index.js +185 -0
- package/dist/utils/addon-responses.d.ts +30 -3
- package/dist/utils/aggregate-events.d.ts +3 -1
- package/dist/utils/aggregate-events.js +7 -1
- package/dist/utils/tts-stats.d.ts +15 -11
- package/dist/utils/tts-stats.js +33 -11
- package/package.json +29 -26
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Storage modes of the native vector index. The `TURBOVEC_*` modes are the
|
|
4
|
+
* quantised TurboVec formats and require a dimension divisible by 8 and no
|
|
5
|
+
* greater than 1024. `F32`, `Q8` and `Q4` are the generic stores of the same
|
|
6
|
+
* addon and accept any dimension. Declared as a name-to-value map, like
|
|
7
|
+
* `ModelType`, so the contract carries the names for generated clients.
|
|
8
|
+
*/
|
|
9
|
+
export declare const VectorIndexStorage: {
|
|
10
|
+
readonly F32: "f32";
|
|
11
|
+
readonly Q8: "q8";
|
|
12
|
+
readonly Q4: "q4";
|
|
13
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
14
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
15
|
+
};
|
|
16
|
+
export type VectorIndexStorage = (typeof VectorIndexStorage)[keyof typeof VectorIndexStorage];
|
|
17
|
+
export declare const vectorIndexStorageSchema: z.ZodEnum<{
|
|
18
|
+
readonly F32: "f32";
|
|
19
|
+
readonly Q8: "q8";
|
|
20
|
+
readonly Q4: "q4";
|
|
21
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
22
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
23
|
+
}>;
|
|
24
|
+
export declare const DEFAULT_VECTOR_INDEX_STORAGE: VectorIndexStorage;
|
|
25
|
+
/**
|
|
26
|
+
* The native index pads short search result rows with UINT64_MAX, so that
|
|
27
|
+
* value can never be used as an id.
|
|
28
|
+
*/
|
|
29
|
+
export declare const VECTOR_ID_RESERVED = "18446744073709551615";
|
|
30
|
+
/**
|
|
31
|
+
* An id as it travels over the wire: a decimal string holding an unsigned
|
|
32
|
+
* 64-bit integer, or a non-negative safe integer. Results always use the
|
|
33
|
+
* string form so values above 2^53 survive JSON.
|
|
34
|
+
*/
|
|
35
|
+
export declare const vectorIdWireSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
36
|
+
export type VectorIdWire = z.infer<typeof vectorIdWireSchema>;
|
|
37
|
+
/** An id as callers pass it. A `bigint` is converted to its decimal string before sending. */
|
|
38
|
+
export type VectorId = VectorIdWire | bigint;
|
|
39
|
+
export declare const createVectorIndexParamsSchema: z.ZodObject<{
|
|
40
|
+
dim: z.ZodNumber;
|
|
41
|
+
storage: z.ZodDefault<z.ZodEnum<{
|
|
42
|
+
readonly F32: "f32";
|
|
43
|
+
readonly Q8: "q8";
|
|
44
|
+
readonly Q4: "q4";
|
|
45
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
46
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
47
|
+
}>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const loadVectorIndexParamsSchema: z.ZodObject<{
|
|
50
|
+
path: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export declare const vectorIndexAddParamsSchema: z.ZodObject<{
|
|
53
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
54
|
+
vectors: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const vectorIndexSearchParamsSchema: z.ZodObject<{
|
|
57
|
+
queries: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
58
|
+
k: z.ZodNumber;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export declare const vectorIndexIdsParamsSchema: z.ZodObject<{
|
|
61
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export declare const vectorIndexWriteParamsSchema: z.ZodObject<{
|
|
64
|
+
path: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const vectorIndexRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
67
|
+
dim: z.ZodNumber;
|
|
68
|
+
storage: z.ZodDefault<z.ZodEnum<{
|
|
69
|
+
readonly F32: "f32";
|
|
70
|
+
readonly Q8: "q8";
|
|
71
|
+
readonly Q4: "q4";
|
|
72
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
73
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
74
|
+
}>>;
|
|
75
|
+
operation: z.ZodLiteral<"create">;
|
|
76
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
path: z.ZodString;
|
|
79
|
+
operation: z.ZodLiteral<"load">;
|
|
80
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
83
|
+
vectors: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
84
|
+
operation: z.ZodLiteral<"add">;
|
|
85
|
+
indexId: z.ZodString;
|
|
86
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
queries: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
89
|
+
k: z.ZodNumber;
|
|
90
|
+
operation: z.ZodLiteral<"search">;
|
|
91
|
+
indexId: z.ZodString;
|
|
92
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
95
|
+
operation: z.ZodLiteral<"remove">;
|
|
96
|
+
indexId: z.ZodString;
|
|
97
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
ids: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
100
|
+
operation: z.ZodLiteral<"contains">;
|
|
101
|
+
indexId: z.ZodString;
|
|
102
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
103
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
104
|
+
path: z.ZodString;
|
|
105
|
+
operation: z.ZodLiteral<"write">;
|
|
106
|
+
indexId: z.ZodString;
|
|
107
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
operation: z.ZodLiteral<"dispose">;
|
|
110
|
+
indexId: z.ZodString;
|
|
111
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
112
|
+
}, z.core.$strip>], "operation">;
|
|
113
|
+
export declare const vectorIndexHitSchema: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
score: z.ZodNumber;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
export declare const vectorIndexResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
119
|
+
operation: z.ZodLiteral<"create">;
|
|
120
|
+
indexId: z.ZodString;
|
|
121
|
+
dim: z.ZodNumber;
|
|
122
|
+
storage: z.ZodEnum<{
|
|
123
|
+
readonly F32: "f32";
|
|
124
|
+
readonly Q8: "q8";
|
|
125
|
+
readonly Q4: "q4";
|
|
126
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
127
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
128
|
+
}>;
|
|
129
|
+
length: z.ZodNumber;
|
|
130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
132
|
+
operation: z.ZodLiteral<"load">;
|
|
133
|
+
indexId: z.ZodString;
|
|
134
|
+
dim: z.ZodNumber;
|
|
135
|
+
storage: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
readonly F32: "f32";
|
|
137
|
+
readonly Q8: "q8";
|
|
138
|
+
readonly Q4: "q4";
|
|
139
|
+
readonly TURBOVEC_Q4: "turbovec-q4";
|
|
140
|
+
readonly TURBOVEC_Q2: "turbovec-q2";
|
|
141
|
+
}>>;
|
|
142
|
+
length: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
145
|
+
operation: z.ZodLiteral<"add">;
|
|
146
|
+
length: z.ZodNumber;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
149
|
+
operation: z.ZodLiteral<"search">;
|
|
150
|
+
results: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
score: z.ZodNumber;
|
|
153
|
+
}, z.core.$strip>>>;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
156
|
+
operation: z.ZodLiteral<"remove">;
|
|
157
|
+
removed: z.ZodArray<z.ZodBoolean>;
|
|
158
|
+
length: z.ZodNumber;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
161
|
+
operation: z.ZodLiteral<"contains">;
|
|
162
|
+
present: z.ZodArray<z.ZodBoolean>;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
165
|
+
operation: z.ZodLiteral<"write">;
|
|
166
|
+
path: z.ZodString;
|
|
167
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
168
|
+
type: z.ZodLiteral<"vectorIndex">;
|
|
169
|
+
operation: z.ZodLiteral<"dispose">;
|
|
170
|
+
disposed: z.ZodBoolean;
|
|
171
|
+
}, z.core.$strip>], "operation">;
|
|
172
|
+
export type VectorIndexRequest = z.input<typeof vectorIndexRequestSchema>;
|
|
173
|
+
export type VectorIndexResponse = z.infer<typeof vectorIndexResponseSchema>;
|
|
174
|
+
export type VectorIndexHit = z.infer<typeof vectorIndexHitSchema>;
|
|
175
|
+
export type CreateVectorIndexParams = z.input<typeof createVectorIndexParamsSchema>;
|
|
176
|
+
export type LoadVectorIndexParams = z.infer<typeof loadVectorIndexParamsSchema>;
|
|
177
|
+
export interface VectorIndexAddParams {
|
|
178
|
+
ids: VectorId[];
|
|
179
|
+
vectors: number[][];
|
|
180
|
+
}
|
|
181
|
+
export interface VectorIndexIdsParams {
|
|
182
|
+
ids: VectorId[];
|
|
183
|
+
}
|
|
184
|
+
export type VectorIndexSearchParams = {
|
|
185
|
+
query: number[];
|
|
186
|
+
k: number;
|
|
187
|
+
} | {
|
|
188
|
+
queries: number[][];
|
|
189
|
+
k: number;
|
|
190
|
+
};
|
|
191
|
+
export type VectorIndexWriteParams = z.infer<typeof vectorIndexWriteParamsSchema>;
|
|
192
|
+
export declare function toWireVectorIds(ids: readonly VectorId[]): VectorIdWire[];
|
|
193
|
+
/** Index of the first row whose length differs from `dim`, or -1 when every row matches. */
|
|
194
|
+
export declare function findVectorRowLengthMismatch(rows: readonly (readonly number[])[], dim: number): number;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// ============== Storage vocabulary ==============
|
|
3
|
+
/**
|
|
4
|
+
* Storage modes of the native vector index. The `TURBOVEC_*` modes are the
|
|
5
|
+
* quantised TurboVec formats and require a dimension divisible by 8 and no
|
|
6
|
+
* greater than 1024. `F32`, `Q8` and `Q4` are the generic stores of the same
|
|
7
|
+
* addon and accept any dimension. Declared as a name-to-value map, like
|
|
8
|
+
* `ModelType`, so the contract carries the names for generated clients.
|
|
9
|
+
*/
|
|
10
|
+
export const VectorIndexStorage = {
|
|
11
|
+
F32: 'f32',
|
|
12
|
+
Q8: 'q8',
|
|
13
|
+
Q4: 'q4',
|
|
14
|
+
TURBOVEC_Q4: 'turbovec-q4',
|
|
15
|
+
TURBOVEC_Q2: 'turbovec-q2'
|
|
16
|
+
};
|
|
17
|
+
export const vectorIndexStorageSchema = z.enum(VectorIndexStorage);
|
|
18
|
+
export const DEFAULT_VECTOR_INDEX_STORAGE = VectorIndexStorage.TURBOVEC_Q4;
|
|
19
|
+
// ============== Ids ==============
|
|
20
|
+
/**
|
|
21
|
+
* The native index pads short search result rows with UINT64_MAX, so that
|
|
22
|
+
* value can never be used as an id.
|
|
23
|
+
*/
|
|
24
|
+
export const VECTOR_ID_RESERVED = '18446744073709551615';
|
|
25
|
+
const RESERVED_ID = BigInt(VECTOR_ID_RESERVED);
|
|
26
|
+
const VECTOR_ID_PATTERN = /^(0|[1-9][0-9]{0,19})$/;
|
|
27
|
+
// Zod runs every check even after the regex fails, so the range check must
|
|
28
|
+
// not call BigInt on a string the pattern already rejected.
|
|
29
|
+
const vectorIdStringSchema = z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(VECTOR_ID_PATTERN, 'id must be a decimal unsigned 64-bit integer')
|
|
32
|
+
.refine((value) => VECTOR_ID_PATTERN.test(value) && BigInt(value) < RESERVED_ID, `id must be below ${VECTOR_ID_RESERVED}`);
|
|
33
|
+
const vectorIdNumberSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
34
|
+
/**
|
|
35
|
+
* An id as it travels over the wire: a decimal string holding an unsigned
|
|
36
|
+
* 64-bit integer, or a non-negative safe integer. Results always use the
|
|
37
|
+
* string form so values above 2^53 survive JSON.
|
|
38
|
+
*/
|
|
39
|
+
export const vectorIdWireSchema = z
|
|
40
|
+
.union([vectorIdStringSchema, vectorIdNumberSchema])
|
|
41
|
+
.meta({ title: 'VectorId' });
|
|
42
|
+
const vectorIdsSchema = z.array(vectorIdWireSchema).min(1, 'at least one id is required');
|
|
43
|
+
const vectorRowSchema = z.array(z.number()).min(1);
|
|
44
|
+
const vectorRowsSchema = z.array(vectorRowSchema).min(1, 'at least one vector is required');
|
|
45
|
+
const indexIdSchema = z.string().min(1);
|
|
46
|
+
const snapshotPathSchema = z.string().min(1, 'path cannot be empty');
|
|
47
|
+
const lengthSchema = z.number().int().min(0);
|
|
48
|
+
// ============== Operation params ==============
|
|
49
|
+
export const createVectorIndexParamsSchema = z.object({
|
|
50
|
+
dim: z.number().int().positive(),
|
|
51
|
+
storage: vectorIndexStorageSchema.default(DEFAULT_VECTOR_INDEX_STORAGE)
|
|
52
|
+
});
|
|
53
|
+
export const loadVectorIndexParamsSchema = z.object({
|
|
54
|
+
path: snapshotPathSchema
|
|
55
|
+
});
|
|
56
|
+
export const vectorIndexAddParamsSchema = z.object({
|
|
57
|
+
ids: vectorIdsSchema,
|
|
58
|
+
vectors: vectorRowsSchema
|
|
59
|
+
});
|
|
60
|
+
export const vectorIndexSearchParamsSchema = z.object({
|
|
61
|
+
queries: vectorRowsSchema,
|
|
62
|
+
k: z.number().int().positive()
|
|
63
|
+
});
|
|
64
|
+
export const vectorIndexIdsParamsSchema = z.object({
|
|
65
|
+
ids: vectorIdsSchema
|
|
66
|
+
});
|
|
67
|
+
export const vectorIndexWriteParamsSchema = z.object({
|
|
68
|
+
path: snapshotPathSchema
|
|
69
|
+
});
|
|
70
|
+
// ============== Requests ==============
|
|
71
|
+
const vectorIndexTypeField = { type: z.literal('vectorIndex') };
|
|
72
|
+
const handleField = { indexId: indexIdSchema };
|
|
73
|
+
const vectorIndexCreateRequestSchema = createVectorIndexParamsSchema.extend({
|
|
74
|
+
...vectorIndexTypeField,
|
|
75
|
+
operation: z.literal('create')
|
|
76
|
+
});
|
|
77
|
+
const vectorIndexLoadRequestSchema = loadVectorIndexParamsSchema.extend({
|
|
78
|
+
...vectorIndexTypeField,
|
|
79
|
+
operation: z.literal('load')
|
|
80
|
+
});
|
|
81
|
+
const vectorIndexAddRequestSchema = vectorIndexAddParamsSchema.extend({
|
|
82
|
+
...vectorIndexTypeField,
|
|
83
|
+
...handleField,
|
|
84
|
+
operation: z.literal('add')
|
|
85
|
+
});
|
|
86
|
+
const vectorIndexSearchRequestSchema = vectorIndexSearchParamsSchema.extend({
|
|
87
|
+
...vectorIndexTypeField,
|
|
88
|
+
...handleField,
|
|
89
|
+
operation: z.literal('search')
|
|
90
|
+
});
|
|
91
|
+
const vectorIndexRemoveRequestSchema = vectorIndexIdsParamsSchema.extend({
|
|
92
|
+
...vectorIndexTypeField,
|
|
93
|
+
...handleField,
|
|
94
|
+
operation: z.literal('remove')
|
|
95
|
+
});
|
|
96
|
+
const vectorIndexContainsRequestSchema = vectorIndexIdsParamsSchema.extend({
|
|
97
|
+
...vectorIndexTypeField,
|
|
98
|
+
...handleField,
|
|
99
|
+
operation: z.literal('contains')
|
|
100
|
+
});
|
|
101
|
+
const vectorIndexWriteRequestSchema = vectorIndexWriteParamsSchema.extend({
|
|
102
|
+
...vectorIndexTypeField,
|
|
103
|
+
...handleField,
|
|
104
|
+
operation: z.literal('write')
|
|
105
|
+
});
|
|
106
|
+
const vectorIndexDisposeRequestSchema = z.object({
|
|
107
|
+
...vectorIndexTypeField,
|
|
108
|
+
...handleField,
|
|
109
|
+
operation: z.literal('dispose')
|
|
110
|
+
});
|
|
111
|
+
export const vectorIndexRequestSchema = z.discriminatedUnion('operation', [
|
|
112
|
+
vectorIndexCreateRequestSchema,
|
|
113
|
+
vectorIndexLoadRequestSchema,
|
|
114
|
+
vectorIndexAddRequestSchema,
|
|
115
|
+
vectorIndexSearchRequestSchema,
|
|
116
|
+
vectorIndexRemoveRequestSchema,
|
|
117
|
+
vectorIndexContainsRequestSchema,
|
|
118
|
+
vectorIndexWriteRequestSchema,
|
|
119
|
+
vectorIndexDisposeRequestSchema
|
|
120
|
+
]);
|
|
121
|
+
// ============== Responses ==============
|
|
122
|
+
export const vectorIndexHitSchema = z.object({
|
|
123
|
+
id: z.string(),
|
|
124
|
+
score: z.number()
|
|
125
|
+
});
|
|
126
|
+
const vectorIndexResponseBaseSchema = z.object(vectorIndexTypeField);
|
|
127
|
+
const vectorIndexCreateResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
128
|
+
operation: z.literal('create'),
|
|
129
|
+
indexId: indexIdSchema,
|
|
130
|
+
dim: z.number().int().positive(),
|
|
131
|
+
storage: vectorIndexStorageSchema,
|
|
132
|
+
length: lengthSchema
|
|
133
|
+
});
|
|
134
|
+
// A loaded snapshot reports its storage only when the backend can derive it;
|
|
135
|
+
// the native index exposes a bit width, and 4 bits is ambiguous.
|
|
136
|
+
const vectorIndexLoadResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
137
|
+
operation: z.literal('load'),
|
|
138
|
+
indexId: indexIdSchema,
|
|
139
|
+
dim: z.number().int().positive(),
|
|
140
|
+
storage: vectorIndexStorageSchema.optional(),
|
|
141
|
+
length: lengthSchema
|
|
142
|
+
});
|
|
143
|
+
const vectorIndexAddResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
144
|
+
operation: z.literal('add'),
|
|
145
|
+
length: lengthSchema
|
|
146
|
+
});
|
|
147
|
+
const vectorIndexSearchResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
148
|
+
operation: z.literal('search'),
|
|
149
|
+
results: z.array(z.array(vectorIndexHitSchema))
|
|
150
|
+
});
|
|
151
|
+
const vectorIndexRemoveResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
152
|
+
operation: z.literal('remove'),
|
|
153
|
+
removed: z.array(z.boolean()),
|
|
154
|
+
length: lengthSchema
|
|
155
|
+
});
|
|
156
|
+
const vectorIndexContainsResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
157
|
+
operation: z.literal('contains'),
|
|
158
|
+
present: z.array(z.boolean())
|
|
159
|
+
});
|
|
160
|
+
const vectorIndexWriteResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
161
|
+
operation: z.literal('write'),
|
|
162
|
+
path: z.string()
|
|
163
|
+
});
|
|
164
|
+
const vectorIndexDisposeResponseSchema = vectorIndexResponseBaseSchema.extend({
|
|
165
|
+
operation: z.literal('dispose'),
|
|
166
|
+
disposed: z.boolean()
|
|
167
|
+
});
|
|
168
|
+
export const vectorIndexResponseSchema = z.discriminatedUnion('operation', [
|
|
169
|
+
vectorIndexCreateResponseSchema,
|
|
170
|
+
vectorIndexLoadResponseSchema,
|
|
171
|
+
vectorIndexAddResponseSchema,
|
|
172
|
+
vectorIndexSearchResponseSchema,
|
|
173
|
+
vectorIndexRemoveResponseSchema,
|
|
174
|
+
vectorIndexContainsResponseSchema,
|
|
175
|
+
vectorIndexWriteResponseSchema,
|
|
176
|
+
vectorIndexDisposeResponseSchema
|
|
177
|
+
]);
|
|
178
|
+
// ============== Helpers shared by the in-process and RPC clients ==============
|
|
179
|
+
export function toWireVectorIds(ids) {
|
|
180
|
+
return ids.map((id) => (typeof id === 'bigint' ? id.toString() : id));
|
|
181
|
+
}
|
|
182
|
+
/** Index of the first row whose length differs from `dim`, or -1 when every row matches. */
|
|
183
|
+
export function findVectorRowLengthMismatch(rows, dim) {
|
|
184
|
+
return rows.findIndex((row) => row.length !== dim);
|
|
185
|
+
}
|
|
@@ -3,10 +3,12 @@ import type TranslationNmtcpp from '@qvac/translation-nmtcpp';
|
|
|
3
3
|
export interface LlmStats {
|
|
4
4
|
TTFT?: number;
|
|
5
5
|
TPS?: number;
|
|
6
|
+
ppTPS?: number;
|
|
6
7
|
CacheTokens?: number;
|
|
7
8
|
promptTokens?: number;
|
|
8
9
|
generatedTokens?: number;
|
|
9
10
|
avgConcurrentSeq?: number;
|
|
11
|
+
toolDefinitionsDropped?: number;
|
|
10
12
|
backendDevice?: 'cpu' | 'gpu';
|
|
11
13
|
stopReason?: 'none' | 'eos' | 'antiprompt' | 'predictionLimit' | 'sequenceLimit' | 'contextOverflow';
|
|
12
14
|
}
|
|
@@ -16,17 +18,42 @@ export interface LlmResponse {
|
|
|
16
18
|
}
|
|
17
19
|
export type NmtStats = TranslationNmtcpp.RuntimeStats;
|
|
18
20
|
export type NmtResponse = TranslationNmtcpp.TranslationResponse;
|
|
21
|
+
/**
|
|
22
|
+
* @qvac/tts-ggml `RuntimeStats`. Restated here rather than imported from the
|
|
23
|
+
* addon so a typecheck does not depend on which addon version happens to be
|
|
24
|
+
* installed; keep it in step with the addon's `RuntimeStats`.
|
|
25
|
+
*/
|
|
19
26
|
export interface TtsStats {
|
|
20
27
|
audioDurationMs?: number;
|
|
28
|
+
totalTime?: number;
|
|
29
|
+
realTimeFactor?: number;
|
|
30
|
+
tokensPerSecond?: number;
|
|
21
31
|
totalSamples?: number;
|
|
32
|
+
/** Audio8 only: codec frames generated, on a fixed 46 ms grid. */
|
|
33
|
+
generatedFrames?: number;
|
|
34
|
+
backendDevice?: number;
|
|
35
|
+
backendId?: number;
|
|
36
|
+
gpuUnsupported?: number;
|
|
22
37
|
enhancerBackendDevice?: number;
|
|
23
38
|
enhancerBackendId?: number;
|
|
24
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* @qvac/tts-ggml `TTSOutputChunk & SentenceStreamChunkMeta`. The chunker runs
|
|
42
|
+
* for `runStream()` and for `run({ streamOutput: true })` alike, so the meta
|
|
43
|
+
* fields are populated on both paths.
|
|
44
|
+
*/
|
|
45
|
+
export interface TtsOutputChunk {
|
|
46
|
+
outputArray: ArrayLike<number>;
|
|
47
|
+
/** Rate of `outputArray`; moves with `outputSampleRate` and the enhancer. */
|
|
48
|
+
sampleRate?: number;
|
|
49
|
+
chunkIndex?: number;
|
|
50
|
+
sentenceChunk?: string;
|
|
51
|
+
/** True on the final pre-chunked output; undefined when it is not known up front. */
|
|
52
|
+
isLast?: boolean;
|
|
53
|
+
}
|
|
25
54
|
export interface TtsResponse {
|
|
26
55
|
stats?: TtsStats;
|
|
27
|
-
iterate(): AsyncIterable<
|
|
28
|
-
outputArray: ArrayLike<number>;
|
|
29
|
-
}>;
|
|
56
|
+
iterate(): AsyncIterable<TtsOutputChunk>;
|
|
30
57
|
}
|
|
31
58
|
export interface EmbedStats {
|
|
32
59
|
total_time_ms?: number;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall } from '../schemas/index.js';
|
|
1
|
+
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall, ToolCallError } from '../schemas/index.js';
|
|
2
2
|
import { type ToolHandlerMap } from './tool-helpers.js';
|
|
3
3
|
export type AggregatedEvents = {
|
|
4
4
|
contentText: string;
|
|
5
5
|
thinkingText: string;
|
|
6
6
|
stats: CompletionStats | undefined;
|
|
7
7
|
toolCalls: ToolCall[];
|
|
8
|
+
/** Tool-call regions that failed to parse or validate; see `CompletionFinal.toolErrors`. */
|
|
9
|
+
toolErrors: ToolCallError[];
|
|
8
10
|
rawFullText: string | undefined;
|
|
9
11
|
error: CompletionError | undefined;
|
|
10
12
|
stopReason: StopReason | undefined;
|
|
@@ -9,6 +9,7 @@ export function aggregateEvents(events) {
|
|
|
9
9
|
let stopReason;
|
|
10
10
|
let cancelled = false;
|
|
11
11
|
const toolCalls = [];
|
|
12
|
+
const toolErrors = [];
|
|
12
13
|
for (const event of events) {
|
|
13
14
|
if (event.type === 'contentDelta') {
|
|
14
15
|
contentText += event.text;
|
|
@@ -22,6 +23,9 @@ export function aggregateEvents(events) {
|
|
|
22
23
|
else if (event.type === 'toolCall') {
|
|
23
24
|
toolCalls.push(event.call);
|
|
24
25
|
}
|
|
26
|
+
else if (event.type === 'toolError') {
|
|
27
|
+
toolErrors.push(event.error);
|
|
28
|
+
}
|
|
25
29
|
else if (event.type === 'completionDone') {
|
|
26
30
|
if ('raw' in event && event.raw) {
|
|
27
31
|
rawFullText = event.raw.fullText;
|
|
@@ -47,6 +51,7 @@ export function aggregateEvents(events) {
|
|
|
47
51
|
thinkingText,
|
|
48
52
|
stats,
|
|
49
53
|
toolCalls,
|
|
54
|
+
toolErrors,
|
|
50
55
|
rawFullText,
|
|
51
56
|
error,
|
|
52
57
|
stopReason,
|
|
@@ -54,7 +59,7 @@ export function aggregateEvents(events) {
|
|
|
54
59
|
};
|
|
55
60
|
}
|
|
56
61
|
export function buildFinalFromEvents(events, handlers) {
|
|
57
|
-
const { contentText, thinkingText, stats, toolCalls, rawFullText, error, stopReason, cancelled } = aggregateEvents(events);
|
|
62
|
+
const { contentText, thinkingText, stats, toolCalls, toolErrors, rawFullText, error, stopReason, cancelled } = aggregateEvents(events);
|
|
58
63
|
const attachedToolCalls = attachHandlersToToolCalls(toolCalls, handlers);
|
|
59
64
|
const fullText = rawFullText ?? contentText;
|
|
60
65
|
const cacheableAssistantContent = attachedToolCalls.length === 0 ? normalizeAssistantCacheContent(fullText) : undefined;
|
|
@@ -62,6 +67,7 @@ export function buildFinalFromEvents(events, handlers) {
|
|
|
62
67
|
contentText,
|
|
63
68
|
...(thinkingText && { thinkingText }),
|
|
64
69
|
toolCalls: attachedToolCalls,
|
|
70
|
+
...(toolErrors.length > 0 && { toolErrors }),
|
|
65
71
|
...(stats && { stats }),
|
|
66
72
|
raw: { fullText },
|
|
67
73
|
...(cacheableAssistantContent !== undefined && {
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import type { TtsStats } from '../schemas/index.js';
|
|
2
|
+
import type { TtsStats as AddonTtsStats, TtsOutputChunk } from './addon-responses.js';
|
|
2
3
|
/**
|
|
3
4
|
* Shared types and utilities for TTS operations.
|
|
4
5
|
* Used by both text-to-speech.ts and text-to-speech-stream.ts.
|
|
5
6
|
*/
|
|
6
|
-
export type TtsStreamChunk =
|
|
7
|
-
outputArray: ArrayLike<number>;
|
|
8
|
-
chunkIndex?: number;
|
|
9
|
-
sentenceChunk?: string;
|
|
10
|
-
};
|
|
7
|
+
export type TtsStreamChunk = TtsOutputChunk;
|
|
11
8
|
export type TtsOpYield = {
|
|
12
9
|
buffer: number[];
|
|
10
|
+
sampleRate?: number;
|
|
13
11
|
chunkIndex?: number;
|
|
14
12
|
sentenceChunk?: string;
|
|
13
|
+
isLast?: boolean;
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Everything an addon chunk carries beyond its PCM. Shared by both TTS ops so
|
|
17
|
+
* the plain `stream: true` path and the sentence-stream path emit the same
|
|
18
|
+
* shape — they run the same addon chunker, and previously only the latter
|
|
19
|
+
* forwarded the metadata.
|
|
20
|
+
*/
|
|
21
|
+
export declare function chunkMetadata(chunk: TtsStreamChunk): {
|
|
22
|
+
isLast?: boolean;
|
|
23
|
+
sentenceChunk?: string;
|
|
24
|
+
chunkIndex?: number;
|
|
25
|
+
sampleRate?: number;
|
|
21
26
|
};
|
|
22
27
|
export declare function collectTtsStats(response: {
|
|
23
28
|
stats?: AddonTtsStats;
|
|
24
29
|
}): TtsStats;
|
|
25
|
-
export {};
|
package/dist/utils/tts-stats.js
CHANGED
|
@@ -1,16 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything an addon chunk carries beyond its PCM. Shared by both TTS ops so
|
|
3
|
+
* the plain `stream: true` path and the sentence-stream path emit the same
|
|
4
|
+
* shape — they run the same addon chunker, and previously only the latter
|
|
5
|
+
* forwarded the metadata.
|
|
6
|
+
*/
|
|
7
|
+
export function chunkMetadata(chunk) {
|
|
8
|
+
return {
|
|
9
|
+
...(chunk.sampleRate !== undefined ? { sampleRate: chunk.sampleRate } : {}),
|
|
10
|
+
...(chunk.chunkIndex !== undefined ? { chunkIndex: chunk.chunkIndex } : {}),
|
|
11
|
+
...(typeof chunk.sentenceChunk === 'string' && chunk.sentenceChunk.length > 0
|
|
12
|
+
? { sentenceChunk: chunk.sentenceChunk }
|
|
13
|
+
: {}),
|
|
14
|
+
...(chunk.isLast !== undefined ? { isLast: chunk.isLast } : {})
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// Field-for-field, apart from `audioDurationMs` -> `audioDuration`, which keeps
|
|
18
|
+
// the name the SDK has always exposed.
|
|
1
19
|
export function collectTtsStats(response) {
|
|
20
|
+
const stats = response.stats;
|
|
21
|
+
if (!stats)
|
|
22
|
+
return {};
|
|
2
23
|
return {
|
|
3
|
-
...(
|
|
4
|
-
|
|
5
|
-
}),
|
|
6
|
-
...(
|
|
7
|
-
|
|
8
|
-
}),
|
|
9
|
-
...(
|
|
10
|
-
|
|
24
|
+
...(stats.audioDurationMs !== undefined && { audioDuration: stats.audioDurationMs }),
|
|
25
|
+
...(stats.totalTime !== undefined && { totalTime: stats.totalTime }),
|
|
26
|
+
...(stats.realTimeFactor !== undefined && { realTimeFactor: stats.realTimeFactor }),
|
|
27
|
+
...(stats.tokensPerSecond !== undefined && { tokensPerSecond: stats.tokensPerSecond }),
|
|
28
|
+
...(stats.totalSamples !== undefined && { totalSamples: stats.totalSamples }),
|
|
29
|
+
...(stats.generatedFrames !== undefined && { generatedFrames: stats.generatedFrames }),
|
|
30
|
+
...(stats.backendDevice !== undefined && { backendDevice: stats.backendDevice }),
|
|
31
|
+
...(stats.backendId !== undefined && { backendId: stats.backendId }),
|
|
32
|
+
...(stats.gpuUnsupported !== undefined && { gpuUnsupported: stats.gpuUnsupported }),
|
|
33
|
+
...(stats.enhancerBackendDevice !== undefined && {
|
|
34
|
+
enhancerBackendDevice: stats.enhancerBackendDevice
|
|
11
35
|
}),
|
|
12
|
-
...(
|
|
13
|
-
enhancerBackendId: response.stats.enhancerBackendId
|
|
14
|
-
})
|
|
36
|
+
...(stats.enhancerBackendId !== undefined && { enhancerBackendId: stats.enhancerBackendId })
|
|
15
37
|
};
|
|
16
38
|
}
|