Kaynağa Gözat

fix: incorrect score in the chroma vector (#14273)

tags/1.0.0
Rhys 8 ay önce
ebeveyn
işleme
548f6ef2b6
No account linked to committer's email address

+ 3
- 2
api/core/rag/datasource/vdb/chroma/chroma_vector.py Dosyayı Görüntüle

@@ -111,8 +111,9 @@ class ChromaVector(BaseVector):
for index in range(len(ids)):
distance = distances[index]
metadata = dict(metadatas[index])
if distance >= score_threshold:
metadata["score"] = distance
score = 1 - distance
if score > score_threshold:
metadata["score"] = score
doc = Document(
page_content=documents[index],
metadata=metadata,

Loading…
İptal
Kaydet