mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🤖 feat: Add Agents librechat.yaml Configuration (#4953)
* feat: CONFIG_VERSION v1.1.9, agents config * refactor: Assistants Code Interpreter Toggle Improved Accessibility * feat: Agents Config
This commit is contained in:
parent
51e016ef2c
commit
e82af236bc
13 changed files with 65 additions and 48 deletions
|
|
@ -27,6 +27,15 @@ async function endpointController(req, res) {
|
|||
capabilities,
|
||||
};
|
||||
}
|
||||
if (mergedConfig[EModelEndpoint.agents] && req.app.locals?.[EModelEndpoint.agents]) {
|
||||
const { disableBuilder, capabilities, ..._rest } = req.app.locals[EModelEndpoint.agents];
|
||||
|
||||
mergedConfig[EModelEndpoint.agents] = {
|
||||
...mergedConfig[EModelEndpoint.agents],
|
||||
disableBuilder,
|
||||
capabilities,
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
mergedConfig[EModelEndpoint.azureAssistants] &&
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const handleRateLimits = require('./Config/handleRateLimits');
|
|||
const { loadDefaultInterface } = require('./start/interface');
|
||||
const { azureConfigSetup } = require('./start/azureOpenAI');
|
||||
const { loadAndFormatTools } = require('./ToolService');
|
||||
const { agentsConfigSetup } = require('./start/agents');
|
||||
const { initializeRoles } = require('~/models/Role');
|
||||
const paths = require('~/config/paths');
|
||||
|
||||
|
|
@ -94,6 +95,10 @@ const AppService = async (app) => {
|
|||
);
|
||||
}
|
||||
|
||||
if (endpoints?.[EModelEndpoint.agents]) {
|
||||
endpointLocals[EModelEndpoint.agents] = agentsConfigSetup(config);
|
||||
}
|
||||
|
||||
const endpointKeys = [
|
||||
EModelEndpoint.openAI,
|
||||
EModelEndpoint.google,
|
||||
|
|
|
|||
14
api/server/services/start/agents.js
Normal file
14
api/server/services/start/agents.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const { EModelEndpoint, agentsEndpointSChema } = require('librechat-data-provider');
|
||||
|
||||
/**
|
||||
* Sets up the Agents configuration from the config (`librechat.yaml`) file.
|
||||
* @param {TCustomConfig} config - The loaded custom configuration.
|
||||
* @returns {Partial<TAgentsEndpoint>} The Agents endpoint configuration.
|
||||
*/
|
||||
function agentsConfigSetup(config) {
|
||||
const agentsConfig = config.endpoints[EModelEndpoint.agents];
|
||||
const parsedConfig = agentsEndpointSChema.parse(agentsConfig);
|
||||
return parsedConfig;
|
||||
}
|
||||
|
||||
module.exports = { agentsConfigSetup };
|
||||
|
|
@ -819,11 +819,17 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @exports TAssistantEndpoint
|
||||
* @exports TAgentsEndpoint
|
||||
* @typedef {import('librechat-data-provider').TAssistantEndpoint} TAssistantEndpoint
|
||||
* @memberof typedefs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @exports TAgentsEndpoint
|
||||
* @typedef {import('librechat-data-provider').TAgentsEndpoint} TAgentsEndpoint
|
||||
* @memberof typedefs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @exports Agent
|
||||
* @typedef {import('librechat-data-provider').Agent} Agent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue