Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gpt-tokens

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpt-tokens - npm Package Compare versions

Comparing version 1.3.7 to 1.3.8

2

dist/index.d.ts

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc