Ga naar hoofdinhoud

Class: JinaAIReranker

Implements

Constructors

new JinaAIReranker()

new JinaAIReranker(init?): JinaAIReranker

Parameters

init?: Partial <JinaAIReranker>

Returns

JinaAIReranker

Source

packages/llamaindex/src/postprocessors/rerankers/JinaAIReranker.ts:21

Properties

apiKey?

optional apiKey: string = undefined

Source

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


model

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

Source

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


topN?

optional topN: number

Source

packages/llamaindex/src/postprocessors/rerankers/JinaAIReranker.ts:18

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

nodes: NodeWithScore <Metadata>[]

Array of nodes with scores.

query?: MessageContent

Optional query string.

Returns

Promise <NodeWithScore <Metadata>[]>

Implementation of

BaseNodePostprocessor . postprocessNodes

Source

packages/llamaindex/src/postprocessors/rerankers/JinaAIReranker.ts:65


rerank()

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

Parameters

query: string

documents: string[]

topN: undefined | number= undefined

Returns

Promise<JinaAIRerankerResult[]>

Source

packages/llamaindex/src/postprocessors/rerankers/JinaAIReranker.ts:33