mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-24 03:06:12 +01:00
feat: cites text with links
This commit is contained in:
parent
5e57deab5f
commit
a451574760
6 changed files with 31 additions and 25 deletions
|
|
@ -5,7 +5,7 @@ const getCitations = (res) => {
|
|||
const textBlocks = res.details.adaptiveCards[0].body;
|
||||
if (!textBlocks) return '';
|
||||
let links = textBlocks[textBlocks.length - 1]?.text.match(regex);
|
||||
if (links?.length === 0) return '';
|
||||
if (links?.length === 0 || !links) return '';
|
||||
links = links.map((link) => '- ' + link.trim());
|
||||
return 'Learn more:\n' + links.join('\n');
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue