Logo
Classes

CohereRerank

Defined in: providers/cohere/src/CohereRerank.ts:17

Implements

  • BaseNodePostprocessor

Constructors

new CohereRerank()

new CohereRerank(topN): CohereRerank

Defined in: providers/cohere/src/CohereRerank.ts:30

Constructor for CohereRerank.

Parameters

topN

CohereRerankOptions

Number of nodes to return.

Returns

CohereRerank

Properties

topN

topN: number = 2

Defined in: providers/cohere/src/CohereRerank.ts:18


model

model: string = "rerank-english-v2.0"

Defined in: providers/cohere/src/CohereRerank.ts:19


apiKey

apiKey: null | string = null

Defined in: providers/cohere/src/CohereRerank.ts:20


baseUrl

baseUrl: undefined | string

Defined in: providers/cohere/src/CohereRerank.ts:21


timeout

timeout: undefined | number

Defined in: providers/cohere/src/CohereRerank.ts:22

Methods

postprocessNodes()

postprocessNodes(nodes, query?): Promise<NodeWithScore<Metadata>[]>

Defined in: providers/cohere/src/CohereRerank.ts:64

Reranks the nodes using the Cohere API.

Parameters

nodes

NodeWithScore<Metadata>[]

Array of nodes with scores.

query?

MessageContent

Query string.

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseNodePostprocessor.postprocessNodes

On this page