From 0b6e9fe663653230b77a2834b8b2d5fc32af37bd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 22 Nov 2024 06:28:16 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Generated/Cohere.CohereApi.Rerankv2.g.cs | 31 +++++----- .../Generated/Cohere.ICohereApi.Rerankv2.g.cs | 28 ++++----- .../Cohere.Models.Rerankv2Request.g.cs | 61 +++++++++---------- src/libs/Cohere/openapi.yaml | 20 ++---- 4 files changed, 63 insertions(+), 77 deletions(-) diff --git a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs index 5cfb696c..09d68c0c 100644 --- a/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.CohereApi.Rerankv2.g.cs @@ -508,31 +508,32 @@ partial void ProcessRerankv2ResponseContent( /// /// /// - /// 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` + /// The identifier of the model to use.
+ /// Supported models:
+ /// - `rerank-english-v3.0`
+ /// - `rerank-multilingual-v3.0`
+ /// - `rerank-english-v2.0`
+ /// - `rerank-multilingual-v2.0` /// /// /// The search query /// /// - /// A list of document objects or strings to rerank.
- /// If a document is provided the text fields is required and all other fields will be preserved in the response.
- /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
- /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// A list of texts that will be compared to the `query`.
+ /// For optimal performance we recommend against sending more than 1,000 documents in a single request.
+ /// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.
+ /// **Note**: structured data should be formatted as YAML strings for best performance. /// /// - /// The number of most relevant documents or indices to return, defaults to the length of the documents - /// - /// - /// 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. + /// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned. /// /// /// - 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.
/// - 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.
/// Default Value: false /// - /// - /// The maximum number of chunks to produce internally from a document
- /// Default Value: 10 + /// + /// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. /// /// The token to cancel the operation with /// @@ -542,9 +543,8 @@ partial void ProcessRerankv2ResponseContent( global::System.Collections.Generic.IList> documents, string? xClientName = default, int? topN = default, - global::System.Collections.Generic.IList? rankFields = default, bool? returnDocuments = default, - int? maxChunksPerDoc = default, + int? maxTokensPerDoc = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::Cohere.Rerankv2Request @@ -553,9 +553,8 @@ partial void ProcessRerankv2ResponseContent( Query = query, Documents = documents, TopN = topN, - RankFields = rankFields, ReturnDocuments = returnDocuments, - MaxChunksPerDoc = maxChunksPerDoc, + MaxTokensPerDoc = maxTokensPerDoc, }; return await Rerankv2Async( diff --git a/src/libs/Cohere/Generated/Cohere.ICohereApi.Rerankv2.g.cs b/src/libs/Cohere/Generated/Cohere.ICohereApi.Rerankv2.g.cs index 07895ac7..50bf7ed5 100644 --- a/src/libs/Cohere/Generated/Cohere.ICohereApi.Rerankv2.g.cs +++ b/src/libs/Cohere/Generated/Cohere.ICohereApi.Rerankv2.g.cs @@ -23,31 +23,32 @@ public partial interface ICohereApi /// /// /// - /// 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` + /// The identifier of the model to use.
+ /// Supported models:
+ /// - `rerank-english-v3.0`
+ /// - `rerank-multilingual-v3.0`
+ /// - `rerank-english-v2.0`
+ /// - `rerank-multilingual-v2.0` /// /// /// The search query /// /// - /// A list of document objects or strings to rerank.
- /// If a document is provided the text fields is required and all other fields will be preserved in the response.
- /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
- /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// A list of texts that will be compared to the `query`.
+ /// For optimal performance we recommend against sending more than 1,000 documents in a single request.
+ /// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.
+ /// **Note**: structured data should be formatted as YAML strings for best performance. /// /// - /// The number of most relevant documents or indices to return, defaults to the length of the documents - /// - /// - /// 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. + /// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned. /// /// /// - 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.
/// - 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.
/// Default Value: false /// - /// - /// The maximum number of chunks to produce internally from a document
- /// Default Value: 10 + /// + /// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. /// /// The token to cancel the operation with /// @@ -57,9 +58,8 @@ public partial interface ICohereApi global::System.Collections.Generic.IList> documents, string? xClientName = default, int? topN = default, - global::System.Collections.Generic.IList? rankFields = default, bool? returnDocuments = default, - int? maxChunksPerDoc = default, + int? maxTokensPerDoc = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Cohere/Generated/Cohere.Models.Rerankv2Request.g.cs b/src/libs/Cohere/Generated/Cohere.Models.Rerankv2Request.g.cs index ee21e17d..34c16d40 100644 --- a/src/libs/Cohere/Generated/Cohere.Models.Rerankv2Request.g.cs +++ b/src/libs/Cohere/Generated/Cohere.Models.Rerankv2Request.g.cs @@ -11,7 +11,12 @@ namespace Cohere public sealed partial class Rerankv2Request { /// - /// 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` + /// The identifier of the model to use.
+ /// Supported models:
+ /// - `rerank-english-v3.0`
+ /// - `rerank-multilingual-v3.0`
+ /// - `rerank-english-v2.0`
+ /// - `rerank-multilingual-v2.0` ///
[global::System.Text.Json.Serialization.JsonPropertyName("model")] [global::System.Text.Json.Serialization.JsonRequired] @@ -25,27 +30,21 @@ public sealed partial class Rerankv2Request public required string Query { get; set; } /// - /// A list of document objects or strings to rerank.
- /// If a document is provided the text fields is required and all other fields will be preserved in the response.
- /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
- /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// A list of texts that will be compared to the `query`.
+ /// For optimal performance we recommend against sending more than 1,000 documents in a single request.
+ /// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.
+ /// **Note**: structured data should be formatted as YAML strings for best performance. ///
[global::System.Text.Json.Serialization.JsonPropertyName("documents")] [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.IList> Documents { get; set; } /// - /// The number of most relevant documents or indices to return, defaults to the length of the documents + /// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned. /// [global::System.Text.Json.Serialization.JsonPropertyName("top_n")] public int? TopN { get; set; } - /// - /// 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. - /// - [global::System.Text.Json.Serialization.JsonPropertyName("rank_fields")] - public global::System.Collections.Generic.IList? RankFields { get; set; } - /// /// - 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.
/// - 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.
@@ -55,11 +54,10 @@ public sealed partial class Rerankv2Request public bool? ReturnDocuments { get; set; } /// - /// The maximum number of chunks to produce internally from a document
- /// Default Value: 10 + /// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. ///
- [global::System.Text.Json.Serialization.JsonPropertyName("max_chunks_per_doc")] - public int? MaxChunksPerDoc { get; set; } + [global::System.Text.Json.Serialization.JsonPropertyName("max_tokens_per_doc")] + public int? MaxTokensPerDoc { get; set; } /// /// Additional properties that are not explicitly defined in the schema @@ -71,31 +69,32 @@ public sealed partial class Rerankv2Request /// Initializes a new instance of the class. /// /// - /// 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` + /// The identifier of the model to use.
+ /// Supported models:
+ /// - `rerank-english-v3.0`
+ /// - `rerank-multilingual-v3.0`
+ /// - `rerank-english-v2.0`
+ /// - `rerank-multilingual-v2.0` /// /// /// The search query /// /// - /// A list of document objects or strings to rerank.
- /// If a document is provided the text fields is required and all other fields will be preserved in the response.
- /// The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
- /// We recommend a maximum of 1,000 documents for optimal endpoint performance. + /// A list of texts that will be compared to the `query`.
+ /// For optimal performance we recommend against sending more than 1,000 documents in a single request.
+ /// **Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.
+ /// **Note**: structured data should be formatted as YAML strings for best performance. /// /// - /// The number of most relevant documents or indices to return, defaults to the length of the documents - /// - /// - /// 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. + /// Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned. /// /// /// - 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.
/// - 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.
/// Default Value: false /// - /// - /// The maximum number of chunks to produce internally from a document
- /// Default Value: 10 + /// + /// Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public Rerankv2Request( @@ -103,17 +102,15 @@ public Rerankv2Request( string query, global::System.Collections.Generic.IList> documents, int? topN, - global::System.Collections.Generic.IList? rankFields, bool? returnDocuments, - int? maxChunksPerDoc) + int? maxTokensPerDoc) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Query = query ?? throw new global::System.ArgumentNullException(nameof(query)); this.Documents = documents ?? throw new global::System.ArgumentNullException(nameof(documents)); this.TopN = topN; - this.RankFields = rankFields; this.ReturnDocuments = returnDocuments; - this.MaxChunksPerDoc = maxChunksPerDoc; + this.MaxTokensPerDoc = maxTokensPerDoc; } /// diff --git a/src/libs/Cohere/openapi.yaml b/src/libs/Cohere/openapi.yaml index 6c15509a..a7b818c7 100644 --- a/src/libs/Cohere/openapi.yaml +++ b/src/libs/Cohere/openapi.yaml @@ -8579,7 +8579,7 @@ paths: properties: model: type: string - description: '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`' + description: "The identifier of the model to use. \nSupported models:\n - `rerank-english-v3.0`\n - `rerank-multilingual-v3.0`\n - `rerank-english-v2.0`\n - `rerank-multilingual-v2.0`" x-fern-audiences: - public query: @@ -8593,22 +8593,13 @@ paths: oneOf: - type: string - $ref: '#/components/schemas/RerankDocument' - description: "A list of document objects or strings to rerank.\nIf a document is provided the text fields is required and all other fields will be preserved in the response.\n\nThe total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.\n\nWe recommend a maximum of 1,000 documents for optimal endpoint performance." + description: "A list of texts that will be compared to the `query`.\nFor optimal performance we recommend against sending more than 1,000 documents in a single request.\n\n**Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.\n**Note**: structured data should be formatted as YAML strings for best performance. " x-fern-audiences: - public top_n: minimum: 1 type: integer - description: 'The number of most relevant documents or indices to return, defaults to the length of the documents' - x-fern-audiences: - - public - rank_fields: - type: array - items: - type: string - x-fern-audiences: - - public - description: '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.' + description: 'Limits the returned number of rerank results to the specified value. If not passed, all the rerank results will be returned.' x-fern-audiences: - public return_documents: @@ -8617,10 +8608,9 @@ paths: default: false x-fern-audiences: - public - max_chunks_per_doc: + max_tokens_per_doc: type: integer - description: The maximum number of chunks to produce internally from a document - default: 10 + description: Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. x-fern-audiences: - public x-fern-audiences: