fix: check empty Cohere key in rerank

This commit is contained in:
taprosoft 2024-10-01 09:37:09 +00:00
parent 8d3a752710
commit 76ab3fdd90

View File

@ -34,7 +34,7 @@ class CohereReranking(BaseReranking):
"Please install Cohere " "`pip install cohere` to use Cohere Reranking" "Please install Cohere " "`pip install cohere` to use Cohere Reranking"
) )
if not self.cohere_api_key: if not self.cohere_api_key or "COHERE_API_KEY" in self.cohere_api_key:
print("Cohere API key not found. Skipping rerankings.") print("Cohere API key not found. Skipping rerankings.")
return documents return documents