@xberg-io/liter-llm-wasm 1.17.3 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
+ <!-- This file is auto-generated by alef — DO NOT EDIT. -->
2
+ <!-- alef:hash:d70381a419d10f3ba2c36334770b6377bf69c297e242b8c6a6c8103a169d0a3c -->
3
+ <!-- To regenerate: alef readme -->
4
+ <!-- To verify freshness: alef verify -->
5
+
1
6
  <p align="center">
2
7
  <picture>
3
8
  <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-dark.svg">
@@ -27,7 +27,7 @@ export type WasmToolChoice = WasmToolChoiceModeWire | WasmSpecificToolChoice;
27
27
 
28
28
  export type WasmStopSequence = string | string[];
29
29
 
30
- export type WasmEmbeddingInput = string | string[];
30
+ export type WasmEmbeddingInput = string | string[] | any[];
31
31
 
32
32
  export type WasmModerationInput = string | string[];
33
33
 
@@ -748,6 +748,23 @@ export class WasmDocumentContent {
748
748
  mediaType: string;
749
749
  }
750
750
 
751
+ /**
752
+ * A content part in a multimodal embedding input.
753
+ */
754
+ export class WasmEmbeddingContentPart {
755
+ free(): void;
756
+ [Symbol.dispose](): void;
757
+ static default(): WasmEmbeddingContentPart;
758
+ constructor();
759
+ get imageBase64(): string | undefined;
760
+ set imageBase64(value: string | null | undefined);
761
+ get imageUrl(): WasmImageUrl | undefined;
762
+ set imageUrl(value: WasmImageUrl | null | undefined);
763
+ get text(): string | undefined;
764
+ set text(value: string | null | undefined);
765
+ type: string;
766
+ }
767
+
751
768
  /**
752
769
  * The format in which the embedding vectors are returned.
753
770
  */
@@ -1060,7 +1077,7 @@ export class WasmLlmConfig {
1060
1077
  free(): void;
1061
1078
  [Symbol.dispose](): void;
1062
1079
  static default(): WasmLlmConfig;
1063
- constructor(model?: string | null, apiKey?: string | null, baseUrl?: string | null, timeoutSecs?: bigint | null, maxRetries?: number | null, temperature?: number | null, maxTokens?: bigint | null, loadEnv?: boolean | null, headers?: any | null, providers?: WasmLlmProviderConfig[] | null, cache?: WasmLlmCacheConfig | null, budget?: WasmLlmBudgetConfig | null, rateLimit?: WasmLlmRateLimitConfig | null, costTracking?: boolean | null, tracing?: boolean | null, cooldownSecs?: bigint | null, healthCheckSecs?: bigint | null, bedrock?: WasmBedrockConfig | null);
1080
+ constructor(model?: string | null, apiKey?: string | null, baseUrl?: string | null, timeoutSecs?: bigint | null, maxRetries?: number | null, temperature?: number | null, maxTokens?: bigint | null, loadEnv?: boolean | null, headers?: any | null, providers?: WasmLlmProviderConfig[] | null, cache?: WasmLlmCacheConfig | null, budget?: WasmLlmBudgetConfig | null, rateLimit?: WasmLlmRateLimitConfig | null, inFlightLimit?: WasmLlmInFlightLimitConfig | null, costTracking?: boolean | null, tracing?: boolean | null, cooldownSecs?: bigint | null, healthCheckSecs?: bigint | null, bedrock?: WasmBedrockConfig | null);
1064
1081
  get apiKey(): string | undefined;
1065
1082
  set apiKey(value: string | null | undefined);
1066
1083
  get baseUrl(): string | undefined;
@@ -1079,6 +1096,8 @@ export class WasmLlmConfig {
1079
1096
  set headers(value: any | null | undefined);
1080
1097
  get healthCheckSecs(): bigint | undefined;
1081
1098
  set healthCheckSecs(value: bigint | null | undefined);
1099
+ get inFlightLimit(): WasmLlmInFlightLimitConfig | undefined;
1100
+ set inFlightLimit(value: WasmLlmInFlightLimitConfig | null | undefined);
1082
1101
  get loadEnv(): boolean | undefined;
1083
1102
  set loadEnv(value: boolean | null | undefined);
1084
1103
  get maxRetries(): number | undefined;
@@ -1098,6 +1117,18 @@ export class WasmLlmConfig {
1098
1117
  set tracing(value: boolean | null | undefined);
1099
1118
  }
1100
1119
 
1120
+ /**
1121
+ * Global per-client in-flight provider request limit.
1122
+ */
1123
+ export class WasmLlmInFlightLimitConfig {
1124
+ free(): void;
1125
+ [Symbol.dispose](): void;
1126
+ static default(): WasmLlmInFlightLimitConfig;
1127
+ constructor(maxInFlight?: number | null);
1128
+ get maxInFlight(): number | undefined;
1129
+ set maxInFlight(value: number | null | undefined);
1130
+ }
1131
+
1101
1132
  /**
1102
1133
  * A custom provider configuration entry.
1103
1134
  */
@@ -2221,6 +2252,7 @@ export interface InitOutput {
2221
2252
  readonly __wbg_wasmdeleteresponse_free: (a: number, b: number) => void;
2222
2253
  readonly __wbg_wasmdevelopermessage_free: (a: number, b: number) => void;
2223
2254
  readonly __wbg_wasmdocumentcontent_free: (a: number, b: number) => void;
2255
+ readonly __wbg_wasmembeddingcontentpart_free: (a: number, b: number) => void;
2224
2256
  readonly __wbg_wasmembeddingobject_free: (a: number, b: number) => void;
2225
2257
  readonly __wbg_wasmembeddingrequest_free: (a: number, b: number) => void;
2226
2258
  readonly __wbg_wasmembeddingresponse_free: (a: number, b: number) => void;
@@ -2238,6 +2270,7 @@ export interface InitOutput {
2238
2270
  readonly __wbg_wasmllmbudgetconfig_free: (a: number, b: number) => void;
2239
2271
  readonly __wbg_wasmllmcacheconfig_free: (a: number, b: number) => void;
2240
2272
  readonly __wbg_wasmllmconfig_free: (a: number, b: number) => void;
2273
+ readonly __wbg_wasmllminflightlimitconfig_free: (a: number, b: number) => void;
2241
2274
  readonly __wbg_wasmllmproviderconfig_free: (a: number, b: number) => void;
2242
2275
  readonly __wbg_wasmllmratelimitconfig_free: (a: number, b: number) => void;
2243
2276
  readonly __wbg_wasmmessage_free: (a: number, b: number) => void;
@@ -2674,6 +2707,15 @@ export interface InitOutput {
2674
2707
  readonly wasmdocumentcontent_mediaType: (a: number) => [number, number];
2675
2708
  readonly wasmdocumentcontent_set_data: (a: number, b: number, c: number) => void;
2676
2709
  readonly wasmdocumentcontent_set_mediaType: (a: number, b: number, c: number) => void;
2710
+ readonly wasmembeddingcontentpart_default: () => number;
2711
+ readonly wasmembeddingcontentpart_imageBase64: (a: number) => [number, number];
2712
+ readonly wasmembeddingcontentpart_imageUrl: (a: number) => number;
2713
+ readonly wasmembeddingcontentpart_set_imageBase64: (a: number, b: number, c: number) => void;
2714
+ readonly wasmembeddingcontentpart_set_imageUrl: (a: number, b: number) => void;
2715
+ readonly wasmembeddingcontentpart_set_text: (a: number, b: number, c: number) => void;
2716
+ readonly wasmembeddingcontentpart_set_type: (a: number, b: number, c: number) => void;
2717
+ readonly wasmembeddingcontentpart_text: (a: number) => [number, number];
2718
+ readonly wasmembeddingcontentpart_type: (a: number) => [number, number];
2677
2719
  readonly wasmembeddingobject_default: () => number;
2678
2720
  readonly wasmembeddingobject_embedding: (a: number) => [number, number];
2679
2721
  readonly wasmembeddingobject_index: (a: number) => number;
@@ -2799,10 +2841,11 @@ export interface InitOutput {
2799
2841
  readonly wasmllmconfig_default: () => number;
2800
2842
  readonly wasmllmconfig_headers: (a: number) => any;
2801
2843
  readonly wasmllmconfig_healthCheckSecs: (a: number) => [number, bigint];
2844
+ readonly wasmllmconfig_inFlightLimit: (a: number) => number;
2802
2845
  readonly wasmllmconfig_loadEnv: (a: number) => number;
2803
2846
  readonly wasmllmconfig_maxRetries: (a: number) => number;
2804
2847
  readonly wasmllmconfig_model: (a: number) => [number, number];
2805
- readonly wasmllmconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: number, l: number, m: bigint, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: bigint, y: number, z: bigint, a1: number) => number;
2848
+ readonly wasmllmconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: number, l: number, m: bigint, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: bigint, z: number, a1: bigint, b1: number) => number;
2806
2849
  readonly wasmllmconfig_providers: (a: number) => any;
2807
2850
  readonly wasmllmconfig_rateLimit: (a: number) => number;
2808
2851
  readonly wasmllmconfig_set_apiKey: (a: number, b: number, c: number) => void;
@@ -2814,6 +2857,7 @@ export interface InitOutput {
2814
2857
  readonly wasmllmconfig_set_costTracking: (a: number, b: number) => void;
2815
2858
  readonly wasmllmconfig_set_headers: (a: number, b: number) => void;
2816
2859
  readonly wasmllmconfig_set_healthCheckSecs: (a: number, b: number, c: bigint) => void;
2860
+ readonly wasmllmconfig_set_inFlightLimit: (a: number, b: number) => void;
2817
2861
  readonly wasmllmconfig_set_loadEnv: (a: number, b: number) => void;
2818
2862
  readonly wasmllmconfig_set_maxRetries: (a: number, b: number) => void;
2819
2863
  readonly wasmllmconfig_set_model: (a: number, b: number, c: number) => void;
@@ -2821,6 +2865,8 @@ export interface InitOutput {
2821
2865
  readonly wasmllmconfig_set_rateLimit: (a: number, b: number) => void;
2822
2866
  readonly wasmllmconfig_set_tracing: (a: number, b: number) => void;
2823
2867
  readonly wasmllmconfig_tracing: (a: number) => number;
2868
+ readonly wasmllminflightlimitconfig_default: () => number;
2869
+ readonly wasmllminflightlimitconfig_new: (a: number) => number;
2824
2870
  readonly wasmllmproviderconfig_authHeader: (a: number) => [number, number];
2825
2871
  readonly wasmllmproviderconfig_baseUrl: (a: number) => [number, number];
2826
2872
  readonly wasmllmproviderconfig_default: () => number;
@@ -3274,6 +3320,7 @@ export interface InitOutput {
3274
3320
  readonly wasmcreateimagerequest_set_n: (a: number, b: number) => void;
3275
3321
  readonly wasmembeddingrequest_set_dimensions: (a: number, b: number) => void;
3276
3322
  readonly wasmfilelistquery_set_limit: (a: number, b: number) => void;
3323
+ readonly wasmllminflightlimitconfig_set_maxInFlight: (a: number, b: number) => void;
3277
3324
  readonly wasmrerankrequest_set_topN: (a: number, b: number) => void;
3278
3325
  readonly wasmsearchrequest_set_maxResults: (a: number, b: number) => void;
3279
3326
  readonly wasmcatalogrefreshconfig_ttlSeconds: (a: number) => bigint;
@@ -3295,6 +3342,7 @@ export interface InitOutput {
3295
3342
  readonly wasmusage_totalTokens: (a: number) => bigint;
3296
3343
  readonly wasmwaitforbatchconfig_initialIntervalSecs: (a: number) => number;
3297
3344
  readonly wasmwaitforbatchconfig_maxIntervalSecs: (a: number) => number;
3345
+ readonly wasmembeddingcontentpart_new: () => number;
3298
3346
  readonly wasmfunctioncall_default: () => number;
3299
3347
  readonly wasmfunctiondefinition_default: () => number;
3300
3348
  readonly wasmfunctionmessage_default: () => number;
@@ -3316,6 +3364,7 @@ export interface InitOutput {
3316
3364
  readonly wasmchatcompletionresponse_usage: (a: number) => number;
3317
3365
  readonly wasmembeddingresponse_usage: (a: number) => number;
3318
3366
  readonly wasmocrresponse_usage: (a: number) => number;
3367
+ readonly wasmresponsetool_default: () => number;
3319
3368
  readonly wasmocrrequest_set_includeImageBase64: (a: number, b: number) => void;
3320
3369
  readonly wasmassistantpart_new: () => number;
3321
3370
  readonly wasmcontentpart_new: () => number;
@@ -3325,6 +3374,7 @@ export interface InitOutput {
3325
3374
  readonly wasmcreateimagerequest_n: (a: number) => number;
3326
3375
  readonly wasmembeddingrequest_dimensions: (a: number) => number;
3327
3376
  readonly wasmfilelistquery_limit: (a: number) => number;
3377
+ readonly wasmllminflightlimitconfig_maxInFlight: (a: number) => number;
3328
3378
  readonly wasmrerankrequest_topN: (a: number) => number;
3329
3379
  readonly wasmsearchrequest_maxResults: (a: number) => number;
3330
3380
  readonly wasmresponseusage_new: (a: number, b: bigint, c: number, d: bigint, e: number, f: bigint) => number;
@@ -3346,7 +3396,6 @@ export interface InitOutput {
3346
3396
  readonly wasmmodeltier_set_cacheReadInputTokenCost: (a: number, b: number, c: number) => void;
3347
3397
  readonly wasmtranscriptionresponse_set_duration: (a: number, b: number, c: number) => void;
3348
3398
  readonly wasmwaitforbatchconfig_set_timeoutSecs: (a: number, b: number, c: number) => void;
3349
- readonly wasmresponsetool_default: () => number;
3350
3399
  readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
3351
3400
  readonly intounderlyingsource_cancel: (a: number) => void;
3352
3401
  readonly intounderlyingsource_pull: (a: number, b: any) => any;
package/liter_llm_wasm.js CHANGED
@@ -4716,6 +4716,123 @@ export class WasmDocumentContent {
4716
4716
  }
4717
4717
  if (Symbol.dispose) WasmDocumentContent.prototype[Symbol.dispose] = WasmDocumentContent.prototype.free;
4718
4718
 
4719
+ /**
4720
+ * A content part in a multimodal embedding input.
4721
+ */
4722
+ export class WasmEmbeddingContentPart {
4723
+ static __wrap(ptr) {
4724
+ const obj = Object.create(WasmEmbeddingContentPart.prototype);
4725
+ obj.__wbg_ptr = ptr;
4726
+ WasmEmbeddingContentPartFinalization.register(obj, obj.__wbg_ptr, obj);
4727
+ return obj;
4728
+ }
4729
+ __destroy_into_raw() {
4730
+ const ptr = this.__wbg_ptr;
4731
+ this.__wbg_ptr = 0;
4732
+ WasmEmbeddingContentPartFinalization.unregister(this);
4733
+ return ptr;
4734
+ }
4735
+ free() {
4736
+ const ptr = this.__destroy_into_raw();
4737
+ wasm.__wbg_wasmembeddingcontentpart_free(ptr, 0);
4738
+ }
4739
+ /**
4740
+ * @returns {WasmEmbeddingContentPart}
4741
+ */
4742
+ static default() {
4743
+ const ret = wasm.wasmembeddingcontentpart_default();
4744
+ return WasmEmbeddingContentPart.__wrap(ret);
4745
+ }
4746
+ /**
4747
+ * @returns {string | undefined}
4748
+ */
4749
+ get imageBase64() {
4750
+ const ret = wasm.wasmembeddingcontentpart_imageBase64(this.__wbg_ptr);
4751
+ let v1;
4752
+ if (ret[0] !== 0) {
4753
+ v1 = getStringFromWasm0(ret[0], ret[1]);
4754
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
4755
+ }
4756
+ return v1;
4757
+ }
4758
+ /**
4759
+ * @returns {WasmImageUrl | undefined}
4760
+ */
4761
+ get imageUrl() {
4762
+ const ret = wasm.wasmembeddingcontentpart_imageUrl(this.__wbg_ptr);
4763
+ return ret === 0 ? undefined : WasmImageUrl.__wrap(ret);
4764
+ }
4765
+ constructor() {
4766
+ const ret = wasm.wasmembeddingcontentpart_new();
4767
+ this.__wbg_ptr = ret;
4768
+ WasmEmbeddingContentPartFinalization.register(this, this.__wbg_ptr, this);
4769
+ return this;
4770
+ }
4771
+ /**
4772
+ * @param {string | null} [value]
4773
+ */
4774
+ set imageBase64(value) {
4775
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4776
+ var len0 = WASM_VECTOR_LEN;
4777
+ wasm.wasmembeddingcontentpart_set_imageBase64(this.__wbg_ptr, ptr0, len0);
4778
+ }
4779
+ /**
4780
+ * @param {WasmImageUrl | null} [value]
4781
+ */
4782
+ set imageUrl(value) {
4783
+ let ptr0 = 0;
4784
+ if (!isLikeNone(value)) {
4785
+ _assertClass(value, WasmImageUrl);
4786
+ ptr0 = value.__destroy_into_raw();
4787
+ }
4788
+ wasm.wasmembeddingcontentpart_set_imageUrl(this.__wbg_ptr, ptr0);
4789
+ }
4790
+ /**
4791
+ * @param {string | null} [value]
4792
+ */
4793
+ set text(value) {
4794
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4795
+ var len0 = WASM_VECTOR_LEN;
4796
+ wasm.wasmembeddingcontentpart_set_text(this.__wbg_ptr, ptr0, len0);
4797
+ }
4798
+ /**
4799
+ * @param {string} value
4800
+ */
4801
+ set type(value) {
4802
+ const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4803
+ const len0 = WASM_VECTOR_LEN;
4804
+ wasm.wasmembeddingcontentpart_set_type(this.__wbg_ptr, ptr0, len0);
4805
+ }
4806
+ /**
4807
+ * @returns {string | undefined}
4808
+ */
4809
+ get text() {
4810
+ const ret = wasm.wasmembeddingcontentpart_text(this.__wbg_ptr);
4811
+ let v1;
4812
+ if (ret[0] !== 0) {
4813
+ v1 = getStringFromWasm0(ret[0], ret[1]);
4814
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
4815
+ }
4816
+ return v1;
4817
+ }
4818
+ /**
4819
+ * @returns {string}
4820
+ */
4821
+ get type() {
4822
+ let deferred1_0;
4823
+ let deferred1_1;
4824
+ try {
4825
+ const ret = wasm.wasmembeddingcontentpart_type(this.__wbg_ptr);
4826
+ deferred1_0 = ret[0];
4827
+ deferred1_1 = ret[1];
4828
+ return getStringFromWasm0(ret[0], ret[1]);
4829
+ } finally {
4830
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
4831
+ }
4832
+ }
4833
+ }
4834
+ if (Symbol.dispose) WasmEmbeddingContentPart.prototype[Symbol.dispose] = WasmEmbeddingContentPart.prototype.free;
4835
+
4719
4836
  /**
4720
4837
  * The format in which the embedding vectors are returned.
4721
4838
  * @enum {0 | 1}
@@ -6564,6 +6681,13 @@ export class WasmLlmConfig {
6564
6681
  const ret = wasm.wasmllmconfig_healthCheckSecs(this.__wbg_ptr);
6565
6682
  return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
6566
6683
  }
6684
+ /**
6685
+ * @returns {WasmLlmInFlightLimitConfig | undefined}
6686
+ */
6687
+ get inFlightLimit() {
6688
+ const ret = wasm.wasmllmconfig_inFlightLimit(this.__wbg_ptr);
6689
+ return ret === 0 ? undefined : WasmLlmInFlightLimitConfig.__wrap(ret);
6690
+ }
6567
6691
  /**
6568
6692
  * @returns {boolean | undefined}
6569
6693
  */
@@ -6614,13 +6738,14 @@ export class WasmLlmConfig {
6614
6738
  * @param {WasmLlmCacheConfig | null} [cache]
6615
6739
  * @param {WasmLlmBudgetConfig | null} [budget]
6616
6740
  * @param {WasmLlmRateLimitConfig | null} [rateLimit]
6741
+ * @param {WasmLlmInFlightLimitConfig | null} [inFlightLimit]
6617
6742
  * @param {boolean | null} [costTracking]
6618
6743
  * @param {boolean | null} [tracing]
6619
6744
  * @param {bigint | null} [cooldownSecs]
6620
6745
  * @param {bigint | null} [healthCheckSecs]
6621
6746
  * @param {WasmBedrockConfig | null} [bedrock]
6622
6747
  */
6623
- constructor(model, apiKey, baseUrl, timeoutSecs, maxRetries, temperature, maxTokens, loadEnv, headers, providers, cache, budget, rateLimit, costTracking, tracing, cooldownSecs, healthCheckSecs, bedrock) {
6748
+ constructor(model, apiKey, baseUrl, timeoutSecs, maxRetries, temperature, maxTokens, loadEnv, headers, providers, cache, budget, rateLimit, inFlightLimit, costTracking, tracing, cooldownSecs, healthCheckSecs, bedrock) {
6624
6749
  var ptr0 = isLikeNone(model) ? 0 : passStringToWasm0(model, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6625
6750
  var len0 = WASM_VECTOR_LEN;
6626
6751
  var ptr1 = isLikeNone(apiKey) ? 0 : passStringToWasm0(apiKey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -6645,11 +6770,16 @@ export class WasmLlmConfig {
6645
6770
  ptr6 = rateLimit.__destroy_into_raw();
6646
6771
  }
6647
6772
  let ptr7 = 0;
6773
+ if (!isLikeNone(inFlightLimit)) {
6774
+ _assertClass(inFlightLimit, WasmLlmInFlightLimitConfig);
6775
+ ptr7 = inFlightLimit.__destroy_into_raw();
6776
+ }
6777
+ let ptr8 = 0;
6648
6778
  if (!isLikeNone(bedrock)) {
6649
6779
  _assertClass(bedrock, WasmBedrockConfig);
6650
- ptr7 = bedrock.__destroy_into_raw();
6780
+ ptr8 = bedrock.__destroy_into_raw();
6651
6781
  }
6652
- const ret = wasm.wasmllmconfig_new(ptr0, len0, ptr1, len1, ptr2, len2, !isLikeNone(timeoutSecs), isLikeNone(timeoutSecs) ? BigInt(0) : timeoutSecs, isLikeNone(maxRetries) ? Number.MAX_SAFE_INTEGER : (maxRetries) >>> 0, !isLikeNone(temperature), isLikeNone(temperature) ? 0 : temperature, !isLikeNone(maxTokens), isLikeNone(maxTokens) ? BigInt(0) : maxTokens, isLikeNone(loadEnv) ? 0xFFFFFF : loadEnv ? 1 : 0, isLikeNone(headers) ? 0 : addToExternrefTable0(headers), ptr3, len3, ptr4, ptr5, ptr6, isLikeNone(costTracking) ? 0xFFFFFF : costTracking ? 1 : 0, isLikeNone(tracing) ? 0xFFFFFF : tracing ? 1 : 0, !isLikeNone(cooldownSecs), isLikeNone(cooldownSecs) ? BigInt(0) : cooldownSecs, !isLikeNone(healthCheckSecs), isLikeNone(healthCheckSecs) ? BigInt(0) : healthCheckSecs, ptr7);
6782
+ const ret = wasm.wasmllmconfig_new(ptr0, len0, ptr1, len1, ptr2, len2, !isLikeNone(timeoutSecs), isLikeNone(timeoutSecs) ? BigInt(0) : timeoutSecs, isLikeNone(maxRetries) ? Number.MAX_SAFE_INTEGER : (maxRetries) >>> 0, !isLikeNone(temperature), isLikeNone(temperature) ? 0 : temperature, !isLikeNone(maxTokens), isLikeNone(maxTokens) ? BigInt(0) : maxTokens, isLikeNone(loadEnv) ? 0xFFFFFF : loadEnv ? 1 : 0, isLikeNone(headers) ? 0 : addToExternrefTable0(headers), ptr3, len3, ptr4, ptr5, ptr6, ptr7, isLikeNone(costTracking) ? 0xFFFFFF : costTracking ? 1 : 0, isLikeNone(tracing) ? 0xFFFFFF : tracing ? 1 : 0, !isLikeNone(cooldownSecs), isLikeNone(cooldownSecs) ? BigInt(0) : cooldownSecs, !isLikeNone(healthCheckSecs), isLikeNone(healthCheckSecs) ? BigInt(0) : healthCheckSecs, ptr8);
6653
6783
  this.__wbg_ptr = ret;
6654
6784
  WasmLlmConfigFinalization.register(this, this.__wbg_ptr, this);
6655
6785
  return this;
@@ -6741,6 +6871,17 @@ export class WasmLlmConfig {
6741
6871
  set healthCheckSecs(value) {
6742
6872
  wasm.wasmllmconfig_set_healthCheckSecs(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? BigInt(0) : value);
6743
6873
  }
6874
+ /**
6875
+ * @param {WasmLlmInFlightLimitConfig | null} [value]
6876
+ */
6877
+ set inFlightLimit(value) {
6878
+ let ptr0 = 0;
6879
+ if (!isLikeNone(value)) {
6880
+ _assertClass(value, WasmLlmInFlightLimitConfig);
6881
+ ptr0 = value.__destroy_into_raw();
6882
+ }
6883
+ wasm.wasmllmconfig_set_inFlightLimit(this.__wbg_ptr, ptr0);
6884
+ }
6744
6885
  /**
6745
6886
  * @param {boolean | null} [value]
6746
6887
  */
@@ -6828,6 +6969,58 @@ export class WasmLlmConfig {
6828
6969
  }
6829
6970
  if (Symbol.dispose) WasmLlmConfig.prototype[Symbol.dispose] = WasmLlmConfig.prototype.free;
6830
6971
 
6972
+ /**
6973
+ * Global per-client in-flight provider request limit.
6974
+ */
6975
+ export class WasmLlmInFlightLimitConfig {
6976
+ static __wrap(ptr) {
6977
+ const obj = Object.create(WasmLlmInFlightLimitConfig.prototype);
6978
+ obj.__wbg_ptr = ptr;
6979
+ WasmLlmInFlightLimitConfigFinalization.register(obj, obj.__wbg_ptr, obj);
6980
+ return obj;
6981
+ }
6982
+ __destroy_into_raw() {
6983
+ const ptr = this.__wbg_ptr;
6984
+ this.__wbg_ptr = 0;
6985
+ WasmLlmInFlightLimitConfigFinalization.unregister(this);
6986
+ return ptr;
6987
+ }
6988
+ free() {
6989
+ const ptr = this.__destroy_into_raw();
6990
+ wasm.__wbg_wasmllminflightlimitconfig_free(ptr, 0);
6991
+ }
6992
+ /**
6993
+ * @returns {WasmLlmInFlightLimitConfig}
6994
+ */
6995
+ static default() {
6996
+ const ret = wasm.wasmllminflightlimitconfig_default();
6997
+ return WasmLlmInFlightLimitConfig.__wrap(ret);
6998
+ }
6999
+ /**
7000
+ * @returns {number | undefined}
7001
+ */
7002
+ get maxInFlight() {
7003
+ const ret = wasm.wasmllminflightlimitconfig_maxInFlight(this.__wbg_ptr);
7004
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
7005
+ }
7006
+ /**
7007
+ * @param {number | null} [maxInFlight]
7008
+ */
7009
+ constructor(maxInFlight) {
7010
+ const ret = wasm.wasmllminflightlimitconfig_new(isLikeNone(maxInFlight) ? Number.MAX_SAFE_INTEGER : (maxInFlight) >>> 0);
7011
+ this.__wbg_ptr = ret;
7012
+ WasmLlmInFlightLimitConfigFinalization.register(this, this.__wbg_ptr, this);
7013
+ return this;
7014
+ }
7015
+ /**
7016
+ * @param {number | null} [value]
7017
+ */
7018
+ set maxInFlight(value) {
7019
+ wasm.wasmllminflightlimitconfig_set_maxInFlight(this.__wbg_ptr, isLikeNone(value) ? Number.MAX_SAFE_INTEGER : (value) >>> 0);
7020
+ }
7021
+ }
7022
+ if (Symbol.dispose) WasmLlmInFlightLimitConfig.prototype[Symbol.dispose] = WasmLlmInFlightLimitConfig.prototype.free;
7023
+
6831
7024
  /**
6832
7025
  * A custom provider configuration entry.
6833
7026
  */
@@ -13489,22 +13682,22 @@ function __wbg_get_imports() {
13489
13682
  return ret;
13490
13683
  },
13491
13684
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
13492
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 829, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13685
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 839, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13493
13686
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h351c53978edbe772);
13494
13687
  return ret;
13495
13688
  },
13496
13689
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
13497
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 849, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
13690
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 859, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
13498
13691
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__he68dc1d55691411a);
13499
13692
  return ret;
13500
13693
  },
13501
13694
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
13502
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 754, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13695
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 764, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13503
13696
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h6b7304993d07ecd2);
13504
13697
  return ret;
13505
13698
  },
13506
13699
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
13507
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 770, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13700
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 780, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
13508
13701
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h7931059d2e71044d);
13509
13702
  return ret;
13510
13703
  },
@@ -13681,6 +13874,9 @@ const WasmDeveloperMessageFinalization = (typeof FinalizationRegistry === 'undef
13681
13874
  const WasmDocumentContentFinalization = (typeof FinalizationRegistry === 'undefined')
13682
13875
  ? { register: () => {}, unregister: () => {} }
13683
13876
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmdocumentcontent_free(ptr, 1));
13877
+ const WasmEmbeddingContentPartFinalization = (typeof FinalizationRegistry === 'undefined')
13878
+ ? { register: () => {}, unregister: () => {} }
13879
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmembeddingcontentpart_free(ptr, 1));
13684
13880
  const WasmEmbeddingObjectFinalization = (typeof FinalizationRegistry === 'undefined')
13685
13881
  ? { register: () => {}, unregister: () => {} }
13686
13882
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmembeddingobject_free(ptr, 1));
@@ -13732,6 +13928,9 @@ const WasmLlmCacheConfigFinalization = (typeof FinalizationRegistry === 'undefin
13732
13928
  const WasmLlmConfigFinalization = (typeof FinalizationRegistry === 'undefined')
13733
13929
  ? { register: () => {}, unregister: () => {} }
13734
13930
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmllmconfig_free(ptr, 1));
13931
+ const WasmLlmInFlightLimitConfigFinalization = (typeof FinalizationRegistry === 'undefined')
13932
+ ? { register: () => {}, unregister: () => {} }
13933
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmllminflightlimitconfig_free(ptr, 1));
13735
13934
  const WasmLlmProviderConfigFinalization = (typeof FinalizationRegistry === 'undefined')
13736
13935
  ? { register: () => {}, unregister: () => {} }
13737
13936
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmllmproviderconfig_free(ptr, 1));
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@xberg-io/liter-llm-wasm",
3
3
  "type": "module",
4
4
  "description": "Universal LLM API client with Rust-powered polyglot bindings.",
5
- "version": "1.17.3",
5
+ "version": "1.18.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",