Skip to content

Instantly share code, notes, and snippets.

View cnevelle-blueprint's full-sized avatar

cnevelle-blueprint

View GitHub Profile
# CohereRerank wrapper to use as a document compressor
from typing import Any, Dict, Sequence
from pydantic import root_validator
from langchain.retrievers.document_compressors.base import BaseDocumentCompressor
from langchain.schema import Document
from langchain.utils import get_from_dict_or_env