contextual-client
Python SDK. Learn more about it here.
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
ContextualRerank | langchain-contextual | ❌ | beta | ❌ |
langchain-contextual
integration package.
langchain-contextual
package:
Parameter | Type | Description |
---|---|---|
documents | list[Document] | A sequence of documents to rerank. Any metadata contained in the documents will also be used for reranking. |
query | str | The query to use for reranking. |
model | str | The version of the reranker to use. Currently, we just have “ctxl-rerank-en-v1-instruct”. |
top_n | Optional[int] | The number of results to return. If None returns all results. Defaults to self.top_n. |
instruction | Optional[str] | The instruction to be used for the reranker. |
callbacks | Optional[Callbacks] | Callbacks to run during the compression process. |