Skip to content

VoyageProvider.VoyageRerankingModel

Namespace: Vercel.AI.Voyage

public sealed class VoyageProvider.VoyageRerankingModel : IRerankingModel

Voyage reranking model.

Inheritance: object

Implements: IRerankingModel

View source

VoyageRerankingModel(VoyageProvider, string)

Section titled “VoyageRerankingModel(VoyageProvider, string)”
public VoyageRerankingModel(VoyageProvider provider, string modelId)

Creates a reranking model.

Parameters

Name Type Description
provider VoyageProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

DoRerankAsync(string, IReadOnlyList<string>, int?, CancellationToken, IReadOnlyDictionary<string, string?>?)

Section titled “DoRerankAsync(string, IReadOnlyList<string>, int?, CancellationToken, IReadOnlyDictionary<string, string?>?)”
public Task<RerankResult> DoRerankAsync(string query, IReadOnlyList<string> documents, int? topN, CancellationToken cancellationToken, IReadOnlyDictionary<string, string?>? headers = null)

Reranks documents for a query. <code class=“paramref”>headers</code> are sent with this call and override the provider headers.

Parameters

Name Type Description
query string
documents IReadOnlyList<string>
topN int?
cancellationToken CancellationToken
headers IReadOnlyDictionary<string, string>

Returns: Task<RerankResult>

View source

RerankAsync(VoyageRerankRequest, CancellationToken)

Section titled “RerankAsync(VoyageRerankRequest, CancellationToken)”
public Task<VoyageRerankResult> RerankAsync(VoyageRerankRequest request, CancellationToken cancellationToken)

Reranks text or JSON documents.

Parameters

Name Type Description
request VoyageRerankRequest
cancellationToken CancellationToken

Returns: Task<VoyageRerankResult>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product