mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
WIP: app.locals refactoring
WIP: appConfig fix: update memory configuration retrieval to use getAppConfig based on user role fix: update comment for AppConfig interface to clarify purpose
This commit is contained in:
parent
5a14ee9c6a
commit
b992fed16c
66 changed files with 706 additions and 366 deletions
|
|
@ -24,11 +24,11 @@ const { FileContext } = require('librechat-data-provider');
|
|||
* { isAvatar: true }
|
||||
* ) // Returns 'local'
|
||||
*/
|
||||
function getFileStrategy(appLocals, { isAvatar = false, isImage = false, context = null } = {}) {
|
||||
// Handle both old (config object) and new (app.locals object) calling patterns
|
||||
const isAppLocals = appLocals.fileStrategy !== undefined;
|
||||
const config = isAppLocals ? appLocals.config : appLocals;
|
||||
const fileStrategy = isAppLocals ? appLocals.fileStrategy : appLocals.fileStrategy;
|
||||
function getFileStrategy(appConfig, { isAvatar = false, isImage = false, context = null } = {}) {
|
||||
// Handle both old (config object) and new (`appConfig` object) calling patterns
|
||||
const isAppConfig = appConfig.fileStrategy !== undefined;
|
||||
const config = isAppConfig ? appConfig.config : appConfig;
|
||||
const fileStrategy = isAppConfig ? appConfig.fileStrategy : appConfig.fileStrategy;
|
||||
|
||||
// Fallback to legacy single strategy if no granular config
|
||||
if (!config?.fileStrategies) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue