Skip to content

Commit

Permalink
add citations
Browse files Browse the repository at this point in the history
  • Loading branch information
vietanhlehuu committed Nov 11, 2024
1 parent f395280 commit 0e45a98
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function search_via_perplexity(params, userSettings) {
})
.then((r) => r.json())
.then((response) => {
return response.choices.map((c) => c.message.content).join(' ');
const content = response.choices.map((c) => c.message.content).join(' ');
const citations = response.citations;

return (
content + (citations ? '\n\n Citations:' + citations.join('\n') : '')
);
});
}

0 comments on commit 0e45a98

Please sign in to comment.