refactor: Consolidate imports from librechat-data-provider in tokens files

This commit is contained in:
Marco Beretta 2025-12-15 16:53:23 +01:00
parent 2c86a5dcc7
commit 0452594b00
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
3 changed files with 3 additions and 26 deletions

View file

@ -1,5 +1,4 @@
const { maxTokensMap } = require('@librechat/api');
const { EModelEndpoint } = require('librechat-data-provider');
const { EModelEndpoint, maxTokensMap } = require('librechat-data-provider');
const {
defaultRate,
tokenValues,

View file

@ -1,10 +1,8 @@
const { EModelEndpoint } = require('librechat-data-provider');
const { EModelEndpoint, maxTokensMap, maxOutputTokensMap } = require('librechat-data-provider');
const {
maxTokensMap,
matchModelName,
processModelData,
getModelMaxTokens,
maxOutputTokensMap,
findMatchingPattern,
} = require('@librechat/api');

View file

@ -1,27 +1,7 @@
import z from 'zod';
import {
EModelEndpoint,
maxTokensMap,
maxOutputTokensMap,
TOKEN_DEFAULTS,
findMatchingPattern as findMatchingPatternSimple,
getModelMaxTokens as getModelMaxTokensSimple,
getModelMaxOutputTokens as getModelMaxOutputTokensSimple,
matchModelName as matchModelNameSimple,
} from 'librechat-data-provider';
import { EModelEndpoint, maxTokensMap, maxOutputTokensMap } from 'librechat-data-provider';
import type { EndpointTokenConfig, TokenConfig } from '~/types';
// Re-export from data-provider for backwards compatibility
export { maxTokensMap, maxOutputTokensMap, TOKEN_DEFAULTS };
// Re-export simple versions (for use without EndpointTokenConfig)
export {
findMatchingPatternSimple,
getModelMaxTokensSimple,
getModelMaxOutputTokensSimple,
matchModelNameSimple,
};
/**
* Finds the first matching pattern in the tokens map.
* @param {string} modelName