feat: includes sources

This commit is contained in:
Daniel Avila 2023-03-09 18:42:36 -05:00
parent a451574760
commit 30936573ac
6 changed files with 49 additions and 9 deletions

View file

@ -6,8 +6,8 @@ const getCitations = (res) => {
if (!textBlocks) return '';
let links = textBlocks[textBlocks.length - 1]?.text.match(regex);
if (links?.length === 0 || !links) return '';
links = links.map((link) => '- ' + link.trim());
return 'Learn more:\n' + links.join('\n');
links = links.map((link) => link.trim());
return links.join('\n');
};
module.exports = getCitations;