Skip to content

Commit

Permalink
check for list of dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerhutcherson committed Jan 13, 2025
1 parent 6ee088f commit 1cbe7a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redisvl/utils/rerank/voyageai.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def _preprocess(
return_score = kwargs.get("return_score", self.return_score)
truncation = kwargs.get("truncation")

if not isinstance(docs, list):
raise ValueError("Docs to rerank should either be a list of str or dict.")

if all(isinstance(doc, dict) and "content" in doc for doc in docs):
texts = [
str(doc["content"])
Expand Down

0 comments on commit 1cbe7a6

Please sign in to comment.