Class: CohereRerank
Implements
Constructors
constructor
• new CohereRerank(topN
): CohereRerank
Constructor for CohereRerank.
Parameters
Name | Type | Description |
---|---|---|
topN | CohereRerankOptions | Number of nodes to return. |
Returns
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:24
Properties
apiKey
• apiKey: null
| string
= null
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:16
client
• Private
client: null
| CohereClient
= null
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:18
model
• model: string
= "rerank-english-v2.0"
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:15
topN
• topN: number
= 2
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:14
Methods
postprocessNodes
▸ postprocessNodes(nodes
, query?
): Promise
<NodeWithScore
<Metadata
>[]>
Reranks the nodes using the Cohere API.
Parameters
Name | Type | Description |
---|---|---|
nodes | NodeWithScore <Metadata >[] | Array of nodes with scores. |
query? | string | Query string. |
Returns
Promise
<NodeWithScore
<Metadata
>[]>
Implementation of
BaseNodePostprocessor.postprocessNodes
Defined in
packages/core/src/postprocessors/rerankers/CohereRerank.ts:47