Saltar al contenido principal

Class: JinaAIReranker

Implements

Constructors

constructor

new JinaAIReranker(init?): JinaAIReranker

Parameters

NameType
init?Partial<JinaAIReranker>

Returns

JinaAIReranker

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:19

Properties

apiKey

Optional apiKey: string = undefined

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:17


model

model: string = "jina-reranker-v1-base-en"

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:15


topN

Optional topN: number

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:16

Methods

postprocessNodes

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

Send message along with the class's current chat history to the LLM. This version returns a promise for asynchronous operation.

Parameters

NameTypeDescription
nodesNodeWithScore<Metadata>[]Array of nodes with scores.
query?stringOptional query string.

Returns

Promise<NodeWithScore<Metadata>[]>

Implementation of

BaseNodePostprocessor.postprocessNodes

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:63


rerank

rerank(query, documents, topN?): Promise<JinaAIRerankerResult[]>

Parameters

NameType
querystring
documentsstring[]
topNundefined | number

Returns

Promise<JinaAIRerankerResult[]>

Defined in

packages/core/src/postprocessors/rerankers/JinaAIReranker.ts:31