CohereRerankingModel
Namespace: Vercel.AI.Cohere
public sealed class CohereRerankingModel : IRerankingModelCohere rerank model.
Inheritance: object
Implements: IRerankingModel
Constructors
Section titled “Constructors”CohereRerankingModel(CohereProvider, string)
Section titled “CohereRerankingModel(CohereProvider, string)”public CohereRerankingModel(CohereProvider provider, string modelId)Creates a reranking model.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
CohereProvider | |
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>
RerankAsync(CohereRerankRequest, CancellationToken)
Section titled “RerankAsync(CohereRerankRequest, CancellationToken)”public Task<CohereRerankResult> RerankAsync(CohereRerankRequest request, CancellationToken cancellationToken)Reranks text or JSON documents and returns the response body.
Parameters
| Name | Type | Description |
|---|---|---|
request |
CohereRerankRequest | |
cancellationToken |
CancellationToken |
Returns: Task<CohereRerankResult>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product