All pages
Powered by GitBook
1 of 1

Loading...

DefaultRerankingService

Wisej.AI.Services.DefaultRerankingService

Namespace: Wisej.AI.Services

Assembly: Wisej.AI (3.5.0.0)

Provides a default implementation of the IRerankingService for reranking documents using a specified endpoint to an AI provider. It uses LLM models to rerank and optionally optimize the submitted inputs.

public class DefaultRerankingService : IRerankingService
Public Class DefaultRerankingService
    Inherits IRerankingService

Constructors

DefaultRerankingService(endpoint)

Initializes a new instance of the class.

Name
Type
Description

Properties

Endpoint

: Gets or sets the default endpoint used for reranking documents. (Default: Wisej.AI.Endpoints.OpenAIEndpoint)

Prompt

: Gets or sets the prompt used to perform the reranking task.

TopN

: Gets or sets the maximum number of documents to return in the reranked response. If set to 0 it will return all the documents in the input. (Default: 10)

Methods

RerankAsync(query, chunks)

Asynchronously reranks the provided chunks based on the specified query.

Parameter
Type
Description

Returns: . A task that represents the asynchronous operation. The task result contains an array of reranked text inputs.

Implements

Name
Description

endpoint

SmartEndpoint

The endpoint to be used by the service. If not provided, a default OpenAIEndpoint is used.

query

String

The query used to rerank the chunks.

chunks

String[]

The array of text inputs to be reranked.

IRerankingService

Represents a service for reranking documents based on a given query.

DefaultRerankingService
SmartEndpoint
SmartPrompt
Int32
Task<String[]>