# CohereRerank

> **Class** in `langchain_cohere`

📖 [View in docs](https://reference.langchain.com/python/langchain-cohere/rerank/CohereRerank)

Document compressor that uses `Cohere Rerank API`.

## Signature

```python
CohereRerank()
```

## Extends

- `BaseDocumentCompressor`

## Properties

- `client`
- `top_n`
- `model`
- `cohere_api_key`
- `base_url`
- `user_agent`
- `model_config`

## Methods

- [`validate_environment()`](https://reference.langchain.com/python/langchain-cohere/rerank/CohereRerank/validate_environment)
- [`validate_model_specified()`](https://reference.langchain.com/python/langchain-cohere/rerank/CohereRerank/validate_model_specified)
- [`rerank()`](https://reference.langchain.com/python/langchain-cohere/rerank/CohereRerank/rerank)
- [`compress_documents()`](https://reference.langchain.com/python/langchain-cohere/rerank/CohereRerank/compress_documents)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-cohere/blob/24cfdaefd4e3c785f477ccfe491a4226a0dbe88c/libs/cohere/langchain_cohere/rerank.py#L15)