@goliapkg/tiktoken-wasm 3.2.3 → 3.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@goliapkg/tiktoken-wasm",
3
3
  "type": "module",
4
4
  "description": "WASM bindings for the tiktoken BPE tokenizer",
5
- "version": "3.2.3",
5
+ "version": "3.2.4",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -11,13 +11,11 @@
11
11
  "files": [
12
12
  "tiktoken_wasm_bg.wasm",
13
13
  "tiktoken_wasm.js",
14
- "tiktoken_wasm_bg.js",
15
14
  "tiktoken_wasm.d.ts"
16
15
  ],
17
16
  "main": "tiktoken_wasm.js",
18
17
  "types": "tiktoken_wasm.d.ts",
19
18
  "sideEffects": [
20
- "./tiktoken_wasm.js",
21
19
  "./snippets/*"
22
20
  ]
23
21
  }
@@ -147,3 +147,60 @@ export function modelToEncoding(model: string): string | undefined;
147
147
  * Returns an empty array for unknown providers.
148
148
  */
149
149
  export function modelsByProvider(provider: string): ModelInfo[];
150
+
151
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
152
+
153
+ export interface InitOutput {
154
+ readonly memory: WebAssembly.Memory;
155
+ readonly __wbg_encoding_free: (a: number, b: number) => void;
156
+ readonly __wbg_modelinfo_free: (a: number, b: number) => void;
157
+ readonly allModels: (a: number) => void;
158
+ readonly encodingForModel: (a: number, b: number, c: number) => void;
159
+ readonly encoding_count: (a: number, b: number, c: number) => number;
160
+ readonly encoding_countWithSpecialTokens: (a: number, b: number, c: number) => number;
161
+ readonly encoding_decode: (a: number, b: number, c: number, d: number) => void;
162
+ readonly encoding_encode: (a: number, b: number, c: number, d: number) => void;
163
+ readonly encoding_encodeWithSpecialTokens: (a: number, b: number, c: number, d: number) => void;
164
+ readonly encoding_name: (a: number, b: number) => void;
165
+ readonly encoding_numSpecialTokens: (a: number) => number;
166
+ readonly encoding_vocabSize: (a: number) => number;
167
+ readonly estimateCost: (a: number, b: number, c: number, d: number, e: number) => void;
168
+ readonly getEncoding: (a: number, b: number, c: number) => void;
169
+ readonly getModelInfo: (a: number, b: number, c: number) => void;
170
+ readonly listEncodings: (a: number) => void;
171
+ readonly modelToEncoding: (a: number, b: number, c: number) => void;
172
+ readonly modelinfo_cachedInputPer1m: (a: number, b: number) => void;
173
+ readonly modelinfo_contextWindow: (a: number) => number;
174
+ readonly modelinfo_id: (a: number, b: number) => void;
175
+ readonly modelinfo_inputPer1m: (a: number) => number;
176
+ readonly modelinfo_maxOutput: (a: number) => number;
177
+ readonly modelinfo_outputPer1m: (a: number) => number;
178
+ readonly modelinfo_provider: (a: number, b: number) => void;
179
+ readonly modelsByProvider: (a: number, b: number, c: number) => void;
180
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
181
+ readonly __wbindgen_export: (a: number, b: number, c: number) => void;
182
+ readonly __wbindgen_export2: (a: number, b: number) => number;
183
+ readonly __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
184
+ }
185
+
186
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
187
+
188
+ /**
189
+ * Instantiates the given `module`, which can either be bytes or
190
+ * a precompiled `WebAssembly.Module`.
191
+ *
192
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
193
+ *
194
+ * @returns {InitOutput}
195
+ */
196
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
197
+
198
+ /**
199
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
200
+ * for everything else, calls `WebAssembly.instantiate` directly.
201
+ *
202
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
203
+ *
204
+ * @returns {Promise<InitOutput>}
205
+ */
206
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;