CohereRerankerOptions
Properties
Section titled “Properties”apiKey?
Section titled “apiKey?”optional apiKey?: string;Cohere API key. If not provided, reads from the COHERE_API_KEY environment variable at call time.
baseUrl?
Section titled “baseUrl?”optional baseUrl?: string;Cohere API base URL. Override for proxied or self-hosted endpoints. Default: ‘https://api.cohere.com/v2’.
maxCharsPerDoc?
Section titled “maxCharsPerDoc?”optional maxCharsPerDoc?: number;Maximum characters of document text to send per candidate. Cohere’s rerank API accepts up to 4096 tokens per document; truncating to character limit avoids oversized requests. Default: 4000.
model?
Section titled “model?”optional model?: string;Cohere rerank model identifier. Default: ‘rerank-v3.5’.
optional topK?: number;Maximum number of results to return after reranking. Default: 5.