Skip to content

Commit

Permalink
Implemented test_store:test_retrieve_from
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninoLorenzo committed Aug 25, 2024
1 parent b02220c commit 20787e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/agent/knowledge/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ def retrieve_from(self, query: str, collection_name: str,
results.
:return: list of chunks or None
"""
if len(query) < 3:
return None
if not len(query):
raise ValueError('Query cannot be empty')
if collection_name not in self._collections.keys():
raise ValueError(f'Collection {collection_name} does not exist')

hits = self._connection.search(
collection_name=collection_name,
Expand Down

0 comments on commit 20787e7

Please sign in to comment.