Skip to content

Commit

Permalink
fix: check empty Cohere key in rerank
Browse files Browse the repository at this point in the history
  • Loading branch information
taprosoft committed Oct 1, 2024
1 parent 8d3a752 commit 76ab3fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/kotaemon/kotaemon/rerankings/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def run(self, documents: list[Document], query: str) -> list[Document]:
"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

Expand Down

0 comments on commit 76ab3fd

Please sign in to comment.