chore: review update with score_threshold

This commit is contained in:
Anush008 2024-10-23 00:54:47 +05:30
parent d1bef44e2b
commit bc27046f36
No known key found for this signature in database
6 changed files with 24 additions and 13 deletions

View file

@ -91,7 +91,9 @@ class PGVectorIndex(EmbeddingIndex):
)
execute_values(self.cursor, query, values, template="(%s, %s, %s::vector)")
async def query(self, embedding: NDArray, k: int) -> QueryDocumentsResponse:
async def query(
self, embedding: NDArray, k: int, score_threshold: float
) -> QueryDocumentsResponse:
self.cursor.execute(
f"""
SELECT document, embedding <-> %s::vector AS distance