TogetherAIRerankingModel
Namespace: Vercel.AI.TogetherAI
public sealed class TogetherAIRerankingModel : IRerankingModel, IRerankCallerTogether reranking model. Posts /rerank and reads relevance_score.
Inheritance: object
Implements: IRerankingModel, IRerankCaller
Constructors
Section titled “Constructors”TogetherAIRerankingModel(TogetherAIProvider, string)
Section titled “TogetherAIRerankingModel(TogetherAIProvider, string)”public TogetherAIRerankingModel(TogetherAIProvider provider, string modelId)Creates a reranking model.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
TogetherAIProvider | |
modelId |
string |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
Methods
Section titled “Methods”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>
DoRerankAsync(RerankModelCall, CancellationToken)
Section titled “DoRerankAsync(RerankModelCall, CancellationToken)”public Task<RerankModelResponse> DoRerankAsync(RerankModelCall call, CancellationToken cancellationToken)Reranks text or object documents. togetherai.rankFields is sent as rank_fields.
Parameters
| Name | Type | Description |
|---|---|---|
call |
RerankModelCall | |
cancellationToken |
CancellationToken |
Returns: Task<RerankModelResponse>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product