mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 11:20:07 +08:00
fix: improve citation deduplication logic for non-knowledge citations (#5981)
This commit is contained in:
parent
e9afab7725
commit
0d38fabfac
@ -236,10 +236,11 @@ const formatCitationsFromBlock = (block: CitationMessageBlock | undefined): Cita
|
||||
})
|
||||
)
|
||||
}
|
||||
// 4. Deduplicate by URL and Renumber Sequentially
|
||||
// 4. Deduplicate non-knowledge citations by URL and Renumber Sequentially
|
||||
const urlSet = new Set<string>()
|
||||
return formattedCitations
|
||||
.filter((citation) => {
|
||||
if (citation.type === 'knowledge') return true
|
||||
if (!citation.url || urlSet.has(citation.url)) return false
|
||||
urlSet.add(citation.url)
|
||||
return true
|
||||
|
||||
Loading…
Reference in New Issue
Block a user