Skip to content

The agent engineering platform.

Fix CohereRerank configuration (#11583)

cccs-erice2a9072b806b
diff --git a/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py b/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py
index 8199fa46dd..3db3f7c92f 100644
--- a/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py
+++ b/libs/langchain/langchain/retrievers/document_compressors/cohere_rerank.py
@@ -29,6 +29,8 @@ class CohereRerank(BaseDocumentCompressor):
model: str = "rerank-english-v2.0"
"""Model to use for reranking."""
+ cohere_api_key: Optional[str] = None
+
class Config:
"""Configuration for this pydantic object."""