Skip to content

Commit

Permalink
Update bot/retrievers/retrieve_similar_nodes.py
Browse files Browse the repository at this point in the history
Add group_by_metadata validation

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
amindadgar and coderabbitai[bot] authored Apr 11, 2024
1 parent 3ece4f3 commit b142f62
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions bot/retrievers/retrieve_similar_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ def query_db(
Note: This would completely disable the similarity search and
it would just return the results with no ordering.
default is `False`. If `True` the query will be ignored and no embedding of it would be fetched
aggregate_records : bool
aggregate records and group by a given term in `group_by_metadata`
group_by_metadata : list[str]
do grouping by some property of `metadata_`
"""
ignore_sort = kwargs.get("ignore_sort", False)
aggregate_records = kwargs.get("aggregate_records", False)
group_by_metadata = kwargs.get("group_by_metadata", [])
if not isinstance(group_by_metadata, list):
raise ValueError("Expected 'group_by_metadata' to be a list.")
self._vector_store._initialize()
if not aggregate_records:
Expand Down

0 comments on commit b142f62

Please sign in to comment.