gpt-tokens
Advanced tools
Comparing version 1.3.7 to 1.3.8
@@ -0,3 +1,3 @@ | ||
import { Tiktoken } from 'js-tiktoken'; | ||
import { TokenPrice } from './tokenPrice'; | ||
import type { Tiktoken } from 'js-tiktoken'; | ||
import type { supportModelType } from './pricing'; | ||
@@ -4,0 +4,0 @@ export type { supportModelType }; |
@@ -12,3 +12,10 @@ "use strict"; | ||
try { | ||
modelEncodingCache[model] = (0, js_tiktoken_1.encodingForModel)(model); | ||
let jsTikTokenSupportModel; | ||
if (model === 'gpt-4o-mini' || model === 'gpt-4o-mini-2024-07-18') { | ||
jsTikTokenSupportModel = 'gpt-4o'; | ||
} | ||
else { | ||
jsTikTokenSupportModel = model; | ||
} | ||
modelEncodingCache[model] = (0, js_tiktoken_1.encodingForModel)(jsTikTokenSupportModel); | ||
} | ||
@@ -15,0 +22,0 @@ catch (e) { |
{ | ||
"name": "gpt-tokens", | ||
"version": "1.3.7", | ||
"version": "1.3.8", | ||
"description": "Calculate the token consumption and amount of openai gpt message", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21612
398