@goliapkg/tiktoken-wasm 4.0.1 → 4.1.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/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": "4.0.1",
5
+ "version": "4.1.1",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -124,6 +124,11 @@ export function getEncoding(name: string): Encoding;
124
124
  * Returns a typed object with: `id`, `provider`, `inputPer1m`, `outputPer1m`,
125
125
  * `cachedInputPer1m`, `contextWindow`, `maxOutput`.
126
126
  *
127
+ * The id is resolved the same way `estimateCost` resolves it, so a model
128
+ * addressed the way its API spells it (`claude-haiku-4-5`,
129
+ * `anthropic.claude-opus-5`) returns that model's entry. The returned `id` is
130
+ * the table's own spelling.
131
+ *
127
132
  * Throws `Error` for unknown model ids.
128
133
  */
129
134
  export function getModelInfo(model_id: string): ModelInfo;
@@ -145,7 +150,8 @@ export function modelToEncoding(model: string): string | undefined;
145
150
  /**
146
151
  * List models filtered by provider name.
147
152
  *
148
- * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`.
153
+ * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`,
154
+ * `"Alibaba"`, `"Mistral"`, `"Moonshot"`, `"Zhipu"`, `"MiniMax"`, `"Voyage"`.
149
155
  * Returns an empty array for unknown providers.
150
156
  */
151
157
  export function modelsByProvider(provider: string): ModelInfo[];
package/tiktoken_wasm.js CHANGED
@@ -382,6 +382,11 @@ export function getEncoding(name) {
382
382
  * Returns a typed object with: `id`, `provider`, `inputPer1m`, `outputPer1m`,
383
383
  * `cachedInputPer1m`, `contextWindow`, `maxOutput`.
384
384
  *
385
+ * The id is resolved the same way `estimateCost` resolves it, so a model
386
+ * addressed the way its API spells it (`claude-haiku-4-5`,
387
+ * `anthropic.claude-opus-5`) returns that model's entry. The returned `id` is
388
+ * the table's own spelling.
389
+ *
385
390
  * Throws `Error` for unknown model ids.
386
391
  * @param {string} model_id
387
392
  * @returns {ModelInfo}
@@ -453,7 +458,8 @@ export function modelToEncoding(model) {
453
458
  /**
454
459
  * List models filtered by provider name.
455
460
  *
456
- * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`.
461
+ * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`,
462
+ * `"Alibaba"`, `"Mistral"`, `"Moonshot"`, `"Zhipu"`, `"MiniMax"`, `"Voyage"`.
457
463
  * Returns an empty array for unknown providers.
458
464
  * @param {string} provider
459
465
  * @returns {ModelInfo[]}
Binary file