mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-21 21:50:49 +02:00

* fix: agent modelSpec iconURLs not being recorded * fix: prioritize message properties over conversation defaults in icon data * fix: determine endpoint type from endpointsConfig * chore: type issue with setting.columnSpan * chore: remove redundant key indexing for keySchema * chore: bump version to 0.7.691 in package.json * chore: add stricter remark-gfm and mdast-util-gfm resolutions/overrides * chore: remove rollup override and bump vite-plugin-pwa * chore: reinstall remark-gfm for correct module resolution * chore: reinstall vite-plugun-pwa
37 lines
760 B
JavaScript
37 lines
760 B
JavaScript
const { loadAgent } = require('~/models/Agent');
|
|
const { logger } = require('~/config');
|
|
|
|
const buildOptions = (req, endpoint, parsedBody) => {
|
|
const {
|
|
spec,
|
|
iconURL,
|
|
agent_id,
|
|
instructions,
|
|
maxContextTokens,
|
|
resendFiles = true,
|
|
...model_parameters
|
|
} = parsedBody;
|
|
const agentPromise = loadAgent({
|
|
req,
|
|
agent_id,
|
|
}).catch((error) => {
|
|
logger.error(`[/agents/:${agent_id}] Error retrieving agent during build options step`, error);
|
|
return undefined;
|
|
});
|
|
|
|
const endpointOption = {
|
|
spec,
|
|
iconURL,
|
|
endpoint,
|
|
agent_id,
|
|
resendFiles,
|
|
instructions,
|
|
maxContextTokens,
|
|
model_parameters,
|
|
agent: agentPromise,
|
|
};
|
|
|
|
return endpointOption;
|
|
};
|
|
|
|
module.exports = { buildOptions };
|