Integrations · Class
CohereRerank
CohereRerank uses Cohere's rerank API to order documents for a query. It can also return only the highest-ranked documents as LangChain Document objects.
Last updated
- Since
- v0.1
Syntax
new CohereRerank({ apiKey, model, topN })
await cohereRerank.rerank(docs, query, { topN })
await cohereRerank.compressDocuments(docs, query)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
CohereClientDocumentBaseDocumentCompressorcompressDocumentsrerankrelevanceScore