mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00

* feat: send the LibreChat user ID as a query param when fetching the list of models * chore: update bun * chore: change bun command for building data-provider * refactor: prefer use of `getCustomConfig` to access custom config, also move to `server/services/Config` * refactor: make endpoints/custom option for the config optional, add userIdQuery, and use modelQueries log store in ModelService * refactor(ModelService): use env variables at runtime, use default models from data-provider, and add tests * docs: add `userIdQuery` * fix(ci): import changed
25 lines
621 B
JavaScript
25 lines
621 B
JavaScript
const { CacheKeys } = require('librechat-data-provider');
|
|
const loadCustomConfig = require('./loadCustomConfig');
|
|
const getLogStores = require('~/cache/getLogStores');
|
|
|
|
/**
|
|
* Retrieves the configuration object
|
|
* @function getCustomConfig
|
|
* @returns {Promise<TCustomConfig | null>}
|
|
* */
|
|
async function getCustomConfig() {
|
|
const cache = getLogStores(CacheKeys.CONFIG_STORE);
|
|
let customConfig = await cache.get(CacheKeys.CUSTOM_CONFIG);
|
|
|
|
if (!customConfig) {
|
|
customConfig = await loadCustomConfig();
|
|
}
|
|
|
|
if (!customConfig) {
|
|
return null;
|
|
}
|
|
|
|
return customConfig;
|
|
}
|
|
|
|
module.exports = getCustomConfig;
|