hammer-ai 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { encoding_for_model } from 'tiktoken';
1
+ import { encodingForModel } from 'js-tiktoken';
2
2
  import { z } from 'zod';
3
3
  import { setup, assign, createActor } from 'xstate';
4
4
 
@@ -24,10 +24,10 @@ var init_tiktoken_estimator = __esm({
24
24
  encoder;
25
25
  constructor() {
26
26
  try {
27
- this.encoder = encoding_for_model("gpt-4");
27
+ this.encoder = encodingForModel("gpt-4");
28
28
  } catch (err) {
29
29
  throw new Error(
30
- `Failed to initialize tiktoken encoder (WASM may not be available in this environment): ${err instanceof Error ? err.message : err}`
30
+ `Failed to initialize tiktoken encoder: ${err instanceof Error ? err.message : err}`
31
31
  );
32
32
  }
33
33
  }
@@ -36,10 +36,7 @@ var init_tiktoken_estimator = __esm({
36
36
  return this.encoder.encode(text).length;
37
37
  }
38
38
  dispose() {
39
- if (this.encoder) {
40
- this.encoder.free();
41
- this.encoder = null;
42
- }
39
+ this.encoder = null;
43
40
  }
44
41
  };
45
42
  }