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
|
|
@ -15,8 +15,8 @@ async function loadConfigEndpoints(req) {
|
|||
|
||||
const endpointsConfig = {};
|
||||
|
||||
if (Array.isArray(appConfig[EModelEndpoint.custom])) {
|
||||
const customEndpoints = appConfig[EModelEndpoint.custom].filter(
|
||||
if (Array.isArray(appConfig.endpoints?.[EModelEndpoint.custom])) {
|
||||
const customEndpoints = appConfig.endpoints[EModelEndpoint.custom].filter(
|
||||
(endpoint) =>
|
||||
endpoint.baseURL &&
|
||||
endpoint.apiKey &&
|
||||
|
|
@ -51,14 +51,14 @@ async function loadConfigEndpoints(req) {
|
|||
}
|
||||
}
|
||||
|
||||
if (appConfig[EModelEndpoint.azureOpenAI]) {
|
||||
if (appConfig.endpoints?.[EModelEndpoint.azureOpenAI]) {
|
||||
/** @type {Omit<TConfig, 'order'>} */
|
||||
endpointsConfig[EModelEndpoint.azureOpenAI] = {
|
||||
userProvide: false,
|
||||
};
|
||||
}
|
||||
|
||||
if (appConfig[EModelEndpoint.azureOpenAI]?.assistants) {
|
||||
if (appConfig.endpoints?.[EModelEndpoint.azureOpenAI]?.assistants) {
|
||||
/** @type {Omit<TConfig, 'order'>} */
|
||||
endpointsConfig[EModelEndpoint.azureAssistants] = {
|
||||
userProvide: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue