Table of Contents

Class CohereReranker

Namespace
Mythosia.AI.Rag.Reranking
Assembly
Mythosia.AI.Rag.dll
public class CohereReranker : IReranker
Inheritance
CohereReranker
Implements
Inherited Members

Constructors

CohereReranker(string, HttpClient?, string, string)

public CohereReranker(string apiKey, HttpClient? httpClient = null, string model = "rerank-v3.5", string endpoint = "https://api.cohere.com/v2/rerank")

Parameters

apiKey string
httpClient HttpClient
model string
endpoint string

Methods

RerankAsync(string, IReadOnlyList<VectorSearchResult>, CancellationToken)

public Task<IReadOnlyList<VectorSearchResult>> RerankAsync(string query, IReadOnlyList<VectorSearchResult> results, CancellationToken cancellationToken = default)

Parameters

query string
results IReadOnlyList<VectorSearchResult>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<VectorSearchResult>>