From 76ab3fdd90f63c09985995da6de3325103823fef Mon Sep 17 00:00:00 2001 From: taprosoft Date: Tue, 1 Oct 2024 09:37:09 +0000 Subject: [PATCH] fix: check empty Cohere key in rerank --- libs/kotaemon/kotaemon/rerankings/cohere.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/kotaemon/kotaemon/rerankings/cohere.py b/libs/kotaemon/kotaemon/rerankings/cohere.py index dbc5e9a..6e68fd4 100644 --- a/libs/kotaemon/kotaemon/rerankings/cohere.py +++ b/libs/kotaemon/kotaemon/rerankings/cohere.py @@ -34,7 +34,7 @@ class CohereReranking(BaseReranking): "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.") return documents