mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* chore: remove all bing code * chore: remove bing code and auto-focus effects * chore: add back escapeRegExp helper function for regex special character handling * chore: remove deprecated fields from settings and conversation schema * fix: ensure default endpoint is set correctly in conversation setup * feat: add disableFocus option to newConversation for improved search behavior
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
const { EModelEndpoint } = require('librechat-data-provider');
|
|
const { useAzurePlugins } = require('~/server/services/Config/EndpointService').config;
|
|
const {
|
|
getOpenAIModels,
|
|
getGoogleModels,
|
|
getBedrockModels,
|
|
getAnthropicModels,
|
|
getChatGPTBrowserModels,
|
|
} = require('~/server/services/ModelService');
|
|
|
|
/**
|
|
* Loads the default models for the application.
|
|
* @async
|
|
* @function
|
|
* @param {Express.Request} req - The Express request object.
|
|
*/
|
|
async function loadDefaultModels(req) {
|
|
const google = getGoogleModels();
|
|
const openAI = await getOpenAIModels({ user: req.user.id });
|
|
const anthropic = getAnthropicModels();
|
|
const chatGPTBrowser = getChatGPTBrowserModels();
|
|
const azureOpenAI = await getOpenAIModels({ user: req.user.id, azure: true });
|
|
const gptPlugins = await getOpenAIModels({
|
|
user: req.user.id,
|
|
azure: useAzurePlugins,
|
|
plugins: true,
|
|
});
|
|
const assistants = await getOpenAIModels({ assistants: true });
|
|
const azureAssistants = await getOpenAIModels({ azureAssistants: true });
|
|
|
|
return {
|
|
[EModelEndpoint.openAI]: openAI,
|
|
[EModelEndpoint.agents]: openAI,
|
|
[EModelEndpoint.google]: google,
|
|
[EModelEndpoint.anthropic]: anthropic,
|
|
[EModelEndpoint.gptPlugins]: gptPlugins,
|
|
[EModelEndpoint.azureOpenAI]: azureOpenAI,
|
|
[EModelEndpoint.chatGPTBrowser]: chatGPTBrowser,
|
|
[EModelEndpoint.assistants]: assistants,
|
|
[EModelEndpoint.azureAssistants]: azureAssistants,
|
|
[EModelEndpoint.bedrock]: getBedrockModels(),
|
|
};
|
|
}
|
|
|
|
module.exports = loadDefaultModels;
|