mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
refactor: update appConfig access to use endpoints structure across various services
This commit is contained in:
parent
89fb9c7e1c
commit
240e3bd59e
36 changed files with 591 additions and 510 deletions
|
|
@ -464,7 +464,9 @@ class AgentClient extends BaseClient {
|
|||
|
||||
/** @type {Agent} */
|
||||
let prelimAgent;
|
||||
const allowedProviders = new Set(appConfig?.[EModelEndpoint.agents]?.allowedProviders);
|
||||
const allowedProviders = new Set(
|
||||
appConfig?.endpoints?.[EModelEndpoint.agents]?.allowedProviders,
|
||||
);
|
||||
try {
|
||||
if (memoryConfig.agent?.id != null && memoryConfig.agent.id !== this.options.agent.id) {
|
||||
prelimAgent = await loadAgent({
|
||||
|
|
@ -770,8 +772,8 @@ class AgentClient extends BaseClient {
|
|||
}
|
||||
|
||||
const appConfig = await getAppConfig({ role: this.options.req.user?.role });
|
||||
/** @type {TCustomConfig['endpoints']['agents']} */
|
||||
const agentsEConfig = appConfig[EModelEndpoint.agents];
|
||||
/** @type {AppConfig['endpoints']['agents']} */
|
||||
const agentsEConfig = appConfig.endpoints?.[EModelEndpoint.agents];
|
||||
|
||||
config = {
|
||||
configurable: {
|
||||
|
|
@ -1104,7 +1106,9 @@ class AgentClient extends BaseClient {
|
|||
|
||||
/** @type {TEndpoint | undefined} */
|
||||
const endpointConfig =
|
||||
appConfig.all ?? appConfig[endpoint] ?? titleProviderConfig.customEndpointConfig;
|
||||
appConfig.endpoints?.all ??
|
||||
appConfig.endpoints?.[endpoint] ??
|
||||
titleProviderConfig.customEndpointConfig;
|
||||
if (!endpointConfig) {
|
||||
logger.warn(
|
||||
'[api/server/controllers/agents/client.js #titleConvo] Error getting endpoint config',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue