Fix similarity score not showing in citation UI for Astra, Qdrant, Weaviate (#4718)

* fix astra not showing similarity score in citations ui

* fix qdrant not showing similarity score in citations ui

* fix weaviate not showing similarity score in citations ui
This commit is contained in:
Sean Hatfield 2025-12-05 13:05:43 -08:00 committed by GitHub
parent 1e96acab9d
commit f910609825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -373,7 +373,10 @@ const AstraDB = {
return;
}
result.contextTexts.push(response.metadata.text);
result.sourceDocuments.push(response);
result.sourceDocuments.push({
...response.metadata,
score: response.$similarity,
});
result.scores.push(response.$similarity);
});
return result;

View File

@ -80,6 +80,7 @@ const QDrant = {
result.sourceDocuments.push({
...(response?.payload || {}),
id: response.id,
score: response.score,
});
result.scores.push(response.score);
});

View File

@ -115,7 +115,7 @@ const Weaviate = {
return;
}
result.contextTexts.push(rest.text);
result.sourceDocuments.push({ ...rest, id });
result.sourceDocuments.push({ ...rest, id, score: certainty });
result.scores.push(certainty);
});