refactor: implement custom endpoints configuration and streamline endpoint loading logic

This commit is contained in:
Danny Avila 2025-08-18 16:58:05 -04:00
parent 240e3bd59e
commit 5eef6ea9e8
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
12 changed files with 100 additions and 88 deletions

View file

@ -4,11 +4,11 @@ const { config } = require('./EndpointService');
/**
* Load async endpoints and return a configuration object
* @param {Express.Request} req - The request object
* @param {AppConfig} appConfig - The app configuration object
* @returns {Promise<Object.<string, EndpointWithOrder>>} An object whose keys are endpoint names and values are objects that contain the endpoint configuration and an order.
*/
async function loadDefaultEndpointsConfig(req) {
const { google, gptPlugins } = await loadAsyncEndpoints(req);
async function loadDefaultEndpointsConfig(appConfig) {
const { google, gptPlugins } = await loadAsyncEndpoints(appConfig);
const { assistants, azureAssistants, azureOpenAI, chatGPTBrowser } = config;
const enabledEndpoints = getEnabledEndpoints();