浏览代码

Merge pull request #6907 from clang88/patch-1

Update calculatePercentage CitationsModal.svelte (high percentage for high relevance)
Timothy Jaeryang Baek 5 月之前
父节点
当前提交
4174738b1c
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/lib/components/chat/Messages/CitationsModal.svelte

+ 3 - 3
src/lib/components/chat/Messages/CitationsModal.svelte

@@ -13,9 +13,9 @@
 	let mergedDocuments = [];
 
 	function calculatePercentage(distance: number) {
-		if (distance < 0) return 100;
-		if (distance > 1) return 0;
-		return Math.round((1 - distance) * 10000) / 100;
+		if (distance < 0) return 0;
+		if (distance > 1) return 100;
+		return Math.round(distance * 10000) / 100;
 	}
 
 	function getRelevanceColor(percentage: number) {