mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +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>()
|
const urlSet = new Set<string>()
|
||||||
return formattedCitations
|
return formattedCitations
|
||||||
.filter((citation) => {
|
.filter((citation) => {
|
||||||
|
if (citation.type === 'knowledge') return true
|
||||||
if (!citation.url || urlSet.has(citation.url)) return false
|
if (!citation.url || urlSet.has(citation.url)) return false
|
||||||
urlSet.add(citation.url)
|
urlSet.add(citation.url)
|
||||||
return true
|
return true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user