Metadata-Version: 2.4
Name: rag-reranker
Version: 0.1.0
Summary: Cross-encoder reranker utility for LangChain documents
Author: Nit Patel
License-Expression: MIT
Keywords: reranker,cross-encoder,langchain,rag
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain-core>=0.2.0
Requires-Dist: sentence-transformers>=2.7.0
Dynamic: license-file

# ragas-reranker

A lightweight cross-encoder reranker for LangChain `Document` objects.

## Installation

```bash
pip install ragas-reranker
```

## Usage

```python
from langchain_core.documents import Document
from ragas_reranker import CrossEncoderReranker

docs = [
    Document(page_content="Paris is the capital of France."),
    Document(page_content="Berlin is the capital of Germany."),
]

reranker = CrossEncoderReranker()
results = reranker.rerank("what is the capital of france?", docs, top_k=1)

print(results[0].document.page_content, results[0].score)
```

## Development

Build locally:

```bash
python -m pip install --upgrade build
python -m build
```

This produces distributable files in the `dist/` folder.

## Publish to PyPI

```bash
python -m pip install --upgrade twine
python -m twine check dist/*
python -m twine upload dist/*
```

You can use TestPyPI first:

```bash
python -m twine upload --repository testpypi dist/*
```
