From 1b7c8faae13d57a0ccca45670e99a2ef0c7caf2f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Dec 2024 12:47:52 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../AI21.Ai21Api.V1ConversationalRag.g.cs | 5 ++ .../AI21.IAi21Api.V1ConversationalRag.g.cs | 4 + ...yManagementClient.V1LibraryManagement.g.cs | 2 +- ...yManagementClient.V1LibraryManagement.g.cs | 2 +- .../AI21.Models.ConversationalRagConfig.g.cs | 14 ++- ...nversationalRagConfigResponseLanguage.g.cs | 87 +++++++++++++++++++ ...nversationalRagConfigResponseLanguage.g.cs | 49 +++++++++++ ...onalRagConfigResponseLanguageNullable.g.cs | 56 ++++++++++++ .../AI21/Generated/JsonSerializerContext.g.cs | 2 + .../Generated/JsonSerializerContextTypes.g.cs | 52 ++++++----- src/libs/AI21/openapi.yaml | 15 +++- 11 files changed, 260 insertions(+), 28 deletions(-) create mode 100644 src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs create mode 100644 src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguage.g.cs create mode 100644 src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguageNullable.g.cs diff --git a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs index b77c449..be4dc13 100644 --- a/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs +++ b/src/libs/AI21/Generated/AI21.Ai21Api.V1ConversationalRag.g.cs @@ -221,6 +221,9 @@ partial void ProcessV1ConversationalRagResponseContent( /// /// Default Value: 0.98 /// + /// + /// Default Value: english + /// /// The token to cancel the operation with /// public async global::System.Threading.Tasks.Task V1ConversationalRagAsync( @@ -234,6 +237,7 @@ partial void ProcessV1ConversationalRagResponseContent( double? retrievalSimilarityThreshold = default, int? maxNeighbors = default, double? hybridSearchAlpha = default, + global::AI21.ConversationalRagConfigResponseLanguage? responseLanguage = default, global::System.Threading.CancellationToken cancellationToken = default) { var __request = new global::AI21.ConversationalRagConfig @@ -247,6 +251,7 @@ partial void ProcessV1ConversationalRagResponseContent( RetrievalSimilarityThreshold = retrievalSimilarityThreshold, MaxNeighbors = maxNeighbors, HybridSearchAlpha = hybridSearchAlpha, + ResponseLanguage = responseLanguage, }; return await V1ConversationalRagAsync( diff --git a/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs b/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs index 76a51b9..1a4908b 100644 --- a/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs +++ b/src/libs/AI21/Generated/AI21.IAi21Api.V1ConversationalRag.g.cs @@ -43,6 +43,9 @@ public partial interface IAi21Api /// /// Default Value: 0.98 /// + /// + /// Default Value: english + /// /// The token to cancel the operation with /// global::System.Threading.Tasks.Task V1ConversationalRagAsync( @@ -56,6 +59,7 @@ public partial interface IAi21Api double? retrievalSimilarityThreshold = default, int? maxNeighbors = default, double? hybridSearchAlpha = default, + global::AI21.ConversationalRagConfigResponseLanguage? responseLanguage = default, global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs index 3d59fdd..8862879 100644 --- a/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.ILibraryManagementClient.V1LibraryManagement.g.cs @@ -19,7 +19,7 @@ public partial interface ILibraryManagementClient /// /// /// - /// Default Value: 1000 + /// Default Value: 10000 /// /// /// The token to cancel the operation with diff --git a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs index b531d31..a4a2661 100644 --- a/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs +++ b/src/libs/AI21/Generated/AI21.LibraryManagementClient.V1LibraryManagement.g.cs @@ -48,7 +48,7 @@ partial void ProcessV1LibraryManagementResponseContent( /// /// /// - /// Default Value: 1000 + /// Default Value: 10000 /// /// /// The token to cancel the operation with diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs index 99644f6..4a272c0 100644 --- a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfig.g.cs @@ -64,6 +64,13 @@ public sealed partial class ConversationalRagConfig [global::System.Text.Json.Serialization.JsonPropertyName("hybrid_search_alpha")] public double? HybridSearchAlpha { get; set; } + /// + /// Default Value: english + /// + [global::System.Text.Json.Serialization.JsonPropertyName("response_language")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::AI21.JsonConverters.ConversationalRagConfigResponseLanguageJsonConverter))] + public global::AI21.ConversationalRagConfigResponseLanguage? ResponseLanguage { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -92,6 +99,9 @@ public sealed partial class ConversationalRagConfig /// /// Default Value: 0.98 /// + /// + /// Default Value: english + /// [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] public ConversationalRagConfig( global::System.Collections.Generic.IList messages, @@ -102,7 +112,8 @@ public ConversationalRagConfig( global::AI21.ConversationalRagConfigRetrievalStrategy? retrievalStrategy, double? retrievalSimilarityThreshold, int? maxNeighbors, - double? hybridSearchAlpha) + double? hybridSearchAlpha, + global::AI21.ConversationalRagConfigResponseLanguage? responseLanguage) { this.Messages = messages ?? throw new global::System.ArgumentNullException(nameof(messages)); this.Path = path; @@ -113,6 +124,7 @@ public ConversationalRagConfig( this.RetrievalSimilarityThreshold = retrievalSimilarityThreshold; this.MaxNeighbors = maxNeighbors; this.HybridSearchAlpha = hybridSearchAlpha; + this.ResponseLanguage = responseLanguage; } /// diff --git a/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs new file mode 100644 index 0000000..2e69ef5 --- /dev/null +++ b/src/libs/AI21/Generated/AI21.Models.ConversationalRagConfigResponseLanguage.g.cs @@ -0,0 +1,87 @@ + +#nullable enable + +namespace AI21 +{ + /// + /// Default Value: english + /// + public enum ConversationalRagConfigResponseLanguage + { + /// + /// + /// + Dutch, + /// + /// + /// + English, + /// + /// + /// + French, + /// + /// + /// + German, + /// + /// + /// + Hebrew, + /// + /// + /// + Italian, + /// + /// + /// + Portuguese, + /// + /// + /// + Spanish, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class ConversationalRagConfigResponseLanguageExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this ConversationalRagConfigResponseLanguage value) + { + return value switch + { + ConversationalRagConfigResponseLanguage.Dutch => "dutch", + ConversationalRagConfigResponseLanguage.English => "english", + ConversationalRagConfigResponseLanguage.French => "french", + ConversationalRagConfigResponseLanguage.German => "german", + ConversationalRagConfigResponseLanguage.Hebrew => "hebrew", + ConversationalRagConfigResponseLanguage.Italian => "italian", + ConversationalRagConfigResponseLanguage.Portuguese => "portuguese", + ConversationalRagConfigResponseLanguage.Spanish => "spanish", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static ConversationalRagConfigResponseLanguage? ToEnum(string value) + { + return value switch + { + "dutch" => ConversationalRagConfigResponseLanguage.Dutch, + "english" => ConversationalRagConfigResponseLanguage.English, + "french" => ConversationalRagConfigResponseLanguage.French, + "german" => ConversationalRagConfigResponseLanguage.German, + "hebrew" => ConversationalRagConfigResponseLanguage.Hebrew, + "italian" => ConversationalRagConfigResponseLanguage.Italian, + "portuguese" => ConversationalRagConfigResponseLanguage.Portuguese, + "spanish" => ConversationalRagConfigResponseLanguage.Spanish, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguage.g.cs b/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguage.g.cs new file mode 100644 index 0000000..506d74e --- /dev/null +++ b/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguage.g.cs @@ -0,0 +1,49 @@ +#nullable enable + +namespace AI21.JsonConverters +{ + /// + public sealed class ConversationalRagConfigResponseLanguageJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::AI21.ConversationalRagConfigResponseLanguage Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::AI21.ConversationalRagConfigResponseLanguageExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::AI21.ConversationalRagConfigResponseLanguage)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::AI21.ConversationalRagConfigResponseLanguage value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::AI21.ConversationalRagConfigResponseLanguageExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguageNullable.g.cs b/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguageNullable.g.cs new file mode 100644 index 0000000..fc3acf9 --- /dev/null +++ b/src/libs/AI21/Generated/JsonConverters.ConversationalRagConfigResponseLanguageNullable.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace AI21.JsonConverters +{ + /// + public sealed class ConversationalRagConfigResponseLanguageNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::AI21.ConversationalRagConfigResponseLanguage? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::AI21.ConversationalRagConfigResponseLanguageExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::AI21.ConversationalRagConfigResponseLanguage)numValue; + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::AI21.ConversationalRagConfigResponseLanguage? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::AI21.ConversationalRagConfigResponseLanguageExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/AI21/Generated/JsonSerializerContext.g.cs b/src/libs/AI21/Generated/JsonSerializerContext.g.cs index e416d96..228a329 100644 --- a/src/libs/AI21/Generated/JsonSerializerContext.g.cs +++ b/src/libs/AI21/Generated/JsonSerializerContext.g.cs @@ -41,6 +41,8 @@ namespace AI21 typeof(global::AI21.JsonConverters.MessageRoleNullableJsonConverter), typeof(global::AI21.JsonConverters.ConversationalRagConfigRetrievalStrategyJsonConverter), typeof(global::AI21.JsonConverters.ConversationalRagConfigRetrievalStrategyNullableJsonConverter), + typeof(global::AI21.JsonConverters.ConversationalRagConfigResponseLanguageJsonConverter), + typeof(global::AI21.JsonConverters.ConversationalRagConfigResponseLanguageNullableJsonConverter), typeof(global::AI21.JsonConverters.FileStatusJsonConverter), typeof(global::AI21.JsonConverters.FileStatusNullableJsonConverter), typeof(global::AI21.JsonConverters.LibrarySearchRequestLabelsFilterModeJsonConverter), diff --git a/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs b/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs index 9efb5cd..cecdf60 100644 --- a/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs +++ b/src/libs/AI21/Generated/JsonSerializerContextTypes.g.cs @@ -290,98 +290,102 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::AI21.ConversationalRagResult? Type68 { get; set; } + public global::AI21.ConversationalRagConfigResponseLanguage? Type68 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type69 { get; set; } + public global::AI21.ConversationalRagResult? Type69 { get; set; } /// /// /// - public global::AI21.ConversationalRagSource? Type70 { get; set; } + public global::System.Collections.Generic.IList? Type70 { get; set; } /// /// /// - public global::AI21.FileResponse? Type71 { get; set; } + public global::AI21.ConversationalRagSource? Type71 { get; set; } /// /// /// - public global::System.Guid? Type72 { get; set; } + public global::AI21.FileResponse? Type72 { get; set; } /// /// /// - public global::System.DateTime? Type73 { get; set; } + public global::System.Guid? Type73 { get; set; } /// /// /// - public global::AI21.FileStatus? Type74 { get; set; } + public global::System.DateTime? Type74 { get; set; } /// /// /// - public global::AI21.FilesUpdateRequest? Type75 { get; set; } + public global::AI21.FileStatus? Type75 { get; set; } /// /// /// - public global::AI21.HTTPValidationError? Type76 { get; set; } + public global::AI21.FilesUpdateRequest? Type76 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type77 { get; set; } + public global::AI21.HTTPValidationError? Type77 { get; set; } /// /// /// - public global::AI21.ValidationError? Type78 { get; set; } + public global::System.Collections.Generic.IList? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type79 { get; set; } + public global::AI21.ValidationError? Type79 { get; set; } /// /// /// - public global::AI21.AnyOf? Type80 { get; set; } + public global::System.Collections.Generic.IList>? Type80 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequest? Type81 { get; set; } + public global::AI21.AnyOf? Type81 { get; set; } /// /// /// - public global::AI21.QueryFilter? Type82 { get; set; } + public global::AI21.LibrarySearchRequest? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary>? Type83 { get; set; } + public global::AI21.QueryFilter? Type83 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type84 { get; set; } + public global::System.Collections.Generic.Dictionary>? Type84 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type85 { get; set; } + public global::System.Collections.Generic.IList? Type85 { get; set; } /// /// /// - public global::AI21.LibrarySearchRequestLabelsFilterMode? Type86 { get; set; } + public global::System.Collections.Generic.Dictionary? Type86 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type87 { get; set; } + public global::AI21.LibrarySearchRequestLabelsFilterMode? Type87 { get; set; } /// /// /// - public global::AI21.RetrievalStrategy? Type88 { get; set; } + public global::System.Collections.Generic.IList? Type88 { get; set; } /// /// /// - public global::AI21.AnyOf>? Type89 { get; set; } + public global::AI21.RetrievalStrategy? Type89 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type90 { get; set; } + public global::AI21.AnyOf>? Type90 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type91 { get; set; } + public global::System.Collections.Generic.IList? Type91 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type92 { get; set; } } } \ No newline at end of file diff --git a/src/libs/AI21/openapi.yaml b/src/libs/AI21/openapi.yaml index 4c4474d..d5de861 100644 --- a/src/libs/AI21/openapi.yaml +++ b/src/libs/AI21/openapi.yaml @@ -143,7 +143,7 @@ paths: schema: title: Limit type: integer - default: 1000 + default: 10000 - name: offset in: query schema: @@ -902,6 +902,19 @@ components: title: Hybrid Search Alpha type: number default: 0.98 + response_language: + title: Response Language + enum: + - dutch + - english + - french + - german + - hebrew + - italian + - portuguese + - spanish + type: string + default: english description: This class is to be used as a common class to all Studio API requests payloads ConversationalRagResult: title: ConversationalRagResult