[Feature] Return score when doing search in vectorDB (#1060)

Co-authored-by: Deven Patel <deven298@yahoo.com>
This commit is contained in:
Deven Patel
2023-12-29 15:56:12 +05:30
committed by GitHub
parent 19d80914df
commit c0aafd38c9
12 changed files with 72 additions and 28 deletions

View File

@@ -342,8 +342,22 @@ def test_chroma_db_collection_query(app_with_settings):
input_query=[0, 0, 0], where={}, n_results=2, skip_embedding=True, citations=True
)
expected_value_with_citations = [
("document", {"url": "url_1", "doc_id": "doc_id_1"}),
("document2", {"url": "url_2", "doc_id": "doc_id_2"}),
(
"document",
{
"url": "url_1",
"doc_id": "doc_id_1",
"score": 0.0,
},
),
(
"document2",
{
"url": "url_2",
"doc_id": "doc_id_2",
"score": 1.0,
},
),
]
assert data_with_citations == expected_value_with_citations