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:
parent
1e96acab9d
commit
f910609825
@ -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;
|
||||
|
||||
@ -80,6 +80,7 @@ const QDrant = {
|
||||
result.sourceDocuments.push({
|
||||
...(response?.payload || {}),
|
||||
id: response.id,
|
||||
score: response.score,
|
||||
});
|
||||
result.scores.push(response.score);
|
||||
});
|
||||
|
||||
@ -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);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user