@dbx-tools/model-rs 0.6.224 → 0.6.226
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/README.md +10 -5
- package/index.ts +1 -1
- package/lib/index.js +383 -29
- package/package.json +8 -8
- package/src/_bindings-ffi.ts +36 -0
- package/src/_bindings.ts +610 -33
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# `@dbx-tools/model-rs`
|
|
2
2
|
|
|
3
|
-
Generated Node bindings for the
|
|
4
|
-
by the `dbx-tools-model` Rust crate.
|
|
3
|
+
Generated Node bindings for the catalogue-ranking, model-routing, and
|
|
4
|
+
capability policy owned by the `dbx-tools-model` Rust crate.
|
|
5
5
|
|
|
6
6
|
```ts
|
|
7
7
|
import {
|
|
@@ -20,6 +20,10 @@ effort === ReasoningEffort.None;
|
|
|
20
20
|
|
|
21
21
|
Key exports:
|
|
22
22
|
|
|
23
|
+
- `rankModels` classifies and ranks a live endpoint catalogue with Rust's fuzzy
|
|
24
|
+
scoring, class ceilings, version ordering, and model-variant preferences.
|
|
25
|
+
- `modelFamily` and `reasoningEffortNamesByFamily` publish family grouping and
|
|
26
|
+
ordered provider wire values without a handwritten TypeScript enum.
|
|
23
27
|
- `modelServingApi` / `isResponsesOnly` select Chat Completions or native
|
|
24
28
|
Responses without duplicating version thresholds in TypeScript.
|
|
25
29
|
- `chatToolReasoningEffort` returns the effort required by a tool-bearing Chat
|
|
@@ -28,6 +32,7 @@ Key exports:
|
|
|
28
32
|
- `supportsToolsByFamily` applies the conservative complete-tool-round-trip
|
|
29
33
|
policy shared with the Rust model proxy.
|
|
30
34
|
|
|
31
|
-
Use [`@dbx-tools/model`](../model) for workspace catalogue I/O,
|
|
32
|
-
selection, and cached discovery. This package is
|
|
33
|
-
surface consumed by `@dbx-tools/model` and
|
|
35
|
+
Use [`@dbx-tools/model`](../model) for workspace catalogue I/O, public endpoint
|
|
36
|
+
contracts, convenient model selection, and cached discovery. This package is
|
|
37
|
+
the generated native policy surface consumed by `@dbx-tools/model` and
|
|
38
|
+
`@dbx-tools/appkit-mastra`.
|
package/index.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -258,11 +258,26 @@ var DEFINITIONS = {
|
|
|
258
258
|
ret: FfiType.Int8,
|
|
259
259
|
hasRustCallStatus: true
|
|
260
260
|
},
|
|
261
|
+
uniffi_dbx_tools_model_fn_func_model_family: {
|
|
262
|
+
args: [FfiType.RustBuffer],
|
|
263
|
+
ret: FfiType.RustBuffer,
|
|
264
|
+
hasRustCallStatus: true
|
|
265
|
+
},
|
|
261
266
|
uniffi_dbx_tools_model_fn_func_model_serving_api: {
|
|
262
267
|
args: [FfiType.RustBuffer],
|
|
263
268
|
ret: FfiType.RustBuffer,
|
|
264
269
|
hasRustCallStatus: true
|
|
265
270
|
},
|
|
271
|
+
uniffi_dbx_tools_model_fn_func_rank_models: {
|
|
272
|
+
args: [FfiType.RustBuffer, FfiType.RustBuffer],
|
|
273
|
+
ret: FfiType.RustBuffer,
|
|
274
|
+
hasRustCallStatus: true
|
|
275
|
+
},
|
|
276
|
+
uniffi_dbx_tools_model_fn_func_reasoning_effort_names_by_family: {
|
|
277
|
+
args: [FfiType.RustBuffer],
|
|
278
|
+
ret: FfiType.RustBuffer,
|
|
279
|
+
hasRustCallStatus: true
|
|
280
|
+
},
|
|
266
281
|
uniffi_dbx_tools_model_fn_func_reasoning_efforts_by_family: {
|
|
267
282
|
args: [FfiType.RustBuffer],
|
|
268
283
|
ret: FfiType.RustBuffer,
|
|
@@ -288,11 +303,26 @@ var DEFINITIONS = {
|
|
|
288
303
|
ret: FfiType.UInt16,
|
|
289
304
|
hasRustCallStatus: false
|
|
290
305
|
},
|
|
306
|
+
uniffi_dbx_tools_model_checksum_func_model_family: {
|
|
307
|
+
args: [],
|
|
308
|
+
ret: FfiType.UInt16,
|
|
309
|
+
hasRustCallStatus: false
|
|
310
|
+
},
|
|
291
311
|
uniffi_dbx_tools_model_checksum_func_model_serving_api: {
|
|
292
312
|
args: [],
|
|
293
313
|
ret: FfiType.UInt16,
|
|
294
314
|
hasRustCallStatus: false
|
|
295
315
|
},
|
|
316
|
+
uniffi_dbx_tools_model_checksum_func_rank_models: {
|
|
317
|
+
args: [],
|
|
318
|
+
ret: FfiType.UInt16,
|
|
319
|
+
hasRustCallStatus: false
|
|
320
|
+
},
|
|
321
|
+
uniffi_dbx_tools_model_checksum_func_reasoning_effort_names_by_family: {
|
|
322
|
+
args: [],
|
|
323
|
+
ret: FfiType.UInt16,
|
|
324
|
+
hasRustCallStatus: false
|
|
325
|
+
},
|
|
296
326
|
uniffi_dbx_tools_model_checksum_func_reasoning_efforts_by_family: {
|
|
297
327
|
args: [],
|
|
298
328
|
ret: FfiType.UInt16,
|
|
@@ -344,10 +374,14 @@ import {
|
|
|
344
374
|
AbstractFfiConverterByteArray,
|
|
345
375
|
FfiConverterArray,
|
|
346
376
|
FfiConverterBool,
|
|
377
|
+
FfiConverterFloat64,
|
|
378
|
+
FfiConverterMap,
|
|
347
379
|
FfiConverterOptional,
|
|
380
|
+
FfiConverterUInt32,
|
|
348
381
|
UniffiInternalError,
|
|
349
382
|
UniffiRustCaller,
|
|
350
|
-
uniffiCreateFfiConverterString
|
|
383
|
+
uniffiCreateFfiConverterString,
|
|
384
|
+
uniffiCreateRecord
|
|
351
385
|
} from "@ubjs/core";
|
|
352
386
|
var uniffiCaller = new UniffiRustCaller(() => ({ code: 0 }));
|
|
353
387
|
var uniffiIsDebug = typeof process !== "object" || process?.env?.NODE_ENV !== "production" || false;
|
|
@@ -366,6 +400,16 @@ function isResponsesOnly(value) {
|
|
|
366
400
|
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_is_responses_only(FfiConverterString.lower(value, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
367
401
|
}, FfiConverterString.lift.bind(FfiConverterString)));
|
|
368
402
|
}
|
|
403
|
+
function modelFamily(value) {
|
|
404
|
+
const __rb = uniffiCaller.rustCall((callStatus) => {
|
|
405
|
+
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_model_family(FfiConverterString.lower(value, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
406
|
+
}, FfiConverterString.lift.bind(FfiConverterString));
|
|
407
|
+
try {
|
|
408
|
+
return FfiConverterOptionalString.lift(__rb);
|
|
409
|
+
} finally {
|
|
410
|
+
_bindings_ffi_default().rustbuffer_free(__rb);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
369
413
|
function modelServingApi(value) {
|
|
370
414
|
const __rb = uniffiCaller.rustCall((callStatus) => {
|
|
371
415
|
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_model_serving_api(FfiConverterString.lower(value, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
@@ -376,6 +420,26 @@ function modelServingApi(value) {
|
|
|
376
420
|
_bindings_ffi_default().rustbuffer_free(__rb);
|
|
377
421
|
}
|
|
378
422
|
}
|
|
423
|
+
function rankModels(endpoints, query) {
|
|
424
|
+
const __rb = uniffiCaller.rustCall((callStatus) => {
|
|
425
|
+
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_rank_models(FfiConverterSequenceTypeServingEndpointSummary.lower(endpoints, _bindings_ffi_default().rustbuffer_alloc), FfiConverterTypeModelQuery.lower(query, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
426
|
+
}, FfiConverterString.lift.bind(FfiConverterString));
|
|
427
|
+
try {
|
|
428
|
+
return FfiConverterSequenceTypeRankedModel.lift(__rb);
|
|
429
|
+
} finally {
|
|
430
|
+
_bindings_ffi_default().rustbuffer_free(__rb);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
function reasoningEffortNamesByFamily(name) {
|
|
434
|
+
const __rb = uniffiCaller.rustCall((callStatus) => {
|
|
435
|
+
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_reasoning_effort_names_by_family(FfiConverterString.lower(name, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
436
|
+
}, FfiConverterString.lift.bind(FfiConverterString));
|
|
437
|
+
try {
|
|
438
|
+
return FfiConverterSequenceString.lift(__rb);
|
|
439
|
+
} finally {
|
|
440
|
+
_bindings_ffi_default().rustbuffer_free(__rb);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
379
443
|
function reasoningEffortsByFamily(name) {
|
|
380
444
|
const __rb = uniffiCaller.rustCall((callStatus) => {
|
|
381
445
|
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_reasoning_efforts_by_family(FfiConverterString.lower(name, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
@@ -391,30 +455,87 @@ function supportsToolsByFamily(name) {
|
|
|
391
455
|
return _bindings_ffi_default().uniffi_dbx_tools_model_fn_func_supports_tools_by_family(FfiConverterString.lower(name, _bindings_ffi_default().rustbuffer_alloc), callStatus);
|
|
392
456
|
}, FfiConverterString.lift.bind(FfiConverterString)));
|
|
393
457
|
}
|
|
394
|
-
var
|
|
395
|
-
(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
})(
|
|
399
|
-
|
|
458
|
+
var ModelProfile = (() => {
|
|
459
|
+
const defaults = () => ({});
|
|
460
|
+
const create = (() => {
|
|
461
|
+
return uniffiCreateRecord(defaults);
|
|
462
|
+
})();
|
|
463
|
+
return Object.freeze({
|
|
464
|
+
create,
|
|
465
|
+
new: create,
|
|
466
|
+
defaults: () => Object.freeze(defaults())
|
|
467
|
+
});
|
|
468
|
+
})();
|
|
469
|
+
var FfiConverterTypeModelProfile = (() => {
|
|
470
|
+
|
|
471
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
472
|
+
readFromCursor(c) {
|
|
473
|
+
return {
|
|
474
|
+
quality: FfiConverterOptionalFloat64.readFromCursor(c),
|
|
475
|
+
speed: FfiConverterOptionalFloat64.readFromCursor(c),
|
|
476
|
+
cost: FfiConverterOptionalFloat64.readFromCursor(c)
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
writeIntoCursor(value, c) {
|
|
480
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.quality, c);
|
|
481
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.speed, c);
|
|
482
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.cost, c);
|
|
483
|
+
}
|
|
484
|
+
allocationSize(value) {
|
|
485
|
+
return FfiConverterOptionalFloat64.allocationSize(value.quality) + FfiConverterOptionalFloat64.allocationSize(value.speed) + FfiConverterOptionalFloat64.allocationSize(value.cost);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return new FFIConverter;
|
|
489
|
+
})();
|
|
490
|
+
var stringConverter = (() => {
|
|
491
|
+
const encoder = new TextEncoder;
|
|
492
|
+
const decoder = new TextDecoder;
|
|
493
|
+
return {
|
|
494
|
+
stringToBytes: (s) => encoder.encode(s),
|
|
495
|
+
bytesToString: (ab) => decoder.decode(ab),
|
|
496
|
+
stringByteLength: (s) => encoder.encode(s).byteLength,
|
|
497
|
+
writeStringIntoBuffer: (s, buf, offset) => {
|
|
498
|
+
const view = new Uint8Array(buf.arrayBuffer, offset, buf.arrayBuffer.byteLength - offset);
|
|
499
|
+
return encoder.encodeInto(s, view).written;
|
|
500
|
+
},
|
|
501
|
+
readStringFromBuffer: (buf, offset, length) => decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length))
|
|
502
|
+
};
|
|
503
|
+
})();
|
|
504
|
+
var FfiConverterString = uniffiCreateFfiConverterString(stringConverter);
|
|
505
|
+
var ModelClass;
|
|
506
|
+
((ModelClass2) => {
|
|
507
|
+
ModelClass2[ModelClass2["ChatThinking"] = 0] = "ChatThinking";
|
|
508
|
+
ModelClass2[ModelClass2["ChatBalanced"] = 1] = "ChatBalanced";
|
|
509
|
+
ModelClass2[ModelClass2["ChatFast"] = 2] = "ChatFast";
|
|
510
|
+
ModelClass2[ModelClass2["Embedding"] = 3] = "Embedding";
|
|
511
|
+
})(ModelClass ||= {});
|
|
512
|
+
var FfiConverterTypeModelClass = (() => {
|
|
400
513
|
|
|
401
514
|
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
402
515
|
readFromCursor(c) {
|
|
403
516
|
switch (c.readI32()) {
|
|
404
517
|
case 1:
|
|
405
|
-
return 0 /*
|
|
518
|
+
return 0 /* ChatThinking */;
|
|
406
519
|
case 2:
|
|
407
|
-
return 1 /*
|
|
520
|
+
return 1 /* ChatBalanced */;
|
|
521
|
+
case 3:
|
|
522
|
+
return 2 /* ChatFast */;
|
|
523
|
+
case 4:
|
|
524
|
+
return 3 /* Embedding */;
|
|
408
525
|
default:
|
|
409
526
|
throw new UniffiInternalError.UnexpectedEnumCase;
|
|
410
527
|
}
|
|
411
528
|
}
|
|
412
529
|
writeIntoCursor(value, c) {
|
|
413
530
|
switch (value) {
|
|
414
|
-
case 0 /*
|
|
531
|
+
case 0 /* ChatThinking */:
|
|
415
532
|
return c.writeI32(1);
|
|
416
|
-
case 1 /*
|
|
533
|
+
case 1 /* ChatBalanced */:
|
|
417
534
|
return c.writeI32(2);
|
|
535
|
+
case 2 /* ChatFast */:
|
|
536
|
+
return c.writeI32(3);
|
|
537
|
+
case 3 /* Embedding */:
|
|
538
|
+
return c.writeI32(4);
|
|
418
539
|
}
|
|
419
540
|
}
|
|
420
541
|
allocationSize(value) {
|
|
@@ -423,6 +544,72 @@ var FfiConverterTypeModelServingApi = (() => {
|
|
|
423
544
|
}
|
|
424
545
|
return new FFIConverter;
|
|
425
546
|
})();
|
|
547
|
+
var ModelQuery = (() => {
|
|
548
|
+
const defaults = () => ({});
|
|
549
|
+
const create = (() => {
|
|
550
|
+
return uniffiCreateRecord(defaults);
|
|
551
|
+
})();
|
|
552
|
+
return Object.freeze({
|
|
553
|
+
create,
|
|
554
|
+
new: create,
|
|
555
|
+
defaults: () => Object.freeze(defaults())
|
|
556
|
+
});
|
|
557
|
+
})();
|
|
558
|
+
var FfiConverterTypeModelQuery = (() => {
|
|
559
|
+
|
|
560
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
561
|
+
readFromCursor(c) {
|
|
562
|
+
return {
|
|
563
|
+
search: FfiConverterOptionalString.readFromCursor(c),
|
|
564
|
+
modelClass: FfiConverterOptionalTypeModelClass.readFromCursor(c),
|
|
565
|
+
requiresTools: FfiConverterBool.readFromCursor(c),
|
|
566
|
+
includeDeprecated: FfiConverterBool.readFromCursor(c),
|
|
567
|
+
limit: FfiConverterOptionalUInt32.readFromCursor(c),
|
|
568
|
+
threshold: FfiConverterOptionalFloat64.readFromCursor(c)
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
writeIntoCursor(value, c) {
|
|
572
|
+
FfiConverterOptionalString.writeIntoCursor(value.search, c);
|
|
573
|
+
FfiConverterOptionalTypeModelClass.writeIntoCursor(value.modelClass, c);
|
|
574
|
+
FfiConverterBool.writeIntoCursor(value.requiresTools, c);
|
|
575
|
+
FfiConverterBool.writeIntoCursor(value.includeDeprecated, c);
|
|
576
|
+
FfiConverterOptionalUInt32.writeIntoCursor(value.limit, c);
|
|
577
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.threshold, c);
|
|
578
|
+
}
|
|
579
|
+
allocationSize(value) {
|
|
580
|
+
return FfiConverterOptionalString.allocationSize(value.search) + FfiConverterOptionalTypeModelClass.allocationSize(value.modelClass) + FfiConverterBool.allocationSize(value.requiresTools) + FfiConverterBool.allocationSize(value.includeDeprecated) + FfiConverterOptionalUInt32.allocationSize(value.limit) + FfiConverterOptionalFloat64.allocationSize(value.threshold);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return new FFIConverter;
|
|
584
|
+
})();
|
|
585
|
+
var ModelStatus = (() => {
|
|
586
|
+
const defaults = () => ({});
|
|
587
|
+
const create = (() => {
|
|
588
|
+
return uniffiCreateRecord(defaults);
|
|
589
|
+
})();
|
|
590
|
+
return Object.freeze({
|
|
591
|
+
create,
|
|
592
|
+
new: create,
|
|
593
|
+
defaults: () => Object.freeze(defaults())
|
|
594
|
+
});
|
|
595
|
+
})();
|
|
596
|
+
var FfiConverterTypeModelStatus = (() => {
|
|
597
|
+
|
|
598
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
599
|
+
readFromCursor(c) {
|
|
600
|
+
return {
|
|
601
|
+
deprecated: FfiConverterBool.readFromCursor(c)
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
writeIntoCursor(value, c) {
|
|
605
|
+
FfiConverterBool.writeIntoCursor(value.deprecated, c);
|
|
606
|
+
}
|
|
607
|
+
allocationSize(value) {
|
|
608
|
+
return FfiConverterBool.allocationSize(value.deprecated);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
return new FFIConverter;
|
|
612
|
+
})();
|
|
426
613
|
var ReasoningEffort;
|
|
427
614
|
((ReasoningEffort2) => {
|
|
428
615
|
ReasoningEffort2[ReasoningEffort2["None"] = 0] = "None";
|
|
@@ -480,23 +667,164 @@ var FfiConverterTypeReasoningEffort = (() => {
|
|
|
480
667
|
}
|
|
481
668
|
return new FFIConverter;
|
|
482
669
|
})();
|
|
483
|
-
var
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
},
|
|
494
|
-
readStringFromBuffer: (buf, offset, length) => decoder.decode(new Uint8Array(buf.arrayBuffer, offset, length))
|
|
495
|
-
};
|
|
670
|
+
var ServingEndpointSummary = (() => {
|
|
671
|
+
const defaults = () => ({});
|
|
672
|
+
const create = (() => {
|
|
673
|
+
return uniffiCreateRecord(defaults);
|
|
674
|
+
})();
|
|
675
|
+
return Object.freeze({
|
|
676
|
+
create,
|
|
677
|
+
new: create,
|
|
678
|
+
defaults: () => Object.freeze(defaults())
|
|
679
|
+
});
|
|
496
680
|
})();
|
|
497
|
-
var
|
|
498
|
-
|
|
681
|
+
var FfiConverterTypeServingEndpointSummary = (() => {
|
|
682
|
+
|
|
683
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
684
|
+
readFromCursor(c) {
|
|
685
|
+
return {
|
|
686
|
+
name: FfiConverterString.readFromCursor(c),
|
|
687
|
+
displayName: FfiConverterOptionalString.readFromCursor(c),
|
|
688
|
+
task: FfiConverterOptionalString.readFromCursor(c),
|
|
689
|
+
state: FfiConverterOptionalString.readFromCursor(c),
|
|
690
|
+
description: FfiConverterOptionalString.readFromCursor(c),
|
|
691
|
+
supportsTools: FfiConverterOptionalBoolean.readFromCursor(c),
|
|
692
|
+
profile: FfiConverterOptionalTypeModelProfile.readFromCursor(c),
|
|
693
|
+
modelClass: FfiConverterOptionalTypeModelClass.readFromCursor(c),
|
|
694
|
+
serviceNames: FfiConverterMapStringString.readFromCursor(c),
|
|
695
|
+
modelServiceName: FfiConverterOptionalString.readFromCursor(c),
|
|
696
|
+
reasoningEfforts: FfiConverterSequenceTypeReasoningEffort.readFromCursor(c),
|
|
697
|
+
status: FfiConverterTypeModelStatus.readFromCursor(c)
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
writeIntoCursor(value, c) {
|
|
701
|
+
FfiConverterString.writeIntoCursor(value.name, c);
|
|
702
|
+
FfiConverterOptionalString.writeIntoCursor(value.displayName, c);
|
|
703
|
+
FfiConverterOptionalString.writeIntoCursor(value.task, c);
|
|
704
|
+
FfiConverterOptionalString.writeIntoCursor(value.state, c);
|
|
705
|
+
FfiConverterOptionalString.writeIntoCursor(value.description, c);
|
|
706
|
+
FfiConverterOptionalBoolean.writeIntoCursor(value.supportsTools, c);
|
|
707
|
+
FfiConverterOptionalTypeModelProfile.writeIntoCursor(value.profile, c);
|
|
708
|
+
FfiConverterOptionalTypeModelClass.writeIntoCursor(value.modelClass, c);
|
|
709
|
+
FfiConverterMapStringString.writeIntoCursor(value.serviceNames, c);
|
|
710
|
+
FfiConverterOptionalString.writeIntoCursor(value.modelServiceName, c);
|
|
711
|
+
FfiConverterSequenceTypeReasoningEffort.writeIntoCursor(value.reasoningEfforts, c);
|
|
712
|
+
FfiConverterTypeModelStatus.writeIntoCursor(value.status, c);
|
|
713
|
+
}
|
|
714
|
+
allocationSize(value) {
|
|
715
|
+
return FfiConverterString.allocationSize(value.name) + FfiConverterOptionalString.allocationSize(value.displayName) + FfiConverterOptionalString.allocationSize(value.task) + FfiConverterOptionalString.allocationSize(value.state) + FfiConverterOptionalString.allocationSize(value.description) + FfiConverterOptionalBoolean.allocationSize(value.supportsTools) + FfiConverterOptionalTypeModelProfile.allocationSize(value.profile) + FfiConverterOptionalTypeModelClass.allocationSize(value.modelClass) + FfiConverterMapStringString.allocationSize(value.serviceNames) + FfiConverterOptionalString.allocationSize(value.modelServiceName) + FfiConverterSequenceTypeReasoningEffort.allocationSize(value.reasoningEfforts) + FfiConverterTypeModelStatus.allocationSize(value.status);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
return new FFIConverter;
|
|
719
|
+
})();
|
|
720
|
+
var RankedModel = (() => {
|
|
721
|
+
const defaults = () => ({});
|
|
722
|
+
const create = (() => {
|
|
723
|
+
return uniffiCreateRecord(defaults);
|
|
724
|
+
})();
|
|
725
|
+
return Object.freeze({
|
|
726
|
+
create,
|
|
727
|
+
new: create,
|
|
728
|
+
defaults: () => Object.freeze(defaults())
|
|
729
|
+
});
|
|
730
|
+
})();
|
|
731
|
+
var FfiConverterTypeRankedModel = (() => {
|
|
732
|
+
|
|
733
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
734
|
+
readFromCursor(c) {
|
|
735
|
+
return {
|
|
736
|
+
endpoint: FfiConverterTypeServingEndpointSummary.readFromCursor(c),
|
|
737
|
+
modelClass: FfiConverterTypeModelClass.readFromCursor(c),
|
|
738
|
+
score: FfiConverterOptionalFloat64.readFromCursor(c)
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
writeIntoCursor(value, c) {
|
|
742
|
+
FfiConverterTypeServingEndpointSummary.writeIntoCursor(value.endpoint, c);
|
|
743
|
+
FfiConverterTypeModelClass.writeIntoCursor(value.modelClass, c);
|
|
744
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.score, c);
|
|
745
|
+
}
|
|
746
|
+
allocationSize(value) {
|
|
747
|
+
return FfiConverterTypeServingEndpointSummary.allocationSize(value.endpoint) + FfiConverterTypeModelClass.allocationSize(value.modelClass) + FfiConverterOptionalFloat64.allocationSize(value.score);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
return new FFIConverter;
|
|
751
|
+
})();
|
|
752
|
+
var ResolvedModel = (() => {
|
|
753
|
+
const defaults = () => ({});
|
|
754
|
+
const create = (() => {
|
|
755
|
+
return uniffiCreateRecord(defaults);
|
|
756
|
+
})();
|
|
757
|
+
return Object.freeze({
|
|
758
|
+
create,
|
|
759
|
+
new: create,
|
|
760
|
+
defaults: () => Object.freeze(defaults())
|
|
761
|
+
});
|
|
762
|
+
})();
|
|
763
|
+
var FfiConverterTypeResolvedModel = (() => {
|
|
764
|
+
|
|
765
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
766
|
+
readFromCursor(c) {
|
|
767
|
+
return {
|
|
768
|
+
modelId: FfiConverterString.readFromCursor(c),
|
|
769
|
+
matched: FfiConverterBool.readFromCursor(c),
|
|
770
|
+
score: FfiConverterOptionalFloat64.readFromCursor(c)
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
writeIntoCursor(value, c) {
|
|
774
|
+
FfiConverterString.writeIntoCursor(value.modelId, c);
|
|
775
|
+
FfiConverterBool.writeIntoCursor(value.matched, c);
|
|
776
|
+
FfiConverterOptionalFloat64.writeIntoCursor(value.score, c);
|
|
777
|
+
}
|
|
778
|
+
allocationSize(value) {
|
|
779
|
+
return FfiConverterString.allocationSize(value.modelId) + FfiConverterBool.allocationSize(value.matched) + FfiConverterOptionalFloat64.allocationSize(value.score);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
return new FFIConverter;
|
|
783
|
+
})();
|
|
784
|
+
var ModelServingApi;
|
|
785
|
+
((ModelServingApi2) => {
|
|
786
|
+
ModelServingApi2[ModelServingApi2["Chat"] = 0] = "Chat";
|
|
787
|
+
ModelServingApi2[ModelServingApi2["Responses"] = 1] = "Responses";
|
|
788
|
+
})(ModelServingApi ||= {});
|
|
789
|
+
var FfiConverterTypeModelServingApi = (() => {
|
|
790
|
+
|
|
791
|
+
class FFIConverter extends AbstractFfiConverterByteArray {
|
|
792
|
+
readFromCursor(c) {
|
|
793
|
+
switch (c.readI32()) {
|
|
794
|
+
case 1:
|
|
795
|
+
return 0 /* Chat */;
|
|
796
|
+
case 2:
|
|
797
|
+
return 1 /* Responses */;
|
|
798
|
+
default:
|
|
799
|
+
throw new UniffiInternalError.UnexpectedEnumCase;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
writeIntoCursor(value, c) {
|
|
803
|
+
switch (value) {
|
|
804
|
+
case 0 /* Chat */:
|
|
805
|
+
return c.writeI32(1);
|
|
806
|
+
case 1 /* Responses */:
|
|
807
|
+
return c.writeI32(2);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
allocationSize(value) {
|
|
811
|
+
return 4;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return new FFIConverter;
|
|
815
|
+
})();
|
|
816
|
+
var FfiConverterOptionalFloat64 = new FfiConverterOptional(FfiConverterFloat64);
|
|
817
|
+
var FfiConverterOptionalString = new FfiConverterOptional(FfiConverterString);
|
|
818
|
+
var FfiConverterOptionalTypeModelClass = new FfiConverterOptional(FfiConverterTypeModelClass);
|
|
819
|
+
var FfiConverterOptionalUInt32 = new FfiConverterOptional(FfiConverterUInt32);
|
|
820
|
+
var FfiConverterOptionalBoolean = new FfiConverterOptional(FfiConverterBool);
|
|
821
|
+
var FfiConverterOptionalTypeModelProfile = new FfiConverterOptional(FfiConverterTypeModelProfile);
|
|
822
|
+
var FfiConverterMapStringString = new FfiConverterMap(FfiConverterString, FfiConverterString);
|
|
499
823
|
var FfiConverterSequenceTypeReasoningEffort = new FfiConverterArray(FfiConverterTypeReasoningEffort);
|
|
824
|
+
var FfiConverterOptionalTypeReasoningEffort = new FfiConverterOptional(FfiConverterTypeReasoningEffort);
|
|
825
|
+
var FfiConverterSequenceTypeServingEndpointSummary = new FfiConverterArray(FfiConverterTypeServingEndpointSummary);
|
|
826
|
+
var FfiConverterSequenceTypeRankedModel = new FfiConverterArray(FfiConverterTypeRankedModel);
|
|
827
|
+
var FfiConverterSequenceString = new FfiConverterArray(FfiConverterString);
|
|
500
828
|
function uniffiEnsureInitialized() {
|
|
501
829
|
const bindingsContractVersion = 30;
|
|
502
830
|
const scaffoldingContractVersion = _bindings_ffi_default().ffi_dbx_tools_model_uniffi_contract_version();
|
|
@@ -509,9 +837,18 @@ function uniffiEnsureInitialized() {
|
|
|
509
837
|
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_is_responses_only() !== 5794) {
|
|
510
838
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_is_responses_only");
|
|
511
839
|
}
|
|
840
|
+
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_model_family() !== 2675) {
|
|
841
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_model_family");
|
|
842
|
+
}
|
|
512
843
|
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_model_serving_api() !== 54338) {
|
|
513
844
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_model_serving_api");
|
|
514
845
|
}
|
|
846
|
+
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_rank_models() !== 57675) {
|
|
847
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_rank_models");
|
|
848
|
+
}
|
|
849
|
+
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_reasoning_effort_names_by_family() !== 48201) {
|
|
850
|
+
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_reasoning_effort_names_by_family");
|
|
851
|
+
}
|
|
515
852
|
if (_bindings_ffi_default().uniffi_dbx_tools_model_checksum_func_reasoning_efforts_by_family() !== 49390) {
|
|
516
853
|
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_dbx_tools_model_checksum_func_reasoning_efforts_by_family");
|
|
517
854
|
}
|
|
@@ -522,8 +859,15 @@ function uniffiEnsureInitialized() {
|
|
|
522
859
|
var _bindings_default = Object.freeze({
|
|
523
860
|
initialize: uniffiEnsureInitialized,
|
|
524
861
|
converters: {
|
|
862
|
+
FfiConverterTypeModelClass,
|
|
863
|
+
FfiConverterTypeModelProfile,
|
|
864
|
+
FfiConverterTypeModelQuery,
|
|
525
865
|
FfiConverterTypeModelServingApi,
|
|
526
|
-
|
|
866
|
+
FfiConverterTypeModelStatus,
|
|
867
|
+
FfiConverterTypeRankedModel,
|
|
868
|
+
FfiConverterTypeReasoningEffort,
|
|
869
|
+
FfiConverterTypeResolvedModel,
|
|
870
|
+
FfiConverterTypeServingEndpointSummary
|
|
527
871
|
}
|
|
528
872
|
});
|
|
529
873
|
// src/bindings.ts
|
|
@@ -532,17 +876,27 @@ async function uniffiInitAsync() {}
|
|
|
532
876
|
|
|
533
877
|
// index.ts
|
|
534
878
|
var PACKAGE_IDENTIFIER = "@dbx-tools/model-rs";
|
|
535
|
-
var PACKAGE_VERSION = "0.6.
|
|
879
|
+
var PACKAGE_VERSION = "0.6.226";
|
|
536
880
|
export {
|
|
537
881
|
_bindings_default as uniffiModule,
|
|
538
882
|
uniffiInitAsync,
|
|
539
883
|
supportsToolsByFamily,
|
|
540
884
|
reasoningEffortsByFamily,
|
|
885
|
+
reasoningEffortNamesByFamily,
|
|
886
|
+
rankModels,
|
|
541
887
|
modelServingApi,
|
|
888
|
+
modelFamily,
|
|
542
889
|
isResponsesOnly,
|
|
543
890
|
chatToolReasoningEffort,
|
|
891
|
+
ServingEndpointSummary,
|
|
892
|
+
ResolvedModel,
|
|
544
893
|
ReasoningEffort,
|
|
894
|
+
RankedModel,
|
|
545
895
|
PACKAGE_VERSION,
|
|
546
896
|
PACKAGE_IDENTIFIER,
|
|
547
|
-
|
|
897
|
+
ModelStatus,
|
|
898
|
+
ModelServingApi,
|
|
899
|
+
ModelQuery,
|
|
900
|
+
ModelProfile,
|
|
901
|
+
ModelClass
|
|
548
902
|
};
|
package/package.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"directory": "packages/js/node/model-rs"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dbx-tools/core-rs": "0.6.
|
|
10
|
+
"@dbx-tools/core-rs": "0.6.226",
|
|
11
11
|
"@ubjs/core": "0.31.0-5",
|
|
12
12
|
"@ubjs/node": "0.31.0-5"
|
|
13
13
|
},
|
|
14
14
|
"main": "./lib/index.js",
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
|
-
"version": "0.6.
|
|
16
|
+
"version": "0.6.226",
|
|
17
17
|
"types": "./index.ts",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"exports": {
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"lib"
|
|
30
30
|
],
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"@dbx-tools/model-rs-linux-x64-gnu": "0.6.
|
|
33
|
-
"@dbx-tools/model-rs-linux-arm64-gnu": "0.6.
|
|
34
|
-
"@dbx-tools/model-rs-darwin-x64": "0.6.
|
|
35
|
-
"@dbx-tools/model-rs-darwin-arm64": "0.6.
|
|
36
|
-
"@dbx-tools/model-rs-win32-x64-msvc": "0.6.
|
|
37
|
-
"@dbx-tools/model-rs-win32-arm64-msvc": "0.6.
|
|
32
|
+
"@dbx-tools/model-rs-linux-x64-gnu": "0.6.226",
|
|
33
|
+
"@dbx-tools/model-rs-linux-arm64-gnu": "0.6.226",
|
|
34
|
+
"@dbx-tools/model-rs-darwin-x64": "0.6.226",
|
|
35
|
+
"@dbx-tools/model-rs-darwin-arm64": "0.6.226",
|
|
36
|
+
"@dbx-tools/model-rs-win32-x64-msvc": "0.6.226",
|
|
37
|
+
"@dbx-tools/model-rs-win32-arm64-msvc": "0.6.226"
|
|
38
38
|
},
|
|
39
39
|
"dbxToolsConfig": {
|
|
40
40
|
"uniffi": true,
|
package/src/_bindings-ffi.ts
CHANGED
|
@@ -275,11 +275,26 @@ const DEFINITIONS = {
|
|
|
275
275
|
ret: FfiType.Int8,
|
|
276
276
|
hasRustCallStatus: true,
|
|
277
277
|
},
|
|
278
|
+
"uniffi_dbx_tools_model_fn_func_model_family": {
|
|
279
|
+
args: [FfiType.RustBuffer],
|
|
280
|
+
ret: FfiType.RustBuffer,
|
|
281
|
+
hasRustCallStatus: true,
|
|
282
|
+
},
|
|
278
283
|
"uniffi_dbx_tools_model_fn_func_model_serving_api": {
|
|
279
284
|
args: [FfiType.RustBuffer],
|
|
280
285
|
ret: FfiType.RustBuffer,
|
|
281
286
|
hasRustCallStatus: true,
|
|
282
287
|
},
|
|
288
|
+
"uniffi_dbx_tools_model_fn_func_rank_models": {
|
|
289
|
+
args: [FfiType.RustBuffer, FfiType.RustBuffer],
|
|
290
|
+
ret: FfiType.RustBuffer,
|
|
291
|
+
hasRustCallStatus: true,
|
|
292
|
+
},
|
|
293
|
+
"uniffi_dbx_tools_model_fn_func_reasoning_effort_names_by_family": {
|
|
294
|
+
args: [FfiType.RustBuffer],
|
|
295
|
+
ret: FfiType.RustBuffer,
|
|
296
|
+
hasRustCallStatus: true,
|
|
297
|
+
},
|
|
283
298
|
"uniffi_dbx_tools_model_fn_func_reasoning_efforts_by_family": {
|
|
284
299
|
args: [FfiType.RustBuffer],
|
|
285
300
|
ret: FfiType.RustBuffer,
|
|
@@ -305,11 +320,26 @@ const DEFINITIONS = {
|
|
|
305
320
|
ret: FfiType.UInt16,
|
|
306
321
|
hasRustCallStatus: false,
|
|
307
322
|
},
|
|
323
|
+
"uniffi_dbx_tools_model_checksum_func_model_family": {
|
|
324
|
+
args: [],
|
|
325
|
+
ret: FfiType.UInt16,
|
|
326
|
+
hasRustCallStatus: false,
|
|
327
|
+
},
|
|
308
328
|
"uniffi_dbx_tools_model_checksum_func_model_serving_api": {
|
|
309
329
|
args: [],
|
|
310
330
|
ret: FfiType.UInt16,
|
|
311
331
|
hasRustCallStatus: false,
|
|
312
332
|
},
|
|
333
|
+
"uniffi_dbx_tools_model_checksum_func_rank_models": {
|
|
334
|
+
args: [],
|
|
335
|
+
ret: FfiType.UInt16,
|
|
336
|
+
hasRustCallStatus: false,
|
|
337
|
+
},
|
|
338
|
+
"uniffi_dbx_tools_model_checksum_func_reasoning_effort_names_by_family": {
|
|
339
|
+
args: [],
|
|
340
|
+
ret: FfiType.UInt16,
|
|
341
|
+
hasRustCallStatus: false,
|
|
342
|
+
},
|
|
313
343
|
"uniffi_dbx_tools_model_checksum_func_reasoning_efforts_by_family": {
|
|
314
344
|
args: [],
|
|
315
345
|
ret: FfiType.UInt16,
|
|
@@ -392,13 +422,19 @@ interface NativeModuleInterface {
|
|
|
392
422
|
ffi_dbx_tools_model_rust_future_free_void(handle: bigint): void;
|
|
393
423
|
uniffi_dbx_tools_model_fn_func_chat_tool_reasoning_effort(name: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
394
424
|
uniffi_dbx_tools_model_fn_func_is_responses_only(value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): number;
|
|
425
|
+
uniffi_dbx_tools_model_fn_func_model_family(value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
395
426
|
uniffi_dbx_tools_model_fn_func_model_serving_api(value: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
427
|
+
uniffi_dbx_tools_model_fn_func_rank_models(endpoints: Uint8Array, query: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
428
|
+
uniffi_dbx_tools_model_fn_func_reasoning_effort_names_by_family(name: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
396
429
|
uniffi_dbx_tools_model_fn_func_reasoning_efforts_by_family(name: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
|
|
397
430
|
uniffi_dbx_tools_model_fn_func_supports_tools_by_family(name: Uint8Array, uniffi_out_err: UniffiRustCallStatus): number;
|
|
398
431
|
ffi_dbx_tools_model_uniffi_contract_version(): number;
|
|
399
432
|
uniffi_dbx_tools_model_checksum_func_chat_tool_reasoning_effort(): number;
|
|
400
433
|
uniffi_dbx_tools_model_checksum_func_is_responses_only(): number;
|
|
434
|
+
uniffi_dbx_tools_model_checksum_func_model_family(): number;
|
|
401
435
|
uniffi_dbx_tools_model_checksum_func_model_serving_api(): number;
|
|
436
|
+
uniffi_dbx_tools_model_checksum_func_rank_models(): number;
|
|
437
|
+
uniffi_dbx_tools_model_checksum_func_reasoning_effort_names_by_family(): number;
|
|
402
438
|
uniffi_dbx_tools_model_checksum_func_reasoning_efforts_by_family(): number;
|
|
403
439
|
uniffi_dbx_tools_model_checksum_func_supports_tools_by_family(): number;
|
|
404
440
|
// Codegen call sites use these via `nativeModule().rustbuffer_alloc(...)`
|