LibreChat / api /app /clients /agents /Functions /addToolDescriptions.js
N.Achyuth Reddy
Upload 683 files
9705b6c
raw
history blame contribute delete
429 Bytes
const addToolDescriptions = (prefix, tools) => {
const text = tools.reduce((acc, tool) => {
const { name, description_for_model, lc_kwargs } = tool;
const description = description_for_model ?? lc_kwargs?.description_for_model;
if (!description) {
return acc;
}
return acc + `## ${name}\n${description}\n`;
}, '# Tools:\n');
return `${prefix}\n${text}`;
};
module.exports = addToolDescriptions;