Skip to content

Commit ee68921

Browse files
check for list of dicts
1 parent f2156bb commit ee68921

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

redisvl/utils/rerank/voyageai.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ def _preprocess(
109109
return_score = kwargs.get("return_score", self.return_score)
110110
truncation = kwargs.get("truncation")
111111

112+
if not isinstance(docs, list):
113+
raise ValueError("Docs to rerank should either be a list of str or dict.")
114+
112115
if all(isinstance(doc, dict) and "content" in doc for doc in docs):
113116
texts = [
114117
str(doc["content"])

0 commit comments

Comments
 (0)