Skip to content

Commit 2cca106

Browse files
Merge pull request #111 from tryAGI/bot/update-openapi_202411220628
feat:Update openapi.yaml file in src/libs/Cohere directory
2 parents 1c8b30b + 0b6e9fe commit 2cca106

File tree

4 files changed

+63
-77
lines changed

4 files changed

+63
-77
lines changed

src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -508,31 +508,32 @@ partial void ProcessRerankv2ResponseContent(
508508
/// </summary>
509509
/// <param name="xClientName"></param>
510510
/// <param name="model">
511-
/// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`
511+
/// The identifier of the model to use. <br/>
512+
/// Supported models:<br/>
513+
/// - `rerank-english-v3.0`<br/>
514+
/// - `rerank-multilingual-v3.0`<br/>
515+
/// - `rerank-english-v2.0`<br/>
516+
/// - `rerank-multilingual-v2.0`
512517
/// </param>
513518
/// <param name="query">
514519
/// The search query
515520
/// </param>
516521
/// <param name="documents">
517-
/// A list of document objects or strings to rerank.<br/>
518-
/// If a document is provided the text fields is required and all other fields will be preserved in the response.<br/>
519-
/// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.<br/>
520-
/// We recommend a maximum of 1,000 documents for optimal endpoint performance.
522+
/// A list of texts that will be compared to the `query`.<br/>
523+
/// For optimal performance we recommend against sending more than 1,000 documents in a single request.<br/>
524+
/// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.<br/>
525+
/// **Note**: structured data should be formatted as YAML strings for best performance.
521526
/// </param>
522527
/// <param name="topN">
523-
/// The number of most relevant documents or indices to return, defaults to the length of the documents
524-
/// </param>
525-
/// <param name="rankFields">
526-
/// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.
528+
/// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned.
527529
/// </param>
528530
/// <param name="returnDocuments">
529531
/// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.<br/>
530532
/// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.<br/>
531533
/// Default Value: false
532534
/// </param>
533-
/// <param name="maxChunksPerDoc">
534-
/// The maximum number of chunks to produce internally from a document<br/>
535-
/// Default Value: 10
535+
/// <param name="maxTokensPerDoc">
536+
/// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens.
536537
/// </param>
537538
/// <param name="cancellationToken">The token to cancel the operation with</param>
538539
/// <exception cref="global::System.InvalidOperationException"></exception>
@@ -542,9 +543,8 @@ partial void ProcessRerankv2ResponseContent(
542543
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.RerankDocument>> documents,
543544
string? xClientName = default,
544545
int? topN = default,
545-
global::System.Collections.Generic.IList<string>? rankFields = default,
546546
bool? returnDocuments = default,
547-
int? maxChunksPerDoc = default,
547+
int? maxTokensPerDoc = default,
548548
global::System.Threading.CancellationToken cancellationToken = default)
549549
{
550550
var __request = new global::Cohere.Rerankv2Request
@@ -553,9 +553,8 @@ partial void ProcessRerankv2ResponseContent(
553553
Query = query,
554554
Documents = documents,
555555
TopN = topN,
556-
RankFields = rankFields,
557556
ReturnDocuments = returnDocuments,
558-
MaxChunksPerDoc = maxChunksPerDoc,
557+
MaxTokensPerDoc = maxTokensPerDoc,
559558
};
560559

561560
return await Rerankv2Async(

src/libs/Cohere/Generated/Cohere.ICohereApi.Rerankv2.g.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,32 @@ public partial interface ICohereApi
2323
/// </summary>
2424
/// <param name="xClientName"></param>
2525
/// <param name="model">
26-
/// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`
26+
/// The identifier of the model to use. <br/>
27+
/// Supported models:<br/>
28+
/// - `rerank-english-v3.0`<br/>
29+
/// - `rerank-multilingual-v3.0`<br/>
30+
/// - `rerank-english-v2.0`<br/>
31+
/// - `rerank-multilingual-v2.0`
2732
/// </param>
2833
/// <param name="query">
2934
/// The search query
3035
/// </param>
3136
/// <param name="documents">
32-
/// A list of document objects or strings to rerank.<br/>
33-
/// If a document is provided the text fields is required and all other fields will be preserved in the response.<br/>
34-
/// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.<br/>
35-
/// We recommend a maximum of 1,000 documents for optimal endpoint performance.
37+
/// A list of texts that will be compared to the `query`.<br/>
38+
/// For optimal performance we recommend against sending more than 1,000 documents in a single request.<br/>
39+
/// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.<br/>
40+
/// **Note**: structured data should be formatted as YAML strings for best performance.
3641
/// </param>
3742
/// <param name="topN">
38-
/// The number of most relevant documents or indices to return, defaults to the length of the documents
39-
/// </param>
40-
/// <param name="rankFields">
41-
/// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.
43+
/// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned.
4244
/// </param>
4345
/// <param name="returnDocuments">
4446
/// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.<br/>
4547
/// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.<br/>
4648
/// Default Value: false
4749
/// </param>
48-
/// <param name="maxChunksPerDoc">
49-
/// The maximum number of chunks to produce internally from a document<br/>
50-
/// Default Value: 10
50+
/// <param name="maxTokensPerDoc">
51+
/// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens.
5152
/// </param>
5253
/// <param name="cancellationToken">The token to cancel the operation with</param>
5354
/// <exception cref="global::System.InvalidOperationException"></exception>
@@ -57,9 +58,8 @@ public partial interface ICohereApi
5758
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.RerankDocument>> documents,
5859
string? xClientName = default,
5960
int? topN = default,
60-
global::System.Collections.Generic.IList<string>? rankFields = default,
6161
bool? returnDocuments = default,
62-
int? maxChunksPerDoc = default,
62+
int? maxTokensPerDoc = default,
6363
global::System.Threading.CancellationToken cancellationToken = default);
6464
}
6565
}

src/libs/Cohere/Generated/Cohere.Models.Rerankv2Request.g.cs

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ namespace Cohere
1111
public sealed partial class Rerankv2Request
1212
{
1313
/// <summary>
14-
/// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`
14+
/// The identifier of the model to use. <br/>
15+
/// Supported models:<br/>
16+
/// - `rerank-english-v3.0`<br/>
17+
/// - `rerank-multilingual-v3.0`<br/>
18+
/// - `rerank-english-v2.0`<br/>
19+
/// - `rerank-multilingual-v2.0`
1520
/// </summary>
1621
[global::System.Text.Json.Serialization.JsonPropertyName("model")]
1722
[global::System.Text.Json.Serialization.JsonRequired]
@@ -25,27 +30,21 @@ public sealed partial class Rerankv2Request
2530
public required string Query { get; set; }
2631

2732
/// <summary>
28-
/// A list of document objects or strings to rerank.<br/>
29-
/// If a document is provided the text fields is required and all other fields will be preserved in the response.<br/>
30-
/// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.<br/>
31-
/// We recommend a maximum of 1,000 documents for optimal endpoint performance.
33+
/// A list of texts that will be compared to the `query`.<br/>
34+
/// For optimal performance we recommend against sending more than 1,000 documents in a single request.<br/>
35+
/// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.<br/>
36+
/// **Note**: structured data should be formatted as YAML strings for best performance.
3237
/// </summary>
3338
[global::System.Text.Json.Serialization.JsonPropertyName("documents")]
3439
[global::System.Text.Json.Serialization.JsonRequired]
3540
public required global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.RerankDocument>> Documents { get; set; }
3641

3742
/// <summary>
38-
/// The number of most relevant documents or indices to return, defaults to the length of the documents
43+
/// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned.
3944
/// </summary>
4045
[global::System.Text.Json.Serialization.JsonPropertyName("top_n")]
4146
public int? TopN { get; set; }
4247

43-
/// <summary>
44-
/// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.
45-
/// </summary>
46-
[global::System.Text.Json.Serialization.JsonPropertyName("rank_fields")]
47-
public global::System.Collections.Generic.IList<string>? RankFields { get; set; }
48-
4948
/// <summary>
5049
/// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.<br/>
5150
/// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.<br/>
@@ -55,11 +54,10 @@ public sealed partial class Rerankv2Request
5554
public bool? ReturnDocuments { get; set; }
5655

5756
/// <summary>
58-
/// The maximum number of chunks to produce internally from a document<br/>
59-
/// Default Value: 10
57+
/// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens.
6058
/// </summary>
61-
[global::System.Text.Json.Serialization.JsonPropertyName("max_chunks_per_doc")]
62-
public int? MaxChunksPerDoc { get; set; }
59+
[global::System.Text.Json.Serialization.JsonPropertyName("max_tokens_per_doc")]
60+
public int? MaxTokensPerDoc { get; set; }
6361

6462
/// <summary>
6563
/// Additional properties that are not explicitly defined in the schema
@@ -71,49 +69,48 @@ public sealed partial class Rerankv2Request
7169
/// Initializes a new instance of the <see cref="Rerankv2Request" /> class.
7270
/// </summary>
7371
/// <param name="model">
74-
/// The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`
72+
/// The identifier of the model to use. <br/>
73+
/// Supported models:<br/>
74+
/// - `rerank-english-v3.0`<br/>
75+
/// - `rerank-multilingual-v3.0`<br/>
76+
/// - `rerank-english-v2.0`<br/>
77+
/// - `rerank-multilingual-v2.0`
7578
/// </param>
7679
/// <param name="query">
7780
/// The search query
7881
/// </param>
7982
/// <param name="documents">
80-
/// A list of document objects or strings to rerank.<br/>
81-
/// If a document is provided the text fields is required and all other fields will be preserved in the response.<br/>
82-
/// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.<br/>
83-
/// We recommend a maximum of 1,000 documents for optimal endpoint performance.
83+
/// A list of texts that will be compared to the `query`.<br/>
84+
/// For optimal performance we recommend against sending more than 1,000 documents in a single request.<br/>
85+
/// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.<br/>
86+
/// **Note**: structured data should be formatted as YAML strings for best performance.
8487
/// </param>
8588
/// <param name="topN">
86-
/// The number of most relevant documents or indices to return, defaults to the length of the documents
87-
/// </param>
88-
/// <param name="rankFields">
89-
/// If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.
89+
/// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned.
9090
/// </param>
9191
/// <param name="returnDocuments">
9292
/// - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request.<br/>
9393
/// - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request.<br/>
9494
/// Default Value: false
9595
/// </param>
96-
/// <param name="maxChunksPerDoc">
97-
/// The maximum number of chunks to produce internally from a document<br/>
98-
/// Default Value: 10
96+
/// <param name="maxTokensPerDoc">
97+
/// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens.
9998
/// </param>
10099
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
101100
public Rerankv2Request(
102101
string model,
103102
string query,
104103
global::System.Collections.Generic.IList<global::Cohere.OneOf<string, global::Cohere.RerankDocument>> documents,
105104
int? topN,
106-
global::System.Collections.Generic.IList<string>? rankFields,
107105
bool? returnDocuments,
108-
int? maxChunksPerDoc)
106+
int? maxTokensPerDoc)
109107
{
110108
this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model));
111109
this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query));
112110
this.Documents = documents ?? throw new global::System.ArgumentNullException(nameof(documents));
113111
this.TopN = topN;
114-
this.RankFields = rankFields;
115112
this.ReturnDocuments = returnDocuments;
116-
this.MaxChunksPerDoc = maxChunksPerDoc;
113+
this.MaxTokensPerDoc = maxTokensPerDoc;
117114
}
118115

119116
/// <summary>

0 commit comments

Comments
 (0)