From e3087b884678fb4692540720b6dc328e42dfeead Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Nov 2024 18:25:31 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Groq.AudioClient.CreateTranscription.g.cs | 6 ++--- .../Groq.AudioClient.CreateTranslation.g.cs | 6 ++--- .../Groq.ChatClient.CreateChatCompletion.g.cs | 6 ++--- ...Groq.EmbeddingsClient.CreateEmbedding.g.cs | 6 ++--- ...dels.ChatCompletionRequestUserMessage.g.cs | 2 +- ...oq.Models.CreateChatCompletionRequest.g.cs | 6 ++--- .../Groq.Models.CreateEmbeddingRequest.g.cs | 4 +-- ...roq.Models.CreateTranscriptionRequest.g.cs | 4 +-- .../Groq.Models.CreateTranslationRequest.g.cs | 2 +- .../Groq/Generated/Groq.Models.Embedding.g.cs | 2 +- .../Groq.ModelsClient.DeleteModel.g.cs | 6 ++--- .../Groq.ModelsClient.ListModels.g.cs | 6 ++--- .../Groq.ModelsClient.RetrieveModel.g.cs | 6 ++--- .../JsonConverters.AnyOfFactory2.g.cs | 25 ------------------- .../JsonConverters.OneOfFactory2.g.cs | 25 ------------------- .../Groq/Generated/JsonSerializerContext.g.cs | 12 +++++++-- 16 files changed, 34 insertions(+), 90 deletions(-) delete mode 100644 src/libs/Groq/Generated/JsonConverters.AnyOfFactory2.g.cs delete mode 100644 src/libs/Groq/Generated/JsonConverters.OneOfFactory2.g.cs diff --git a/src/libs/Groq/Generated/Groq.AudioClient.CreateTranscription.g.cs b/src/libs/Groq/Generated/Groq.AudioClient.CreateTranscription.g.cs index 82d8096..6f966ca 100644 --- a/src/libs/Groq/Generated/Groq.AudioClient.CreateTranscription.g.cs +++ b/src/libs/Groq/Generated/Groq.AudioClient.CreateTranscription.g.cs @@ -178,12 +178,10 @@ partial void ProcessCreateTranscriptionResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.CreateTranscriptionResponseJson.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.CreateTranscriptionResponseJson.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.AudioClient.CreateTranslation.g.cs b/src/libs/Groq/Generated/Groq.AudioClient.CreateTranslation.g.cs index 118131b..0eb2c14 100644 --- a/src/libs/Groq/Generated/Groq.AudioClient.CreateTranslation.g.cs +++ b/src/libs/Groq/Generated/Groq.AudioClient.CreateTranslation.g.cs @@ -166,12 +166,10 @@ partial void ProcessCreateTranslationResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.CreateTranslationResponseJson.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.CreateTranslationResponseJson.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.ChatClient.CreateChatCompletion.g.cs b/src/libs/Groq/Generated/Groq.ChatClient.CreateChatCompletion.g.cs index c8fca09..72f0fb8 100644 --- a/src/libs/Groq/Generated/Groq.ChatClient.CreateChatCompletion.g.cs +++ b/src/libs/Groq/Generated/Groq.ChatClient.CreateChatCompletion.g.cs @@ -145,12 +145,10 @@ partial void ProcessCreateChatCompletionResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.CreateChatCompletionResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.CreateChatCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.EmbeddingsClient.CreateEmbedding.g.cs b/src/libs/Groq/Generated/Groq.EmbeddingsClient.CreateEmbedding.g.cs index e67bcaf..c694a50 100644 --- a/src/libs/Groq/Generated/Groq.EmbeddingsClient.CreateEmbedding.g.cs +++ b/src/libs/Groq/Generated/Groq.EmbeddingsClient.CreateEmbedding.g.cs @@ -145,12 +145,10 @@ partial void ProcessCreateEmbeddingResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.CreateEmbeddingResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.CreateEmbeddingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.Models.ChatCompletionRequestUserMessage.g.cs b/src/libs/Groq/Generated/Groq.Models.ChatCompletionRequestUserMessage.g.cs index 39c5d2d..fa5b999 100644 --- a/src/libs/Groq/Generated/Groq.Models.ChatCompletionRequestUserMessage.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.ChatCompletionRequestUserMessage.g.cs @@ -14,7 +14,7 @@ public sealed partial class ChatCompletionRequestUserMessage /// The contents of the user message. /// [global::System.Text.Json.Serialization.JsonPropertyName("content")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.OneOf> Content { get; set; } diff --git a/src/libs/Groq/Generated/Groq.Models.CreateChatCompletionRequest.g.cs b/src/libs/Groq/Generated/Groq.Models.CreateChatCompletionRequest.g.cs index 8798eda..3bfa6dc 100644 --- a/src/libs/Groq/Generated/Groq.Models.CreateChatCompletionRequest.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.CreateChatCompletionRequest.g.cs @@ -26,7 +26,7 @@ public sealed partial class CreateChatCompletionRequest /// `none` is the default when no functions are present. `auto` is the default if functions are present. /// [global::System.Text.Json.Serialization.JsonPropertyName("function_call")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter))] public global::Groq.OneOf? FunctionCall { get; set; } /// @@ -69,7 +69,7 @@ public sealed partial class CreateChatCompletionRequest /// ID of the model to use. For details on which models are compatible with the Chat API, see available [models](/docs/models) /// [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.AnyOf Model { get; set; } @@ -115,7 +115,7 @@ public sealed partial class CreateChatCompletionRequest /// Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. /// [global::System.Text.Json.Serialization.JsonPropertyName("stop")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter>))] public global::Groq.OneOf>? Stop { get; set; } /// diff --git a/src/libs/Groq/Generated/Groq.Models.CreateEmbeddingRequest.g.cs b/src/libs/Groq/Generated/Groq.Models.CreateEmbeddingRequest.g.cs index 79764f6..2d3789b 100644 --- a/src/libs/Groq/Generated/Groq.Models.CreateEmbeddingRequest.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.CreateEmbeddingRequest.g.cs @@ -26,7 +26,7 @@ public sealed partial class CreateEmbeddingRequest /// /// The quick brown fox jumped over the lazy dog [global::System.Text.Json.Serialization.JsonPropertyName("input")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.OneOf> Input { get; set; } @@ -36,7 +36,7 @@ public sealed partial class CreateEmbeddingRequest /// /// nomic-embed-text-v1_5 [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.AnyOf Model { get; set; } diff --git a/src/libs/Groq/Generated/Groq.Models.CreateTranscriptionRequest.g.cs b/src/libs/Groq/Generated/Groq.Models.CreateTranscriptionRequest.g.cs index 6a63fe4..c6d5650 100644 --- a/src/libs/Groq/Generated/Groq.Models.CreateTranscriptionRequest.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.CreateTranscriptionRequest.g.cs @@ -28,7 +28,7 @@ public sealed partial class CreateTranscriptionRequest /// The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will improve accuracy and latency. /// [global::System.Text.Json.Serialization.JsonPropertyName("language")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter))] public global::Groq.AnyOf? Language { get; set; } /// @@ -37,7 +37,7 @@ public sealed partial class CreateTranscriptionRequest /// /// whisper-large-v3 [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.AnyOf Model { get; set; } diff --git a/src/libs/Groq/Generated/Groq.Models.CreateTranslationRequest.g.cs b/src/libs/Groq/Generated/Groq.Models.CreateTranslationRequest.g.cs index b159f3d..2003d80 100644 --- a/src/libs/Groq/Generated/Groq.Models.CreateTranslationRequest.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.CreateTranslationRequest.g.cs @@ -30,7 +30,7 @@ public sealed partial class CreateTranslationRequest /// /// whisper-1 [global::System.Text.Json.Serialization.JsonPropertyName("model")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.AnyOfJsonConverter))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.AnyOf Model { get; set; } diff --git a/src/libs/Groq/Generated/Groq.Models.Embedding.g.cs b/src/libs/Groq/Generated/Groq.Models.Embedding.g.cs index 82a6c7f..9f3fc4c 100644 --- a/src/libs/Groq/Generated/Groq.Models.Embedding.g.cs +++ b/src/libs/Groq/Generated/Groq.Models.Embedding.g.cs @@ -14,7 +14,7 @@ public sealed partial class Embedding /// /// [global::System.Text.Json.Serialization.JsonPropertyName("embedding")] - [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2))] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Groq.JsonConverters.OneOfJsonConverter, string>))] [global::System.Text.Json.Serialization.JsonRequired] public required global::Groq.OneOf, string> Embedding1 { get; set; } diff --git a/src/libs/Groq/Generated/Groq.ModelsClient.DeleteModel.g.cs b/src/libs/Groq/Generated/Groq.ModelsClient.DeleteModel.g.cs index 013683a..3ca152d 100644 --- a/src/libs/Groq/Generated/Groq.ModelsClient.DeleteModel.g.cs +++ b/src/libs/Groq/Generated/Groq.ModelsClient.DeleteModel.g.cs @@ -138,12 +138,10 @@ partial void ProcessDeleteModelResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.DeleteModelResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.DeleteModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.ModelsClient.ListModels.g.cs b/src/libs/Groq/Generated/Groq.ModelsClient.ListModels.g.cs index d87a6c4..8c1ad2f 100644 --- a/src/libs/Groq/Generated/Groq.ModelsClient.ListModels.g.cs +++ b/src/libs/Groq/Generated/Groq.ModelsClient.ListModels.g.cs @@ -132,12 +132,10 @@ partial void ProcessListModelsResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.ListModelsResponse.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.ListModelsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/Groq.ModelsClient.RetrieveModel.g.cs b/src/libs/Groq/Generated/Groq.ModelsClient.RetrieveModel.g.cs index 7f3d9a0..a6fa382 100644 --- a/src/libs/Groq/Generated/Groq.ModelsClient.RetrieveModel.g.cs +++ b/src/libs/Groq/Generated/Groq.ModelsClient.RetrieveModel.g.cs @@ -138,12 +138,10 @@ partial void ProcessRetrieveModelResponseContent( }; } - using var __responseStream = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); - - var __responseValue = await global::Groq.Model5.FromJsonStreamAsync(__responseStream, JsonSerializerContext).ConfigureAwait(false); + using var __content = await __response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); return - __responseValue ?? + await global::Groq.Model5.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? throw new global::System.InvalidOperationException("Response deserialization failed."); } } diff --git a/src/libs/Groq/Generated/JsonConverters.AnyOfFactory2.g.cs b/src/libs/Groq/Generated/JsonConverters.AnyOfFactory2.g.cs deleted file mode 100644 index b94f183..0000000 --- a/src/libs/Groq/Generated/JsonConverters.AnyOfFactory2.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace Groq.JsonConverters -{ - /// - public sealed class AnyOfJsonConverterFactory2 : global::System.Text.Json.Serialization.JsonConverterFactory - { - /// - public override bool CanConvert(global::System.Type? typeToConvert) - { - return typeToConvert is { IsGenericType: true } && typeToConvert.GetGenericTypeDefinition() == typeof(global::Groq.AnyOf<,>); - } - - /// - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - typeToConvert = typeToConvert ?? throw new global::System.ArgumentNullException(nameof(typeToConvert)); - - return (global::System.Text.Json.Serialization.JsonConverter)global::System.Activator.CreateInstance( - typeof(AnyOfJsonConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments))!; - } - } -} diff --git a/src/libs/Groq/Generated/JsonConverters.OneOfFactory2.g.cs b/src/libs/Groq/Generated/JsonConverters.OneOfFactory2.g.cs deleted file mode 100644 index f826828..0000000 --- a/src/libs/Groq/Generated/JsonConverters.OneOfFactory2.g.cs +++ /dev/null @@ -1,25 +0,0 @@ -#nullable enable - -namespace Groq.JsonConverters -{ - /// - public sealed class OneOfJsonConverterFactory2 : global::System.Text.Json.Serialization.JsonConverterFactory - { - /// - public override bool CanConvert(global::System.Type? typeToConvert) - { - return typeToConvert is { IsGenericType: true } && typeToConvert.GetGenericTypeDefinition() == typeof(global::Groq.OneOf<,>); - } - - /// - public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( - global::System.Type typeToConvert, - global::System.Text.Json.JsonSerializerOptions options) - { - typeToConvert = typeToConvert ?? throw new global::System.ArgumentNullException(nameof(typeToConvert)); - - return (global::System.Text.Json.Serialization.JsonConverter)global::System.Activator.CreateInstance( - typeof(OneOfJsonConverter<,>).MakeGenericType(typeToConvert.GenericTypeArguments))!; - } - } -} diff --git a/src/libs/Groq/Generated/JsonSerializerContext.g.cs b/src/libs/Groq/Generated/JsonSerializerContext.g.cs index 3d56329..5b76fe5 100644 --- a/src/libs/Groq/Generated/JsonSerializerContext.g.cs +++ b/src/libs/Groq/Generated/JsonSerializerContext.g.cs @@ -88,10 +88,18 @@ namespace Groq typeof(global::Groq.JsonConverters.ListModelsResponseObjectJsonConverter), typeof(global::Groq.JsonConverters.ListModelsResponseObjectNullableJsonConverter), typeof(global::Groq.JsonConverters.ChatCompletionRequestMessageJsonConverter), - typeof(global::Groq.JsonConverters.OneOfJsonConverterFactory2), typeof(global::Groq.JsonConverters.ChatCompletionRequestMessageContentPartJsonConverter), typeof(global::Groq.JsonConverters.ChatCompletionToolChoiceOptionJsonConverter), - typeof(global::Groq.JsonConverters.AnyOfJsonConverterFactory2), + typeof(global::Groq.JsonConverters.OneOfJsonConverter>), + typeof(global::Groq.JsonConverters.OneOfJsonConverter), + typeof(global::Groq.JsonConverters.AnyOfJsonConverter), + typeof(global::Groq.JsonConverters.OneOfJsonConverter>), + typeof(global::Groq.JsonConverters.OneOfJsonConverter>), + typeof(global::Groq.JsonConverters.AnyOfJsonConverter), + typeof(global::Groq.JsonConverters.OneOfJsonConverter, string>), + typeof(global::Groq.JsonConverters.AnyOfJsonConverter), + typeof(global::Groq.JsonConverters.AnyOfJsonConverter), + typeof(global::Groq.JsonConverters.AnyOfJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Groq.JsonSerializerContextTypes))]