fix(rag): correct empty/non-list guard in TeiRerankEmbeddings._parse_results (#3133)

This commit is contained in:
Syed Osama Ali Shah
2026-07-15 11:27:43 +03:00
committed by GitHub
parent f5adbef2ac
commit 7996544a43

View File

@@ -643,7 +643,7 @@ class TeiRerankEmbeddings(OpenAPIRerankEmbeddings):
Returns:
List[float]: The rank scores of the candidates.
"""
if not isinstance(response, list) and len(response) == 0:
if not isinstance(response, list) or len(response) == 0:
raise RuntimeError("Results should be a not empty list")
# Sort by index, 0 in the first element