File size: 429 Bytes
9705b6c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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;
|