Spaces:
Sleeping
Sleeping
Léo Bourrel
commited on
Commit
·
5a5c81b
1
Parent(s):
fc40941
feat: remove fllter argument never used
Browse files- custom_pgvector.py +3 -7
custom_pgvector.py
CHANGED
@@ -292,7 +292,6 @@ class CustomPGVector(VectorStore):
|
|
292 |
return self.similarity_search_by_vector(
|
293 |
embedding=embedding,
|
294 |
k=k,
|
295 |
-
filter=filter,
|
296 |
)
|
297 |
|
298 |
def similarity_search_with_score(
|
@@ -313,7 +312,7 @@ class CustomPGVector(VectorStore):
|
|
313 |
"""
|
314 |
embedding = self.embedding_function.embed_query(query)
|
315 |
docs = self.similarity_search_with_score_by_vector(
|
316 |
-
embedding=embedding, k=k
|
317 |
)
|
318 |
return docs
|
319 |
|
@@ -335,9 +334,8 @@ class CustomPGVector(VectorStore):
|
|
335 |
self,
|
336 |
embedding: List[float],
|
337 |
k: int = 4,
|
338 |
-
filter: Optional[dict] = None,
|
339 |
) -> List[Tuple[Document, float]]:
|
340 |
-
results = self.__query_collection(embedding=embedding, k=k
|
341 |
|
342 |
return self._results_to_docs_and_scores(results)
|
343 |
|
@@ -366,7 +364,6 @@ class CustomPGVector(VectorStore):
|
|
366 |
self,
|
367 |
embedding: List[float],
|
368 |
k: int = 4,
|
369 |
-
filter: Optional[Dict[str, str]] = None,
|
370 |
) -> List[Any]:
|
371 |
"""Query the collection."""
|
372 |
with Session(self._conn) as session:
|
@@ -401,7 +398,6 @@ class CustomPGVector(VectorStore):
|
|
401 |
self,
|
402 |
embedding: List[float],
|
403 |
k: int = 4,
|
404 |
-
filter: Optional[dict] = None,
|
405 |
**kwargs: Any,
|
406 |
) -> List[Document]:
|
407 |
"""Return docs most similar to embedding vector.
|
@@ -415,7 +411,7 @@ class CustomPGVector(VectorStore):
|
|
415 |
List of Documents most similar to the query vector.
|
416 |
"""
|
417 |
docs_and_scores = self.similarity_search_with_score_by_vector(
|
418 |
-
embedding=embedding, k=k
|
419 |
)
|
420 |
return _results_to_docs(docs_and_scores)
|
421 |
|
|
|
292 |
return self.similarity_search_by_vector(
|
293 |
embedding=embedding,
|
294 |
k=k,
|
|
|
295 |
)
|
296 |
|
297 |
def similarity_search_with_score(
|
|
|
312 |
"""
|
313 |
embedding = self.embedding_function.embed_query(query)
|
314 |
docs = self.similarity_search_with_score_by_vector(
|
315 |
+
embedding=embedding, k=k
|
316 |
)
|
317 |
return docs
|
318 |
|
|
|
334 |
self,
|
335 |
embedding: List[float],
|
336 |
k: int = 4,
|
|
|
337 |
) -> List[Tuple[Document, float]]:
|
338 |
+
results = self.__query_collection(embedding=embedding, k=k)
|
339 |
|
340 |
return self._results_to_docs_and_scores(results)
|
341 |
|
|
|
364 |
self,
|
365 |
embedding: List[float],
|
366 |
k: int = 4,
|
|
|
367 |
) -> List[Any]:
|
368 |
"""Query the collection."""
|
369 |
with Session(self._conn) as session:
|
|
|
398 |
self,
|
399 |
embedding: List[float],
|
400 |
k: int = 4,
|
|
|
401 |
**kwargs: Any,
|
402 |
) -> List[Document]:
|
403 |
"""Return docs most similar to embedding vector.
|
|
|
411 |
List of Documents most similar to the query vector.
|
412 |
"""
|
413 |
docs_and_scores = self.similarity_search_with_score_by_vector(
|
414 |
+
embedding=embedding, k=k
|
415 |
)
|
416 |
return _results_to_docs(docs_and_scores)
|
417 |
|