Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
akashmangoai committed Oct 31, 2024
1 parent fb4db7f commit 6acd7f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion adalflow/adalflow/components/retriever/lancedb_retriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ def retrieve(self, query: Union[str, List[str]], top_k: Optional[int] = None) ->
if isinstance(query, str):
query = [query]

# Embed the query text(s) with Embedder
if not query or (isinstance(query, str) and query.strip() == ""):
raise ValueError("Query cannot be empty.")

# Check if table (index) exists before performing search
if not self.table:
raise ValueError("The index has not been initialized or the table is missing.")

query_embeddings = self.embedder(input=query).data
output: List[RetrieverOutput] = []

Expand Down

0 comments on commit 6acd7f3

Please sign in to comment.