blazen 0.1.129 → 0.1.131
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/index.d.ts +419 -0
- package/index.js +72 -52
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
/* auto-generated by NAPI-RS */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* r" Base class for background removal providers.
|
|
5
|
+
* r"
|
|
6
|
+
* r" Subclass and override `removeBackground()` to implement a custom
|
|
7
|
+
* r" background-removal backend.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BackgroundRemovalProvider {
|
|
10
|
+
constructor(config: CapabilityProviderConfig)
|
|
11
|
+
/** The provider identifier. */
|
|
12
|
+
get providerId(): string | null
|
|
13
|
+
/** The base URL, if set. */
|
|
14
|
+
get baseUrl(): string | null
|
|
15
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
16
|
+
get vramEstimateBytes(): number | null
|
|
17
|
+
/** r" Remove the background from an image. */
|
|
18
|
+
removeBackground(request: any): Promise<any>
|
|
19
|
+
}
|
|
20
|
+
export type JsBackgroundRemovalProvider = BackgroundRemovalProvider
|
|
21
|
+
|
|
3
22
|
/** A single message in a chat conversation. */
|
|
4
23
|
export declare class ChatMessage {
|
|
5
24
|
/**
|
|
@@ -106,8 +125,30 @@ export type JsChatWindow = ChatWindow
|
|
|
106
125
|
* ChatMessage.user("What is 2 + 2?")
|
|
107
126
|
* ]);
|
|
108
127
|
* ```
|
|
128
|
+
*
|
|
129
|
+
* Or extend the class to implement a custom provider:
|
|
130
|
+
*
|
|
131
|
+
* ```javascript
|
|
132
|
+
* class MyLLM extends CompletionModel {
|
|
133
|
+
* constructor() {
|
|
134
|
+
* super({ modelId: "my-custom-model" });
|
|
135
|
+
* }
|
|
136
|
+
* async complete(messages) { /* ... *\/ }
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
109
139
|
*/
|
|
110
140
|
export declare class CompletionModel {
|
|
141
|
+
/**
|
|
142
|
+
* Construct a base `CompletionModel`.
|
|
143
|
+
*
|
|
144
|
+
* Called by JavaScript subclasses via `super(config)`. The `config`
|
|
145
|
+
* parameter is optional and carries metadata such as `modelId`.
|
|
146
|
+
*
|
|
147
|
+
* Instances created this way have no inner Rust provider -- calling
|
|
148
|
+
* `complete()` or `stream()` without overriding them in the subclass
|
|
149
|
+
* will throw.
|
|
150
|
+
*/
|
|
151
|
+
constructor(config?: CompletionModelConfig | undefined | null)
|
|
111
152
|
/** Create an `OpenAI` completion model. */
|
|
112
153
|
static openai(options?: JsProviderOptions | undefined | null): CompletionModel
|
|
113
154
|
/** Create an Anthropic completion model. */
|
|
@@ -528,8 +569,30 @@ export type JsCustomProvider = CustomProvider
|
|
|
528
569
|
* const response = await model.embed(["Hello", "World"]);
|
|
529
570
|
* console.log(response.embeddings); // [[0.1, ...], [0.3, ...]]
|
|
530
571
|
* ```
|
|
572
|
+
*
|
|
573
|
+
* Or extend the class to implement a custom provider:
|
|
574
|
+
*
|
|
575
|
+
* ```javascript
|
|
576
|
+
* class MyEmbedder extends EmbeddingModel {
|
|
577
|
+
* constructor() {
|
|
578
|
+
* super({ modelId: "my-custom-embedder", dimensions: 768 });
|
|
579
|
+
* }
|
|
580
|
+
* async embed(texts) { /* ... *\/ }
|
|
581
|
+
* }
|
|
582
|
+
* ```
|
|
531
583
|
*/
|
|
532
584
|
export declare class EmbeddingModel {
|
|
585
|
+
/**
|
|
586
|
+
* Construct a base `EmbeddingModel`.
|
|
587
|
+
*
|
|
588
|
+
* Called by JavaScript subclasses via `super(config)`. The `config`
|
|
589
|
+
* parameter is optional and carries metadata such as `modelId` and
|
|
590
|
+
* `dimensions`.
|
|
591
|
+
*
|
|
592
|
+
* Instances created this way have no inner Rust provider -- calling
|
|
593
|
+
* `embed()` without overriding it in the subclass will throw.
|
|
594
|
+
*/
|
|
595
|
+
constructor(config?: EmbeddingModelConfig | undefined | null)
|
|
533
596
|
/**
|
|
534
597
|
* Create an `OpenAI` embedding model.
|
|
535
598
|
*
|
|
@@ -656,6 +719,27 @@ export declare class FalProvider {
|
|
|
656
719
|
}
|
|
657
720
|
export type JsFalProvider = FalProvider
|
|
658
721
|
|
|
722
|
+
/**
|
|
723
|
+
* r" Base class for image generation providers.
|
|
724
|
+
* r"
|
|
725
|
+
* r" Subclass and override `generateImage()` and `upscaleImage()` to
|
|
726
|
+
* r" implement a custom image backend.
|
|
727
|
+
*/
|
|
728
|
+
export declare class ImageProvider {
|
|
729
|
+
constructor(config: CapabilityProviderConfig)
|
|
730
|
+
/** The provider identifier. */
|
|
731
|
+
get providerId(): string | null
|
|
732
|
+
/** The base URL, if set. */
|
|
733
|
+
get baseUrl(): string | null
|
|
734
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
735
|
+
get vramEstimateBytes(): number | null
|
|
736
|
+
/** r" Generate an image from a prompt. */
|
|
737
|
+
generateImage(request: any): Promise<any>
|
|
738
|
+
/** r" Upscale an existing image. */
|
|
739
|
+
upscaleImage(request: any): Promise<any>
|
|
740
|
+
}
|
|
741
|
+
export type JsImageProvider = ImageProvider
|
|
742
|
+
|
|
659
743
|
/**
|
|
660
744
|
* An in-memory backend for the memory store.
|
|
661
745
|
*
|
|
@@ -792,6 +876,127 @@ export declare class Memory {
|
|
|
792
876
|
}
|
|
793
877
|
export type JsMemory = Memory
|
|
794
878
|
|
|
879
|
+
/**
|
|
880
|
+
* Base class for custom memory storage backends.
|
|
881
|
+
*
|
|
882
|
+
* Extend and override all methods to implement a custom backend
|
|
883
|
+
* (e.g. `PostgreSQL`, `DynamoDB`, `SQLite`).
|
|
884
|
+
*
|
|
885
|
+
* ```javascript
|
|
886
|
+
* class PostgresBackend extends MemoryBackend {
|
|
887
|
+
* async put(entry) { /* ... *\/ }
|
|
888
|
+
* async get(id) { /* ... *\/ }
|
|
889
|
+
* async delete(id) { /* ... *\/ }
|
|
890
|
+
* async list() { /* ... *\/ }
|
|
891
|
+
* async len() { /* ... *\/ }
|
|
892
|
+
* async searchByBands(bands, limit) { /* ... *\/ }
|
|
893
|
+
* }
|
|
894
|
+
* ```
|
|
895
|
+
*/
|
|
896
|
+
export declare class MemoryBackend {
|
|
897
|
+
/** Create a new memory backend base instance. */
|
|
898
|
+
constructor()
|
|
899
|
+
/** Store an entry. Subclasses **must** override this method. */
|
|
900
|
+
put(entry: any): Promise<void>
|
|
901
|
+
/** Retrieve an entry by ID. Subclasses **must** override this method. */
|
|
902
|
+
get(id: string): Promise<any | null>
|
|
903
|
+
/** Delete an entry by ID. Subclasses **must** override this method. */
|
|
904
|
+
delete(id: string): Promise<boolean>
|
|
905
|
+
/** List all stored entries. Subclasses **must** override this method. */
|
|
906
|
+
list(): Promise<Array<any>>
|
|
907
|
+
/** Return the number of stored entries. Subclasses **must** override this method. */
|
|
908
|
+
len(): Promise<number>
|
|
909
|
+
/**
|
|
910
|
+
* Search for entries whose LSH bands overlap with the given bands.
|
|
911
|
+
* Subclasses **must** override this method.
|
|
912
|
+
*/
|
|
913
|
+
searchByBands(bands: Array<string>, limit: number): Promise<Array<any>>
|
|
914
|
+
}
|
|
915
|
+
export type JsMemoryBackend = MemoryBackend
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* VRAM budget-aware model manager with LRU eviction.
|
|
919
|
+
*
|
|
920
|
+
* Tracks registered local models and their estimated VRAM footprint.
|
|
921
|
+
* When loading a model that would exceed the budget, the least-recently-used
|
|
922
|
+
* loaded model is unloaded first.
|
|
923
|
+
*
|
|
924
|
+
* ```javascript
|
|
925
|
+
* const manager = new ModelManager({ budgetGb: 8.0 });
|
|
926
|
+
* await manager.register("llama-7b", model, 4_000_000_000);
|
|
927
|
+
* await manager.load("llama-7b");
|
|
928
|
+
* ```
|
|
929
|
+
*/
|
|
930
|
+
export declare class ModelManager {
|
|
931
|
+
/**
|
|
932
|
+
* Create a new model manager with the given VRAM budget.
|
|
933
|
+
*
|
|
934
|
+
* Provide either `budgetGb` (gigabytes as a float) or `budgetBytes`
|
|
935
|
+
* (exact byte count). If both are given, `budgetGb` takes precedence.
|
|
936
|
+
*/
|
|
937
|
+
constructor(config: ModelManagerConfig)
|
|
938
|
+
/**
|
|
939
|
+
* Register a model with the manager.
|
|
940
|
+
*
|
|
941
|
+
* The model starts in the unloaded state. An optional
|
|
942
|
+
* `vramEstimateBytes` overrides the model's self-reported estimate.
|
|
943
|
+
*
|
|
944
|
+
* Only local in-process providers (mistral.rs, llama.cpp, candle) can be
|
|
945
|
+
* registered -- remote HTTP providers will throw.
|
|
946
|
+
*/
|
|
947
|
+
register(id: string, model: JsCompletionModel, vramEstimateBytes?: number | undefined | null): Promise<void>
|
|
948
|
+
/**
|
|
949
|
+
* Load a model, evicting LRU models if the budget would be exceeded.
|
|
950
|
+
*
|
|
951
|
+
* Throws if the model is not registered or its VRAM estimate exceeds the
|
|
952
|
+
* total budget.
|
|
953
|
+
*/
|
|
954
|
+
load(id: string): Promise<void>
|
|
955
|
+
/**
|
|
956
|
+
* Unload a model, freeing its VRAM budget.
|
|
957
|
+
*
|
|
958
|
+
* Idempotent: unloading an already-unloaded model is a no-op.
|
|
959
|
+
*/
|
|
960
|
+
unload(id: string): Promise<void>
|
|
961
|
+
/** Check whether a model is currently loaded. */
|
|
962
|
+
isLoaded(id: string): Promise<boolean>
|
|
963
|
+
/**
|
|
964
|
+
* Ensure a model is loaded.
|
|
965
|
+
*
|
|
966
|
+
* If already loaded, updates the LRU timestamp. If not loaded, loads it
|
|
967
|
+
* (potentially evicting other models).
|
|
968
|
+
*/
|
|
969
|
+
ensureLoaded(id: string): Promise<void>
|
|
970
|
+
/** Total VRAM currently used by loaded models (in bytes). */
|
|
971
|
+
usedBytes(): Promise<number>
|
|
972
|
+
/** Available VRAM within the budget (in bytes). */
|
|
973
|
+
availableBytes(): Promise<number>
|
|
974
|
+
/** Status of all registered models. */
|
|
975
|
+
status(): Promise<Array<JsModelStatus>>
|
|
976
|
+
}
|
|
977
|
+
export type JsModelManager = ModelManager
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* r" Base class for music generation providers.
|
|
981
|
+
* r"
|
|
982
|
+
* r" Subclass and override `generateMusic()` and `generateSfx()` to
|
|
983
|
+
* r" implement a custom music/SFX backend.
|
|
984
|
+
*/
|
|
985
|
+
export declare class MusicProvider {
|
|
986
|
+
constructor(config: CapabilityProviderConfig)
|
|
987
|
+
/** The provider identifier. */
|
|
988
|
+
get providerId(): string | null
|
|
989
|
+
/** The base URL, if set. */
|
|
990
|
+
get baseUrl(): string | null
|
|
991
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
992
|
+
get vramEstimateBytes(): number | null
|
|
993
|
+
/** r" Generate music from a prompt. */
|
|
994
|
+
generateMusic(request: any): Promise<any>
|
|
995
|
+
/** r" Generate a sound effect from a prompt. */
|
|
996
|
+
generateSfx(request: any): Promise<any>
|
|
997
|
+
}
|
|
998
|
+
export type JsMusicProvider = MusicProvider
|
|
999
|
+
|
|
795
1000
|
/**
|
|
796
1001
|
* An `OpenAI` compute provider exposing text-to-speech.
|
|
797
1002
|
*
|
|
@@ -988,6 +1193,25 @@ export declare class StateNamespace {
|
|
|
988
1193
|
}
|
|
989
1194
|
export type JsStateNamespace = StateNamespace
|
|
990
1195
|
|
|
1196
|
+
/**
|
|
1197
|
+
* r" Base class for 3D model generation providers.
|
|
1198
|
+
* r"
|
|
1199
|
+
* r" Subclass and override `generate3d()` to implement a custom 3D
|
|
1200
|
+
* r" backend.
|
|
1201
|
+
*/
|
|
1202
|
+
export declare class ThreeDProvider {
|
|
1203
|
+
constructor(config: CapabilityProviderConfig)
|
|
1204
|
+
/** The provider identifier. */
|
|
1205
|
+
get providerId(): string | null
|
|
1206
|
+
/** The base URL, if set. */
|
|
1207
|
+
get baseUrl(): string | null
|
|
1208
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
1209
|
+
get vramEstimateBytes(): number | null
|
|
1210
|
+
/** r" Generate a 3D model from a prompt or image. */
|
|
1211
|
+
generate3d(request: any): Promise<any>
|
|
1212
|
+
}
|
|
1213
|
+
export type JsThreeDProvider = ThreeDProvider
|
|
1214
|
+
|
|
991
1215
|
/**
|
|
992
1216
|
* An audio transcription provider.
|
|
993
1217
|
*
|
|
@@ -1027,6 +1251,25 @@ export declare class Transcription {
|
|
|
1027
1251
|
}
|
|
1028
1252
|
export type JsTranscription = Transcription
|
|
1029
1253
|
|
|
1254
|
+
/**
|
|
1255
|
+
* r" Base class for text-to-speech providers.
|
|
1256
|
+
* r"
|
|
1257
|
+
* r" Subclass and override `textToSpeech()` to implement a custom TTS
|
|
1258
|
+
* r" backend.
|
|
1259
|
+
*/
|
|
1260
|
+
export declare class TTSProvider {
|
|
1261
|
+
constructor(config: CapabilityProviderConfig)
|
|
1262
|
+
/** The provider identifier. */
|
|
1263
|
+
get providerId(): string | null
|
|
1264
|
+
/** The base URL, if set. */
|
|
1265
|
+
get baseUrl(): string | null
|
|
1266
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
1267
|
+
get vramEstimateBytes(): number | null
|
|
1268
|
+
/** r" Synthesize speech from text. */
|
|
1269
|
+
textToSpeech(request: any): Promise<any>
|
|
1270
|
+
}
|
|
1271
|
+
export type JsTTSProvider = TTSProvider
|
|
1272
|
+
|
|
1030
1273
|
/**
|
|
1031
1274
|
* A Valkey/Redis-backed backend for the memory store.
|
|
1032
1275
|
*
|
|
@@ -1045,6 +1288,50 @@ export declare class ValkeyBackend {
|
|
|
1045
1288
|
}
|
|
1046
1289
|
export type JsValkeyBackend = ValkeyBackend
|
|
1047
1290
|
|
|
1291
|
+
/**
|
|
1292
|
+
* r" Base class for video generation providers.
|
|
1293
|
+
* r"
|
|
1294
|
+
* r" Subclass and override `textToVideo()` and `imageToVideo()` to
|
|
1295
|
+
* r" implement a custom video backend.
|
|
1296
|
+
*/
|
|
1297
|
+
export declare class VideoProvider {
|
|
1298
|
+
constructor(config: CapabilityProviderConfig)
|
|
1299
|
+
/** The provider identifier. */
|
|
1300
|
+
get providerId(): string | null
|
|
1301
|
+
/** The base URL, if set. */
|
|
1302
|
+
get baseUrl(): string | null
|
|
1303
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
1304
|
+
get vramEstimateBytes(): number | null
|
|
1305
|
+
/** r" Generate a video from a text prompt. */
|
|
1306
|
+
textToVideo(request: any): Promise<any>
|
|
1307
|
+
/** r" Generate a video from an image (image-to-video). */
|
|
1308
|
+
imageToVideo(request: any): Promise<any>
|
|
1309
|
+
}
|
|
1310
|
+
export type JsVideoProvider = VideoProvider
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* r" Base class for voice cloning providers.
|
|
1314
|
+
* r"
|
|
1315
|
+
* r" Subclass and override `cloneVoice()`, `listVoices()`, and
|
|
1316
|
+
* r" `deleteVoice()` to implement a custom voice-cloning backend.
|
|
1317
|
+
*/
|
|
1318
|
+
export declare class VoiceProvider {
|
|
1319
|
+
constructor(config: CapabilityProviderConfig)
|
|
1320
|
+
/** The provider identifier. */
|
|
1321
|
+
get providerId(): string | null
|
|
1322
|
+
/** The base URL, if set. */
|
|
1323
|
+
get baseUrl(): string | null
|
|
1324
|
+
/** Estimated VRAM footprint in bytes, if set. */
|
|
1325
|
+
get vramEstimateBytes(): number | null
|
|
1326
|
+
/** r" Clone a voice from audio samples. */
|
|
1327
|
+
cloneVoice(request: any): Promise<any>
|
|
1328
|
+
/** r" List all available voices. */
|
|
1329
|
+
listVoices(): Promise<any>
|
|
1330
|
+
/** r" Delete a previously-cloned voice. */
|
|
1331
|
+
deleteVoice(voice: any): Promise<any>
|
|
1332
|
+
}
|
|
1333
|
+
export type JsVoiceProvider = VoiceProvider
|
|
1334
|
+
|
|
1048
1335
|
/**
|
|
1049
1336
|
* A workflow builder and runner.
|
|
1050
1337
|
*
|
|
@@ -1255,6 +1542,16 @@ export declare class WorkflowHandler {
|
|
|
1255
1542
|
}
|
|
1256
1543
|
export type JsWorkflowHandler = WorkflowHandler
|
|
1257
1544
|
|
|
1545
|
+
/** Configuration passed to any capability provider constructor. */
|
|
1546
|
+
export interface CapabilityProviderConfig {
|
|
1547
|
+
/** Short identifier for this provider (e.g. `"elevenlabs"`, `"fal"`). */
|
|
1548
|
+
providerId: string
|
|
1549
|
+
/** Optional base URL for HTTP-based providers. */
|
|
1550
|
+
baseUrl?: string
|
|
1551
|
+
/** Optional estimated VRAM footprint in bytes when loaded. */
|
|
1552
|
+
vramEstimateBytes?: number
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1258
1555
|
/** Options for creating a `ChatMessage`. */
|
|
1259
1556
|
export interface ChatMessageOptions {
|
|
1260
1557
|
/** Role: "system", "user", "assistant", or "tool". Defaults to "user". */
|
|
@@ -1298,6 +1595,34 @@ export interface ChatMessageOptions {
|
|
|
1298
1595
|
*/
|
|
1299
1596
|
export declare function completeBatch(model: JsCompletionModel, messageSets: Array<Array<JsChatMessage>>, options?: JsBatchOptions | undefined | null): Promise<JsBatchResult>
|
|
1300
1597
|
|
|
1598
|
+
/**
|
|
1599
|
+
* Configuration for subclassed `CompletionModel` instances.
|
|
1600
|
+
*
|
|
1601
|
+
* When extending `CompletionModel` from JavaScript/TypeScript, pass this
|
|
1602
|
+
* to `super()` so the base class can report `modelId` and other metadata
|
|
1603
|
+
* without a concrete provider.
|
|
1604
|
+
*
|
|
1605
|
+
* ```javascript
|
|
1606
|
+
* class MyLLM extends CompletionModel {
|
|
1607
|
+
* constructor() {
|
|
1608
|
+
* super({ modelId: "my-custom-model", contextLength: 8192 });
|
|
1609
|
+
* }
|
|
1610
|
+
* }
|
|
1611
|
+
* ```
|
|
1612
|
+
*/
|
|
1613
|
+
export interface CompletionModelConfig {
|
|
1614
|
+
/** Model identifier (e.g. `"my-org/custom-llama"`). */
|
|
1615
|
+
modelId?: string
|
|
1616
|
+
/** Maximum context window in tokens. */
|
|
1617
|
+
contextLength?: number
|
|
1618
|
+
/** Base URL for HTTP-based providers. */
|
|
1619
|
+
baseUrl?: string
|
|
1620
|
+
/** Estimated VRAM footprint in bytes when loaded. */
|
|
1621
|
+
vramEstimateBytes?: number
|
|
1622
|
+
/** Maximum output tokens the model supports. */
|
|
1623
|
+
maxOutputTokens?: number
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1301
1626
|
/**
|
|
1302
1627
|
* Estimate the total token count for an array of chat messages.
|
|
1303
1628
|
*
|
|
@@ -1324,6 +1649,30 @@ export interface CustomProviderOptions {
|
|
|
1324
1649
|
providerId?: string
|
|
1325
1650
|
}
|
|
1326
1651
|
|
|
1652
|
+
/**
|
|
1653
|
+
* Configuration for subclassed `EmbeddingModel` instances.
|
|
1654
|
+
*
|
|
1655
|
+
* When extending `EmbeddingModel` from JavaScript/TypeScript, pass this
|
|
1656
|
+
* to `super()` so the base class can report `modelId` and other metadata
|
|
1657
|
+
* without a concrete provider.
|
|
1658
|
+
*
|
|
1659
|
+
* ```javascript
|
|
1660
|
+
* class MyEmbedder extends EmbeddingModel {
|
|
1661
|
+
* constructor() {
|
|
1662
|
+
* super({ modelId: "my-custom-embedder", dimensions: 768 });
|
|
1663
|
+
* }
|
|
1664
|
+
* }
|
|
1665
|
+
* ```
|
|
1666
|
+
*/
|
|
1667
|
+
export interface EmbeddingModelConfig {
|
|
1668
|
+
/** Model identifier (e.g. `"my-org/custom-embedder"`). */
|
|
1669
|
+
modelId?: string
|
|
1670
|
+
/** The dimensionality of vectors produced by this model. */
|
|
1671
|
+
dimensions?: number
|
|
1672
|
+
/** Base URL for HTTP-based providers. */
|
|
1673
|
+
baseUrl?: string
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1327
1676
|
/**
|
|
1328
1677
|
* Estimate the number of tokens in a text string.
|
|
1329
1678
|
*
|
|
@@ -1753,6 +2102,33 @@ export interface JsMemoryResult {
|
|
|
1753
2102
|
metadata: any
|
|
1754
2103
|
}
|
|
1755
2104
|
|
|
2105
|
+
/**
|
|
2106
|
+
* Pricing information for a model in USD per million tokens.
|
|
2107
|
+
*
|
|
2108
|
+
* At minimum, `inputPerMillion` and `outputPerMillion` must be provided
|
|
2109
|
+
* for registration to take effect.
|
|
2110
|
+
*/
|
|
2111
|
+
export interface JsModelPricing {
|
|
2112
|
+
/** USD per million input (prompt) tokens. */
|
|
2113
|
+
inputPerMillion?: number
|
|
2114
|
+
/** USD per million output (completion) tokens. */
|
|
2115
|
+
outputPerMillion?: number
|
|
2116
|
+
/** USD per image (for multimodal models). */
|
|
2117
|
+
perImage?: number
|
|
2118
|
+
/** USD per second (for audio/video models). */
|
|
2119
|
+
perSecond?: number
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
/** Status snapshot for a single registered model. */
|
|
2123
|
+
export interface JsModelStatus {
|
|
2124
|
+
/** Model identifier. */
|
|
2125
|
+
id: string
|
|
2126
|
+
/** Whether the model is currently loaded into VRAM. */
|
|
2127
|
+
loaded: boolean
|
|
2128
|
+
/** Estimated VRAM footprint in bytes. */
|
|
2129
|
+
vramEstimate: number
|
|
2130
|
+
}
|
|
2131
|
+
|
|
1756
2132
|
export interface JsMusicRequest {
|
|
1757
2133
|
prompt: string
|
|
1758
2134
|
durationSeconds?: number
|
|
@@ -2000,6 +2376,33 @@ export interface JsWorkflowResult {
|
|
|
2000
2376
|
data: any
|
|
2001
2377
|
}
|
|
2002
2378
|
|
|
2379
|
+
/**
|
|
2380
|
+
* Look up pricing for a model by its ID.
|
|
2381
|
+
*
|
|
2382
|
+
* Returns `null` if the model is unknown. Model IDs are normalized before
|
|
2383
|
+
* lookup (date suffixes, provider prefixes, and casing are stripped).
|
|
2384
|
+
*
|
|
2385
|
+
* ```javascript
|
|
2386
|
+
* const pricing = lookupPricing("gpt-4.1");
|
|
2387
|
+
* if (pricing) {
|
|
2388
|
+
* console.log(`Input: $${pricing.inputPerMillion}/M tokens`);
|
|
2389
|
+
* }
|
|
2390
|
+
* ```
|
|
2391
|
+
*/
|
|
2392
|
+
export declare function lookupPricing(modelId: string): JsModelPricing | null
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Configuration for creating a [`JsModelManager`].
|
|
2396
|
+
*
|
|
2397
|
+
* Exactly one of `budgetGb` or `budgetBytes` must be provided.
|
|
2398
|
+
*/
|
|
2399
|
+
export interface ModelManagerConfig {
|
|
2400
|
+
/** VRAM budget in gigabytes (e.g. `8.0` for 8 GiB). */
|
|
2401
|
+
budgetGb?: number
|
|
2402
|
+
/** VRAM budget in bytes. */
|
|
2403
|
+
budgetBytes?: number
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2003
2406
|
/** Options for creating a `PromptTemplate`. */
|
|
2004
2407
|
export interface PromptTemplateOptions {
|
|
2005
2408
|
/** The chat role: "system", "user", or "assistant". Defaults to "user". */
|
|
@@ -2012,6 +2415,22 @@ export interface PromptTemplateOptions {
|
|
|
2012
2415
|
version?: string
|
|
2013
2416
|
}
|
|
2014
2417
|
|
|
2418
|
+
/**
|
|
2419
|
+
* Register (or overwrite) pricing for a model.
|
|
2420
|
+
*
|
|
2421
|
+
* Both `inputPerMillion` and `outputPerMillion` must be set in the
|
|
2422
|
+
* `pricing` object; if either is `null`/`undefined` the call is silently
|
|
2423
|
+
* ignored.
|
|
2424
|
+
*
|
|
2425
|
+
* ```javascript
|
|
2426
|
+
* registerPricing("my-custom-model", {
|
|
2427
|
+
* inputPerMillion: 2.0,
|
|
2428
|
+
* outputPerMillion: 8.0,
|
|
2429
|
+
* });
|
|
2430
|
+
* ```
|
|
2431
|
+
*/
|
|
2432
|
+
export declare function registerPricing(modelId: string, pricing: JsModelPricing): void
|
|
2433
|
+
|
|
2015
2434
|
/**
|
|
2016
2435
|
* Run an agentic tool execution loop.
|
|
2017
2436
|
*
|
package/index.js
CHANGED
|
@@ -77,8 +77,8 @@ function requireNative() {
|
|
|
77
77
|
try {
|
|
78
78
|
const binding = require('blazen-android-arm64')
|
|
79
79
|
const bindingPackageVersion = require('blazen-android-arm64/package.json').version
|
|
80
|
-
if (bindingPackageVersion !== '0.1.
|
|
81
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
80
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
81
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
82
82
|
}
|
|
83
83
|
return binding
|
|
84
84
|
} catch (e) {
|
|
@@ -93,8 +93,8 @@ function requireNative() {
|
|
|
93
93
|
try {
|
|
94
94
|
const binding = require('blazen-android-arm-eabi')
|
|
95
95
|
const bindingPackageVersion = require('blazen-android-arm-eabi/package.json').version
|
|
96
|
-
if (bindingPackageVersion !== '0.1.
|
|
97
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
96
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
97
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
98
98
|
}
|
|
99
99
|
return binding
|
|
100
100
|
} catch (e) {
|
|
@@ -114,8 +114,8 @@ function requireNative() {
|
|
|
114
114
|
try {
|
|
115
115
|
const binding = require('blazen-win32-x64-gnu')
|
|
116
116
|
const bindingPackageVersion = require('blazen-win32-x64-gnu/package.json').version
|
|
117
|
-
if (bindingPackageVersion !== '0.1.
|
|
118
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
117
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
118
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
119
119
|
}
|
|
120
120
|
return binding
|
|
121
121
|
} catch (e) {
|
|
@@ -130,8 +130,8 @@ function requireNative() {
|
|
|
130
130
|
try {
|
|
131
131
|
const binding = require('blazen-win32-x64-msvc')
|
|
132
132
|
const bindingPackageVersion = require('blazen-win32-x64-msvc/package.json').version
|
|
133
|
-
if (bindingPackageVersion !== '0.1.
|
|
134
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
133
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
134
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
135
135
|
}
|
|
136
136
|
return binding
|
|
137
137
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('blazen-win32-ia32-msvc')
|
|
149
149
|
const bindingPackageVersion = require('blazen-win32-ia32-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '0.1.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
150
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -163,8 +163,8 @@ function requireNative() {
|
|
|
163
163
|
try {
|
|
164
164
|
const binding = require('blazen-win32-arm64-msvc')
|
|
165
165
|
const bindingPackageVersion = require('blazen-win32-arm64-msvc/package.json').version
|
|
166
|
-
if (bindingPackageVersion !== '0.1.
|
|
167
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
166
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
167
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
168
168
|
}
|
|
169
169
|
return binding
|
|
170
170
|
} catch (e) {
|
|
@@ -182,8 +182,8 @@ function requireNative() {
|
|
|
182
182
|
try {
|
|
183
183
|
const binding = require('blazen-darwin-universal')
|
|
184
184
|
const bindingPackageVersion = require('blazen-darwin-universal/package.json').version
|
|
185
|
-
if (bindingPackageVersion !== '0.1.
|
|
186
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
185
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
186
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
187
187
|
}
|
|
188
188
|
return binding
|
|
189
189
|
} catch (e) {
|
|
@@ -198,8 +198,8 @@ function requireNative() {
|
|
|
198
198
|
try {
|
|
199
199
|
const binding = require('blazen-darwin-x64')
|
|
200
200
|
const bindingPackageVersion = require('blazen-darwin-x64/package.json').version
|
|
201
|
-
if (bindingPackageVersion !== '0.1.
|
|
202
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
201
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
202
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
203
203
|
}
|
|
204
204
|
return binding
|
|
205
205
|
} catch (e) {
|
|
@@ -214,8 +214,8 @@ function requireNative() {
|
|
|
214
214
|
try {
|
|
215
215
|
const binding = require('blazen-darwin-arm64')
|
|
216
216
|
const bindingPackageVersion = require('blazen-darwin-arm64/package.json').version
|
|
217
|
-
if (bindingPackageVersion !== '0.1.
|
|
218
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
217
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
218
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
219
219
|
}
|
|
220
220
|
return binding
|
|
221
221
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('blazen-freebsd-x64')
|
|
236
236
|
const bindingPackageVersion = require('blazen-freebsd-x64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '0.1.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
237
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -250,8 +250,8 @@ function requireNative() {
|
|
|
250
250
|
try {
|
|
251
251
|
const binding = require('blazen-freebsd-arm64')
|
|
252
252
|
const bindingPackageVersion = require('blazen-freebsd-arm64/package.json').version
|
|
253
|
-
if (bindingPackageVersion !== '0.1.
|
|
254
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
253
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
254
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
255
255
|
}
|
|
256
256
|
return binding
|
|
257
257
|
} catch (e) {
|
|
@@ -271,8 +271,8 @@ function requireNative() {
|
|
|
271
271
|
try {
|
|
272
272
|
const binding = require('blazen-linux-x64-musl')
|
|
273
273
|
const bindingPackageVersion = require('blazen-linux-x64-musl/package.json').version
|
|
274
|
-
if (bindingPackageVersion !== '0.1.
|
|
275
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
274
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
275
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
276
276
|
}
|
|
277
277
|
return binding
|
|
278
278
|
} catch (e) {
|
|
@@ -287,8 +287,8 @@ function requireNative() {
|
|
|
287
287
|
try {
|
|
288
288
|
const binding = require('blazen-linux-x64-gnu')
|
|
289
289
|
const bindingPackageVersion = require('blazen-linux-x64-gnu/package.json').version
|
|
290
|
-
if (bindingPackageVersion !== '0.1.
|
|
291
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
290
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
291
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
292
292
|
}
|
|
293
293
|
return binding
|
|
294
294
|
} catch (e) {
|
|
@@ -305,8 +305,8 @@ function requireNative() {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = require('blazen-linux-arm64-musl')
|
|
307
307
|
const bindingPackageVersion = require('blazen-linux-arm64-musl/package.json').version
|
|
308
|
-
if (bindingPackageVersion !== '0.1.
|
|
309
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
308
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
309
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
310
310
|
}
|
|
311
311
|
return binding
|
|
312
312
|
} catch (e) {
|
|
@@ -321,8 +321,8 @@ function requireNative() {
|
|
|
321
321
|
try {
|
|
322
322
|
const binding = require('blazen-linux-arm64-gnu')
|
|
323
323
|
const bindingPackageVersion = require('blazen-linux-arm64-gnu/package.json').version
|
|
324
|
-
if (bindingPackageVersion !== '0.1.
|
|
325
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
324
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
325
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
326
326
|
}
|
|
327
327
|
return binding
|
|
328
328
|
} catch (e) {
|
|
@@ -339,8 +339,8 @@ function requireNative() {
|
|
|
339
339
|
try {
|
|
340
340
|
const binding = require('blazen-linux-arm-musleabihf')
|
|
341
341
|
const bindingPackageVersion = require('blazen-linux-arm-musleabihf/package.json').version
|
|
342
|
-
if (bindingPackageVersion !== '0.1.
|
|
343
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
342
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
343
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
344
344
|
}
|
|
345
345
|
return binding
|
|
346
346
|
} catch (e) {
|
|
@@ -355,8 +355,8 @@ function requireNative() {
|
|
|
355
355
|
try {
|
|
356
356
|
const binding = require('blazen-linux-arm-gnueabihf')
|
|
357
357
|
const bindingPackageVersion = require('blazen-linux-arm-gnueabihf/package.json').version
|
|
358
|
-
if (bindingPackageVersion !== '0.1.
|
|
359
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
358
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
359
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
360
360
|
}
|
|
361
361
|
return binding
|
|
362
362
|
} catch (e) {
|
|
@@ -373,8 +373,8 @@ function requireNative() {
|
|
|
373
373
|
try {
|
|
374
374
|
const binding = require('blazen-linux-loong64-musl')
|
|
375
375
|
const bindingPackageVersion = require('blazen-linux-loong64-musl/package.json').version
|
|
376
|
-
if (bindingPackageVersion !== '0.1.
|
|
377
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
376
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
377
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
378
378
|
}
|
|
379
379
|
return binding
|
|
380
380
|
} catch (e) {
|
|
@@ -389,8 +389,8 @@ function requireNative() {
|
|
|
389
389
|
try {
|
|
390
390
|
const binding = require('blazen-linux-loong64-gnu')
|
|
391
391
|
const bindingPackageVersion = require('blazen-linux-loong64-gnu/package.json').version
|
|
392
|
-
if (bindingPackageVersion !== '0.1.
|
|
393
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
392
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
393
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
394
394
|
}
|
|
395
395
|
return binding
|
|
396
396
|
} catch (e) {
|
|
@@ -407,8 +407,8 @@ function requireNative() {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = require('blazen-linux-riscv64-musl')
|
|
409
409
|
const bindingPackageVersion = require('blazen-linux-riscv64-musl/package.json').version
|
|
410
|
-
if (bindingPackageVersion !== '0.1.
|
|
411
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
410
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
411
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
412
412
|
}
|
|
413
413
|
return binding
|
|
414
414
|
} catch (e) {
|
|
@@ -423,8 +423,8 @@ function requireNative() {
|
|
|
423
423
|
try {
|
|
424
424
|
const binding = require('blazen-linux-riscv64-gnu')
|
|
425
425
|
const bindingPackageVersion = require('blazen-linux-riscv64-gnu/package.json').version
|
|
426
|
-
if (bindingPackageVersion !== '0.1.
|
|
427
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
426
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
427
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
428
428
|
}
|
|
429
429
|
return binding
|
|
430
430
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('blazen-linux-ppc64-gnu')
|
|
442
442
|
const bindingPackageVersion = require('blazen-linux-ppc64-gnu/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '0.1.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
443
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('blazen-linux-s390x-gnu')
|
|
458
458
|
const bindingPackageVersion = require('blazen-linux-s390x-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '0.1.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
459
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('blazen-openharmony-arm64')
|
|
478
478
|
const bindingPackageVersion = require('blazen-openharmony-arm64/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '0.1.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
479
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('blazen-openharmony-x64')
|
|
494
494
|
const bindingPackageVersion = require('blazen-openharmony-x64/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '0.1.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
495
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -508,8 +508,8 @@ function requireNative() {
|
|
|
508
508
|
try {
|
|
509
509
|
const binding = require('blazen-openharmony-arm')
|
|
510
510
|
const bindingPackageVersion = require('blazen-openharmony-arm/package.json').version
|
|
511
|
-
if (bindingPackageVersion !== '0.1.
|
|
512
|
-
throw new Error(`Native binding package version mismatch, expected 0.1.
|
|
511
|
+
if (bindingPackageVersion !== '0.1.131' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
512
|
+
throw new Error(`Native binding package version mismatch, expected 0.1.131 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
513
513
|
}
|
|
514
514
|
return binding
|
|
515
515
|
} catch (e) {
|
|
@@ -576,6 +576,8 @@ if (!nativeBinding) {
|
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
module.exports = nativeBinding
|
|
579
|
+
module.exports.BackgroundRemovalProvider = nativeBinding.BackgroundRemovalProvider
|
|
580
|
+
module.exports.JsBackgroundRemovalProvider = nativeBinding.JsBackgroundRemovalProvider
|
|
579
581
|
module.exports.ChatMessage = nativeBinding.ChatMessage
|
|
580
582
|
module.exports.JsChatMessage = nativeBinding.JsChatMessage
|
|
581
583
|
module.exports.ChatWindow = nativeBinding.ChatWindow
|
|
@@ -592,12 +594,20 @@ module.exports.FalEmbeddingModel = nativeBinding.FalEmbeddingModel
|
|
|
592
594
|
module.exports.JsFalEmbeddingModel = nativeBinding.JsFalEmbeddingModel
|
|
593
595
|
module.exports.FalProvider = nativeBinding.FalProvider
|
|
594
596
|
module.exports.JsFalProvider = nativeBinding.JsFalProvider
|
|
597
|
+
module.exports.ImageProvider = nativeBinding.ImageProvider
|
|
598
|
+
module.exports.JsImageProvider = nativeBinding.JsImageProvider
|
|
595
599
|
module.exports.InMemoryBackend = nativeBinding.InMemoryBackend
|
|
596
600
|
module.exports.JsInMemoryBackend = nativeBinding.JsInMemoryBackend
|
|
597
601
|
module.exports.JsonlBackend = nativeBinding.JsonlBackend
|
|
598
602
|
module.exports.JsJsonlBackend = nativeBinding.JsJsonlBackend
|
|
599
603
|
module.exports.Memory = nativeBinding.Memory
|
|
600
604
|
module.exports.JsMemory = nativeBinding.JsMemory
|
|
605
|
+
module.exports.MemoryBackend = nativeBinding.MemoryBackend
|
|
606
|
+
module.exports.JsMemoryBackend = nativeBinding.JsMemoryBackend
|
|
607
|
+
module.exports.ModelManager = nativeBinding.ModelManager
|
|
608
|
+
module.exports.JsModelManager = nativeBinding.JsModelManager
|
|
609
|
+
module.exports.MusicProvider = nativeBinding.MusicProvider
|
|
610
|
+
module.exports.JsMusicProvider = nativeBinding.JsMusicProvider
|
|
601
611
|
module.exports.OpenAiProvider = nativeBinding.OpenAiProvider
|
|
602
612
|
module.exports.JsOpenAiProvider = nativeBinding.JsOpenAiProvider
|
|
603
613
|
module.exports.PromptRegistry = nativeBinding.PromptRegistry
|
|
@@ -608,10 +618,18 @@ module.exports.SessionNamespace = nativeBinding.SessionNamespace
|
|
|
608
618
|
module.exports.JsSessionNamespace = nativeBinding.JsSessionNamespace
|
|
609
619
|
module.exports.StateNamespace = nativeBinding.StateNamespace
|
|
610
620
|
module.exports.JsStateNamespace = nativeBinding.JsStateNamespace
|
|
621
|
+
module.exports.ThreeDProvider = nativeBinding.ThreeDProvider
|
|
622
|
+
module.exports.JsThreeDProvider = nativeBinding.JsThreeDProvider
|
|
611
623
|
module.exports.Transcription = nativeBinding.Transcription
|
|
612
624
|
module.exports.JsTranscription = nativeBinding.JsTranscription
|
|
625
|
+
module.exports.TTSProvider = nativeBinding.TTSProvider
|
|
626
|
+
module.exports.JsTTSProvider = nativeBinding.JsTTSProvider
|
|
613
627
|
module.exports.ValkeyBackend = nativeBinding.ValkeyBackend
|
|
614
628
|
module.exports.JsValkeyBackend = nativeBinding.JsValkeyBackend
|
|
629
|
+
module.exports.VideoProvider = nativeBinding.VideoProvider
|
|
630
|
+
module.exports.JsVideoProvider = nativeBinding.JsVideoProvider
|
|
631
|
+
module.exports.VoiceProvider = nativeBinding.VoiceProvider
|
|
632
|
+
module.exports.JsVoiceProvider = nativeBinding.JsVoiceProvider
|
|
615
633
|
module.exports.Workflow = nativeBinding.Workflow
|
|
616
634
|
module.exports.JsWorkflow = nativeBinding.JsWorkflow
|
|
617
635
|
module.exports.WorkflowHandler = nativeBinding.WorkflowHandler
|
|
@@ -623,6 +641,8 @@ module.exports.JsCacheStrategy = nativeBinding.JsCacheStrategy
|
|
|
623
641
|
module.exports.JsFalLlmEndpointKind = nativeBinding.JsFalLlmEndpointKind
|
|
624
642
|
module.exports.JsJobStatus = nativeBinding.JsJobStatus
|
|
625
643
|
module.exports.JsRole = nativeBinding.JsRole
|
|
644
|
+
module.exports.lookupPricing = nativeBinding.lookupPricing
|
|
645
|
+
module.exports.registerPricing = nativeBinding.registerPricing
|
|
626
646
|
module.exports.runAgent = nativeBinding.runAgent
|
|
627
647
|
module.exports.SessionPausePolicy = nativeBinding.SessionPausePolicy
|
|
628
648
|
module.exports.JsSessionPausePolicy = nativeBinding.JsSessionPausePolicy
|