From 0aebf338084e453e8d1105a9437d711a5549e0be Mon Sep 17 00:00:00 2001 From: HavenDV Date: Sun, 16 Jun 2024 18:38:22 +0400 Subject: [PATCH] feat: Added smart names for Named AnyOf with all referenced properties. --- .../Extensions/OpenApiExtensions.cs | 26 + .../OpenApiGenerator.Core/Generation/Data.cs | 18 +- .../Generation/Sources.AnyOf.cs | 26 +- .../Sources.JsonConverters.AnyOf.cs | 8 +- .../Generation/Sources.cs | 2 +- .../Helpers/SmartNamedAnyOfNames.cs | 33 + .../OpenApiGenerator.Core/Models/AnyOfData.cs | 2 +- ....Models.AssistantStreamEvent.g.verified.cs | 134 +- ...ChatCompletionRequestMessage.g.verified.cs | 112 +- ...ionRequestMessageContentPart.g.verified.cs | 46 +- ...ChunkingStrategyRequestParam.g.verified.cs | 46 +- ....Models.AssistantStreamEvent.g.verified.cs | 134 +- ...ChatCompletionRequestMessage.g.verified.cs | 112 +- ...ionRequestMessageContentPart.g.verified.cs | 46 +- ...ChunkingStrategyRequestParam.g.verified.cs | 46 +- ...verters.AssistantStreamEvent.g.verified.cs | 72 +- ...ChatCompletionRequestMessage.g.verified.cs | 60 +- ...ionRequestMessageContentPart.g.verified.cs | 24 +- ...ChunkingStrategyRequestParam.g.verified.cs | 24 +- .../Snapshots/LangSmith/AnyOfs/_.verified.txt | 6 +- .../Snapshots/Ollama/AnyOfs/_.verified.txt | 386 ++-- .../Snapshots/OpenAi/AnyOfs/_.verified.txt | 1900 +++++++++++------ .../Tests.SmartNamedAnyOfNames.cs | 15 + 23 files changed, 1969 insertions(+), 1309 deletions(-) create mode 100644 src/libs/OpenApiGenerator.Core/Helpers/SmartNamedAnyOfNames.cs create mode 100644 src/tests/OpenApiGenerator.UnitTests/Tests.SmartNamedAnyOfNames.cs diff --git a/src/libs/OpenApiGenerator.Core/Extensions/OpenApiExtensions.cs b/src/libs/OpenApiGenerator.Core/Extensions/OpenApiExtensions.cs index e8fb1ffa52..07beb1b574 100644 --- a/src/libs/OpenApiGenerator.Core/Extensions/OpenApiExtensions.cs +++ b/src/libs/OpenApiGenerator.Core/Extensions/OpenApiExtensions.cs @@ -1,8 +1,10 @@ +using System.Collections.Immutable; using System.Globalization; using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Readers; +using OpenApiGenerator.Core.Helpers; using OpenApiGenerator.Core.Json; using OpenApiGenerator.Core.Models; using OpenApiGenerator.Core.Naming.Methods; @@ -198,6 +200,30 @@ public static bool IsObjectWithoutReference( schema.Enum.Any()); } + public static ImmutableArray ToAnyOfProperties( + this IList schemas, + Settings settings, + string key) + { + var useSmartNames = schemas.All(x => x.Reference != null); + var className = key.ToClassName(); + + return schemas.Select((x, i) => + { + var type = TypeData.FromSchema(x.UseReferenceIdOrKey(key + $"Variant{i + 1}"), settings); + + return PropertyData.Default with + { + Name = useSmartNames + ? SmartNamedAnyOfNames.ComputeSmartName( + type.ShortCSharpTypeWithoutNullability, + className) + : $"Value{i + 1}", + Type = type, + }; + }).ToImmutableArray(); + } + public static bool IsEnum( this OpenApiSchema schema) { diff --git a/src/libs/OpenApiGenerator.Core/Generation/Data.cs b/src/libs/OpenApiGenerator.Core/Generation/Data.cs index 6fd7204524..2bc9acff0f 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Data.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Data.cs @@ -198,26 +198,26 @@ .. includedTags.Select(x => PropertyData.Default with .ToArray() : []; var anyOfs = allSchemas .Where(x => x.AnyOf is { Count: > 0 }) - .Select(x => new AnyOfData("AnyOf", x.AnyOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) + .Select(x => new AnyOfData("AnyOf", x.AnyOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) .Concat(allSchemas .Where(x => x.Items?.AnyOf is { Count: > 0 }) - .Select(x => new AnyOfData("AnyOf", x.Items.AnyOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) + .Select(x => new AnyOfData("AnyOf", x.Items.AnyOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) .Distinct() .ToImmutableArray(); var oneOfs = allSchemas .Where(x => x.OneOf is { Count: > 0 }) - .Select(x => new AnyOfData("OneOf", x.OneOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) + .Select(x => new AnyOfData("OneOf", x.OneOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) .Concat(allSchemas .Where(x => x.Items?.OneOf is { Count: > 0 }) - .Select(x => new AnyOfData("OneOf", x.Items.OneOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) + .Select(x => new AnyOfData("OneOf", x.Items.OneOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) .Distinct() .ToImmutableArray(); var allOfs = allSchemas .Where(x => x.AllOf is { Count: > 0 }) - .Select(x => new AnyOfData("AllOf", x.AllOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) + .Select(x => new AnyOfData("AllOf", x.AllOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty)) .Concat(allSchemas .Where(x => x.Items?.AllOf is { Count: > 0 }) - .Select(x => new AnyOfData("AllOf", x.Items.AllOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) + .Select(x => new AnyOfData("AllOf", x.Items.AllOf.Count, settings.JsonSerializerType, isTrimming, "System", string.Empty, string.Empty, ImmutableArray.Empty))) .Distinct() .ToImmutableArray(); anyOfs = settings.GenerateSdk || settings.GenerateModels ? anyOfs @@ -231,7 +231,7 @@ .. includedTags.Select(x => PropertyData.Default with settings.Namespace, schema.Key.ToClassName(), schema.Value.GetSummary(), - schema.Value.AnyOf.Select((x, i) => TypeData.FromSchema(x.UseReferenceIdOrKey(schema.Key + $"Variant{i + 1}"), settings)).ToImmutableArray()))) + schema.Value.AnyOf.ToAnyOfProperties(settings, schema.Key)))) .ToImmutableArray() : []; oneOfs = settings.GenerateSdk || settings.GenerateModels ? oneOfs .Concat(includedSchemas @@ -244,7 +244,7 @@ .. includedTags.Select(x => PropertyData.Default with settings.Namespace, schema.Key.ToClassName(), schema.Value.GetSummary(), - schema.Value.OneOf.Select((x, i) => TypeData.FromSchema(x.UseReferenceIdOrKey(schema.Key + $"Variant{i + 1}"), settings)).ToImmutableArray()))) + schema.Value.OneOf.ToAnyOfProperties(settings, schema.Key)))) .ToImmutableArray() : []; allOfs = settings.GenerateSdk || settings.GenerateModels ? allOfs .Concat(includedSchemas @@ -257,7 +257,7 @@ .. includedTags.Select(x => PropertyData.Default with settings.Namespace, schema.Key.ToClassName(), schema.Value.GetSummary(), - schema.Value.AllOf.Select((x, i) => TypeData.FromSchema(x.UseReferenceIdOrKey(schema.Key + $"Variant{i + 1}"), settings)).ToImmutableArray()))) + schema.Value.AllOf.ToAnyOfProperties(settings, schema.Key)))) .ToImmutableArray() : []; AnyOfData[] anyOfDatas = diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.AnyOf.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.AnyOf.cs index 7c6834e705..ec6b5e72f8 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Sources.AnyOf.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.AnyOf.cs @@ -12,14 +12,6 @@ public static string GenerateAnyOf( { var (subType, count, _, _, @namespace, className, summary, fixedTypes) = anyOfData; var types = $"<{string.Join(", ", Enumerable.Range(1, count).Select(x => $"T{x}"))}>"; - var validation = subType switch - { - "AnyOf" => string.Join(" || ", Enumerable.Range(1, count).Select(x => $"IsValue{x}")), - "OneOf" => string.Join(" || ", Enumerable.Range(1, count).Select(x => - string.Join(" && ", Enumerable.Range(1, count).Select(y => $"{(y == x ? "!" : "")}IsValue{y}")))), - "AllOf" => string.Join(" && ", Enumerable.Range(1, count).Select(x => $"IsValue{x}")), - _ => throw new NotImplementedException(), - }; var classNameWithoutTypes = string.IsNullOrWhiteSpace(className) ? $"{subType}" : className; @@ -38,21 +30,25 @@ public static string GenerateAnyOf( }, }) .ToImmutableArray() - : fixedTypes.Select((type, i) => PropertyData.Default with - { - Name = $"Value{i + 1}", - Type = type, - }).ToImmutableArray(); + : fixedTypes; + var validation = subType switch + { + "AnyOf" => string.Join(" || ", allTypes.Select(x => $"Is{x.Name}")), + "OneOf" => string.Join(" || ", allTypes.Select((x, xi) => + string.Join(" && ", allTypes.Select((y, yi) => $"{(yi == xi ? "!" : "")}Is{y.Name}")))), + "AllOf" => string.Join(" && ", allTypes.Select(x => $"Is{x.Name}")), + _ => throw new NotImplementedException(), + }; var constructorWithAllValues = count > 1 ? $@" {string.Empty.ToXmlDocumentationSummary(level: 8)} public {classNameWithoutTypes}( {allTypes.Select(x => $@" - {x.Type.CSharpTypeWithNullability} {x.Name.ToParameterName()}, + {x.Type.CSharpTypeWithNullability} {x.ParameterName}, ").Inject().TrimEnd(',', '\n')} ) {{ {allTypes.Select(x => $@" - {x.Name} = {x.Name.ToParameterName()}; + {x.Name} = {x.ParameterName}; ").Inject()} }}" : " "; diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.AnyOf.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.AnyOf.cs index 06b953c781..74476d019b 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.AnyOf.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.JsonConverters.AnyOf.cs @@ -12,7 +12,7 @@ public static string GenerateAnyOfJsonConverter( CancellationToken cancellationToken = default) { var (subType, count, jsonSerializerType, isTrimming, @namespace, name, _, fixedTypes) = anyOfData; - if (jsonSerializerType == JsonSerializerType.NewtonsoftJson) + if (jsonSerializerType != JsonSerializerType.SystemTextJson) { return string.Empty; } @@ -36,11 +36,7 @@ public static string GenerateAnyOfJsonConverter( }, }) .ToImmutableArray() - : fixedTypes.Select((type, i) => PropertyData.Default with - { - Name = $"Value{i + 1}", - Type = type, - }).ToImmutableArray(); + : fixedTypes; return $@"#nullable enable {(fixedTypes.IsEmpty ? "" : @"#pragma warning disable CS0618 // Type or member is obsolete diff --git a/src/libs/OpenApiGenerator.Core/Generation/Sources.cs b/src/libs/OpenApiGenerator.Core/Generation/Sources.cs index d9930d543f..6ac4031867 100644 --- a/src/libs/OpenApiGenerator.Core/Generation/Sources.cs +++ b/src/libs/OpenApiGenerator.Core/Generation/Sources.cs @@ -80,7 +80,7 @@ public static FileWithName AnyOfJsonConverterFactory( CancellationToken cancellationToken = default) { if (anyOf.JsonSerializerType == JsonSerializerType.NewtonsoftJson || - !anyOf.Types.IsEmpty) + !anyOf.Properties.IsEmpty) { return FileWithName.Empty; } diff --git a/src/libs/OpenApiGenerator.Core/Helpers/SmartNamedAnyOfNames.cs b/src/libs/OpenApiGenerator.Core/Helpers/SmartNamedAnyOfNames.cs new file mode 100644 index 0000000000..bf96425220 --- /dev/null +++ b/src/libs/OpenApiGenerator.Core/Helpers/SmartNamedAnyOfNames.cs @@ -0,0 +1,33 @@ +namespace OpenApiGenerator.Core.Helpers; + +public static class SmartNamedAnyOfNames +{ + public static string ComputeSmartName(string typeName, string className) + { + var nameWords = SplitToWordsByUpperCharacters(typeName); + var classNameWords = SplitToWordsByUpperCharacters(className); + + // Combine the unique strings from both collections + return string.Concat( + nameWords.Except(classNameWords)); + } + + public static IReadOnlyList SplitToWordsByUpperCharacters(string text) + { + text = text ?? throw new ArgumentNullException(nameof(text)); + + var words = new List(); + var startIndex = 0; + for (var i = 1; i < text.Length; i++) + { + if (char.IsUpper(text[i])) + { + words.Add(text.Substring(startIndex, i - startIndex)); + startIndex = i; + } + } + words.Add(text.Substring(startIndex)); + + return words; + } +} \ No newline at end of file diff --git a/src/libs/OpenApiGenerator.Core/Models/AnyOfData.cs b/src/libs/OpenApiGenerator.Core/Models/AnyOfData.cs index 49a4c299e4..e42e911d9c 100644 --- a/src/libs/OpenApiGenerator.Core/Models/AnyOfData.cs +++ b/src/libs/OpenApiGenerator.Core/Models/AnyOfData.cs @@ -11,5 +11,5 @@ public readonly record struct AnyOfData( string Namespace, string Name, string Summary, - ImmutableArray Types + ImmutableArray Properties ); \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.AssistantStreamEvent.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.AssistantStreamEvent.g.verified.cs index f1ae00d85d..7e97337832 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.AssistantStreamEvent.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.AssistantStreamEvent.g.verified.cs @@ -29,18 +29,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ThreadStreamEvent? Value1 { get; init; } + public global::G.ThreadStreamEvent? Thread { get; init; } #else - public global::G.ThreadStreamEvent? Value1 { get; } + public global::G.ThreadStreamEvent? Thread { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Thread))] #endif - public bool IsValue1 => Value1 != null; + public bool IsThread => Thread != null; /// /// @@ -50,32 +50,32 @@ namespace G /// /// /// - public static implicit operator global::G.ThreadStreamEvent?(AssistantStreamEvent @this) => @this.Value1; + public static implicit operator global::G.ThreadStreamEvent?(AssistantStreamEvent @this) => @this.Thread; /// /// /// public AssistantStreamEvent(global::G.ThreadStreamEvent? value) { - Value1 = value; + Thread = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.RunStreamEvent? Value2 { get; init; } + public global::G.RunStreamEvent? Run { get; init; } #else - public global::G.RunStreamEvent? Value2 { get; } + public global::G.RunStreamEvent? Run { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Run))] #endif - public bool IsValue2 => Value2 != null; + public bool IsRun => Run != null; /// /// @@ -85,32 +85,32 @@ public AssistantStreamEvent(global::G.ThreadStreamEvent? value) /// /// /// - public static implicit operator global::G.RunStreamEvent?(AssistantStreamEvent @this) => @this.Value2; + public static implicit operator global::G.RunStreamEvent?(AssistantStreamEvent @this) => @this.Run; /// /// /// public AssistantStreamEvent(global::G.RunStreamEvent? value) { - Value2 = value; + Run = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.RunStepStreamEvent? Value3 { get; init; } + public global::G.RunStepStreamEvent? RunStep { get; init; } #else - public global::G.RunStepStreamEvent? Value3 { get; } + public global::G.RunStepStreamEvent? RunStep { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RunStep))] #endif - public bool IsValue3 => Value3 != null; + public bool IsRunStep => RunStep != null; /// /// @@ -120,32 +120,32 @@ public AssistantStreamEvent(global::G.RunStreamEvent? value) /// /// /// - public static implicit operator global::G.RunStepStreamEvent?(AssistantStreamEvent @this) => @this.Value3; + public static implicit operator global::G.RunStepStreamEvent?(AssistantStreamEvent @this) => @this.RunStep; /// /// /// public AssistantStreamEvent(global::G.RunStepStreamEvent? value) { - Value3 = value; + RunStep = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.MessageStreamEvent? Value4 { get; init; } + public global::G.MessageStreamEvent? Message { get; init; } #else - public global::G.MessageStreamEvent? Value4 { get; } + public global::G.MessageStreamEvent? Message { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Message))] #endif - public bool IsValue4 => Value4 != null; + public bool IsMessage => Message != null; /// /// @@ -155,32 +155,32 @@ public AssistantStreamEvent(global::G.RunStepStreamEvent? value) /// /// /// - public static implicit operator global::G.MessageStreamEvent?(AssistantStreamEvent @this) => @this.Value4; + public static implicit operator global::G.MessageStreamEvent?(AssistantStreamEvent @this) => @this.Message; /// /// /// public AssistantStreamEvent(global::G.MessageStreamEvent? value) { - Value4 = value; + Message = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ErrorEvent? Value5 { get; init; } + public global::G.ErrorEvent? Error { get; init; } #else - public global::G.ErrorEvent? Value5 { get; } + public global::G.ErrorEvent? Error { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))] #endif - public bool IsValue5 => Value5 != null; + public bool IsError => Error != null; /// /// @@ -190,32 +190,32 @@ public AssistantStreamEvent(global::G.MessageStreamEvent? value) /// /// /// - public static implicit operator global::G.ErrorEvent?(AssistantStreamEvent @this) => @this.Value5; + public static implicit operator global::G.ErrorEvent?(AssistantStreamEvent @this) => @this.Error; /// /// /// public AssistantStreamEvent(global::G.ErrorEvent? value) { - Value5 = value; + Error = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.DoneEvent? Value6 { get; init; } + public global::G.DoneEvent? Done { get; init; } #else - public global::G.DoneEvent? Value6 { get; } + public global::G.DoneEvent? Done { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Done))] #endif - public bool IsValue6 => Value6 != null; + public bool IsDone => Done != null; /// /// @@ -225,46 +225,46 @@ public AssistantStreamEvent(global::G.ErrorEvent? value) /// /// /// - public static implicit operator global::G.DoneEvent?(AssistantStreamEvent @this) => @this.Value6; + public static implicit operator global::G.DoneEvent?(AssistantStreamEvent @this) => @this.Done; /// /// /// public AssistantStreamEvent(global::G.DoneEvent? value) { - Value6 = value; + Done = value; } /// /// /// public AssistantStreamEvent( - global::G.ThreadStreamEvent? value1, - global::G.RunStreamEvent? value2, - global::G.RunStepStreamEvent? value3, - global::G.MessageStreamEvent? value4, - global::G.ErrorEvent? value5, - global::G.DoneEvent? value6 + global::G.ThreadStreamEvent? thread, + global::G.RunStreamEvent? run, + global::G.RunStepStreamEvent? runStep, + global::G.MessageStreamEvent? message, + global::G.ErrorEvent? error, + global::G.DoneEvent? done ) { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; - Value6 = value6; + Thread = thread; + Run = run; + RunStep = runStep; + Message = message; + Error = error; + Done = done; } /// /// /// public object? Object => - Value6 as object ?? - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object + Done as object ?? + Error as object ?? + Message as object ?? + RunStep as object ?? + Run as object ?? + Thread as object ; /// @@ -272,7 +272,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && !IsValue2 && IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && !IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && !IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && !IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 && !IsValue6; + return !IsThread && IsRun && IsRunStep && IsMessage && IsError && IsDone || IsThread && !IsRun && IsRunStep && IsMessage && IsError && IsDone || IsThread && IsRun && !IsRunStep && IsMessage && IsError && IsDone || IsThread && IsRun && IsRunStep && !IsMessage && IsError && IsDone || IsThread && IsRun && IsRunStep && IsMessage && !IsError && IsDone || IsThread && IsRun && IsRunStep && IsMessage && IsError && !IsDone; } /// @@ -282,17 +282,17 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Thread, typeof(global::G.ThreadStreamEvent), - Value2, + Run, typeof(global::G.RunStreamEvent), - Value3, + RunStep, typeof(global::G.RunStepStreamEvent), - Value4, + Message, typeof(global::G.MessageStreamEvent), - Value5, + Error, typeof(global::G.ErrorEvent), - Value6, + Done, typeof(global::G.DoneEvent), }; const int offset = unchecked((int)2166136261); @@ -309,12 +309,12 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(AssistantStreamEvent other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Thread, other.Thread) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Run, other.Run) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(RunStep, other.RunStep) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Message, other.Message) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Error, other.Error) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Done, other.Done) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs index 1f4d4d8f87..dedbff526f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestSystemMessage? Value1 { get; init; } + public global::G.ChatCompletionRequestSystemMessage? System { get; init; } #else - public global::G.ChatCompletionRequestSystemMessage? Value1 { get; } + public global::G.ChatCompletionRequestSystemMessage? System { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif - public bool IsValue1 => Value1 != null; + public bool IsSystem => System != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.ChatCompletionRequestSystemMessage?(ChatCompletionRequestMessage @this) => @this.Value1; + public static implicit operator global::G.ChatCompletionRequestSystemMessage?(ChatCompletionRequestMessage @this) => @this.System; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestSystemMessage? value) { - Value1 = value; + System = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestUserMessage? Value2 { get; init; } + public global::G.ChatCompletionRequestUserMessage? User { get; init; } #else - public global::G.ChatCompletionRequestUserMessage? Value2 { get; } + public global::G.ChatCompletionRequestUserMessage? User { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(User))] #endif - public bool IsValue2 => Value2 != null; + public bool IsUser => User != null; /// /// @@ -71,32 +71,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestSystemMessage /// /// /// - public static implicit operator global::G.ChatCompletionRequestUserMessage?(ChatCompletionRequestMessage @this) => @this.Value2; + public static implicit operator global::G.ChatCompletionRequestUserMessage?(ChatCompletionRequestMessage @this) => @this.User; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestUserMessage? value) { - Value2 = value; + User = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestAssistantMessage? Value3 { get; init; } + public global::G.ChatCompletionRequestAssistantMessage? Assistant { get; init; } #else - public global::G.ChatCompletionRequestAssistantMessage? Value3 { get; } + public global::G.ChatCompletionRequestAssistantMessage? Assistant { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Assistant))] #endif - public bool IsValue3 => Value3 != null; + public bool IsAssistant => Assistant != null; /// /// @@ -106,32 +106,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestUserMessage? /// /// /// - public static implicit operator global::G.ChatCompletionRequestAssistantMessage?(ChatCompletionRequestMessage @this) => @this.Value3; + public static implicit operator global::G.ChatCompletionRequestAssistantMessage?(ChatCompletionRequestMessage @this) => @this.Assistant; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestAssistantMessage? value) { - Value3 = value; + Assistant = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestToolMessage? Value4 { get; init; } + public global::G.ChatCompletionRequestToolMessage? Tool { get; init; } #else - public global::G.ChatCompletionRequestToolMessage? Value4 { get; } + public global::G.ChatCompletionRequestToolMessage? Tool { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Tool))] #endif - public bool IsValue4 => Value4 != null; + public bool IsTool => Tool != null; /// /// @@ -141,32 +141,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestAssistantMess /// /// /// - public static implicit operator global::G.ChatCompletionRequestToolMessage?(ChatCompletionRequestMessage @this) => @this.Value4; + public static implicit operator global::G.ChatCompletionRequestToolMessage?(ChatCompletionRequestMessage @this) => @this.Tool; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestToolMessage? value) { - Value4 = value; + Tool = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestFunctionMessage? Value5 { get; init; } + public global::G.ChatCompletionRequestFunctionMessage? Function { get; init; } #else - public global::G.ChatCompletionRequestFunctionMessage? Value5 { get; } + public global::G.ChatCompletionRequestFunctionMessage? Function { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Function))] #endif - public bool IsValue5 => Value5 != null; + public bool IsFunction => Function != null; /// /// @@ -176,43 +176,43 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestToolMessage? /// /// /// - public static implicit operator global::G.ChatCompletionRequestFunctionMessage?(ChatCompletionRequestMessage @this) => @this.Value5; + public static implicit operator global::G.ChatCompletionRequestFunctionMessage?(ChatCompletionRequestMessage @this) => @this.Function; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestFunctionMessage? value) { - Value5 = value; + Function = value; } /// /// /// public ChatCompletionRequestMessage( - global::G.ChatCompletionRequestSystemMessage? value1, - global::G.ChatCompletionRequestUserMessage? value2, - global::G.ChatCompletionRequestAssistantMessage? value3, - global::G.ChatCompletionRequestToolMessage? value4, - global::G.ChatCompletionRequestFunctionMessage? value5 + global::G.ChatCompletionRequestSystemMessage? system, + global::G.ChatCompletionRequestUserMessage? user, + global::G.ChatCompletionRequestAssistantMessage? assistant, + global::G.ChatCompletionRequestToolMessage? tool, + global::G.ChatCompletionRequestFunctionMessage? function ) { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; + System = system; + User = user; + Assistant = assistant; + Tool = tool; + Function = function; } /// /// /// public object? Object => - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object + Function as object ?? + Tool as object ?? + Assistant as object ?? + User as object ?? + System as object ; /// @@ -220,7 +220,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 || IsValue1 && !IsValue2 && IsValue3 && IsValue4 && IsValue5 || IsValue1 && IsValue2 && !IsValue3 && IsValue4 && IsValue5 || IsValue1 && IsValue2 && IsValue3 && !IsValue4 && IsValue5 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && !IsValue5; + return !IsSystem && IsUser && IsAssistant && IsTool && IsFunction || IsSystem && !IsUser && IsAssistant && IsTool && IsFunction || IsSystem && IsUser && !IsAssistant && IsTool && IsFunction || IsSystem && IsUser && IsAssistant && !IsTool && IsFunction || IsSystem && IsUser && IsAssistant && IsTool && !IsFunction; } /// @@ -230,15 +230,15 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + System, typeof(global::G.ChatCompletionRequestSystemMessage), - Value2, + User, typeof(global::G.ChatCompletionRequestUserMessage), - Value3, + Assistant, typeof(global::G.ChatCompletionRequestAssistantMessage), - Value4, + Tool, typeof(global::G.ChatCompletionRequestToolMessage), - Value5, + Function, typeof(global::G.ChatCompletionRequestFunctionMessage), }; const int offset = unchecked((int)2166136261); @@ -255,11 +255,11 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChatCompletionRequestMessage other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) + global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Function, other.Function) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs index e4fc324e32..777f5e9548 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestMessageContentPartText? Value1 { get; init; } + public global::G.ChatCompletionRequestMessageContentPartText? Text { get; init; } #else - public global::G.ChatCompletionRequestMessageContentPartText? Value1 { get; } + public global::G.ChatCompletionRequestMessageContentPartText? Text { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif - public bool IsValue1 => Value1 != null; + public bool IsText => Text != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.ChatCompletionRequestMessageContentPartText?(ChatCompletionRequestMessageContentPart @this) => @this.Value1; + public static implicit operator global::G.ChatCompletionRequestMessageContentPartText?(ChatCompletionRequestMessageContentPart @this) => @this.Text; /// /// /// public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMessageContentPartText? value) { - Value1 = value; + Text = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestMessageContentPartImage? Value2 { get; init; } + public global::G.ChatCompletionRequestMessageContentPartImage? Image { get; init; } #else - public global::G.ChatCompletionRequestMessageContentPartImage? Value2 { get; } + public global::G.ChatCompletionRequestMessageContentPartImage? Image { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif - public bool IsValue2 => Value2 != null; + public bool IsImage => Image != null; /// /// @@ -71,34 +71,34 @@ public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMe /// /// /// - public static implicit operator global::G.ChatCompletionRequestMessageContentPartImage?(ChatCompletionRequestMessageContentPart @this) => @this.Value2; + public static implicit operator global::G.ChatCompletionRequestMessageContentPartImage?(ChatCompletionRequestMessageContentPart @this) => @this.Image; /// /// /// public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMessageContentPartImage? value) { - Value2 = value; + Image = value; } /// /// /// public ChatCompletionRequestMessageContentPart( - global::G.ChatCompletionRequestMessageContentPartText? value1, - global::G.ChatCompletionRequestMessageContentPartImage? value2 + global::G.ChatCompletionRequestMessageContentPartText? text, + global::G.ChatCompletionRequestMessageContentPartImage? image ) { - Value1 = value1; - Value2 = value2; + Text = text; + Image = image; } /// /// /// public object? Object => - Value2 as object ?? - Value1 as object + Image as object ?? + Text as object ; /// @@ -106,7 +106,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 || IsValue1 && !IsValue2; + return !IsText && IsImage || IsText && !IsImage; } /// @@ -116,9 +116,9 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Text, typeof(global::G.ChatCompletionRequestMessageContentPartText), - Value2, + Image, typeof(global::G.ChatCompletionRequestMessageContentPartImage), }; const int offset = unchecked((int)2166136261); @@ -135,8 +135,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChatCompletionRequestMessageContentPart other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs index 8c6f2c4297..77375e0196 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/NewtonsoftJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.AutoChunkingStrategyRequestParam? Value1 { get; init; } + public global::G.AutoChunkingStrategyRequestParam? Auto { get; init; } #else - public global::G.AutoChunkingStrategyRequestParam? Value1 { get; } + public global::G.AutoChunkingStrategyRequestParam? Auto { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Auto))] #endif - public bool IsValue1 => Value1 != null; + public bool IsAuto => Auto != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.AutoChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Value1; + public static implicit operator global::G.AutoChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Auto; /// /// /// public ChunkingStrategyRequestParam(global::G.AutoChunkingStrategyRequestParam? value) { - Value1 = value; + Auto = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.StaticChunkingStrategyRequestParam? Value2 { get; init; } + public global::G.StaticChunkingStrategyRequestParam? Static { get; init; } #else - public global::G.StaticChunkingStrategyRequestParam? Value2 { get; } + public global::G.StaticChunkingStrategyRequestParam? Static { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Static))] #endif - public bool IsValue2 => Value2 != null; + public bool IsStatic => Static != null; /// /// @@ -71,34 +71,34 @@ public ChunkingStrategyRequestParam(global::G.AutoChunkingStrategyRequestParam? /// /// /// - public static implicit operator global::G.StaticChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Value2; + public static implicit operator global::G.StaticChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Static; /// /// /// public ChunkingStrategyRequestParam(global::G.StaticChunkingStrategyRequestParam? value) { - Value2 = value; + Static = value; } /// /// /// public ChunkingStrategyRequestParam( - global::G.AutoChunkingStrategyRequestParam? value1, - global::G.StaticChunkingStrategyRequestParam? value2 + global::G.AutoChunkingStrategyRequestParam? auto, + global::G.StaticChunkingStrategyRequestParam? @static ) { - Value1 = value1; - Value2 = value2; + Auto = auto; + Static = @static; } /// /// /// public object? Object => - Value2 as object ?? - Value1 as object + Static as object ?? + Auto as object ; /// @@ -106,7 +106,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 || IsValue1 && !IsValue2; + return !IsAuto && IsStatic || IsAuto && !IsStatic; } /// @@ -116,9 +116,9 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Auto, typeof(global::G.AutoChunkingStrategyRequestParam), - Value2, + Static, typeof(global::G.StaticChunkingStrategyRequestParam), }; const int offset = unchecked((int)2166136261); @@ -135,8 +135,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChunkingStrategyRequestParam other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Auto, other.Auto) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Static, other.Static) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.AssistantStreamEvent.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.AssistantStreamEvent.g.verified.cs index f1ae00d85d..7e97337832 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.AssistantStreamEvent.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.AssistantStreamEvent.g.verified.cs @@ -29,18 +29,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ThreadStreamEvent? Value1 { get; init; } + public global::G.ThreadStreamEvent? Thread { get; init; } #else - public global::G.ThreadStreamEvent? Value1 { get; } + public global::G.ThreadStreamEvent? Thread { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Thread))] #endif - public bool IsValue1 => Value1 != null; + public bool IsThread => Thread != null; /// /// @@ -50,32 +50,32 @@ namespace G /// /// /// - public static implicit operator global::G.ThreadStreamEvent?(AssistantStreamEvent @this) => @this.Value1; + public static implicit operator global::G.ThreadStreamEvent?(AssistantStreamEvent @this) => @this.Thread; /// /// /// public AssistantStreamEvent(global::G.ThreadStreamEvent? value) { - Value1 = value; + Thread = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.RunStreamEvent? Value2 { get; init; } + public global::G.RunStreamEvent? Run { get; init; } #else - public global::G.RunStreamEvent? Value2 { get; } + public global::G.RunStreamEvent? Run { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Run))] #endif - public bool IsValue2 => Value2 != null; + public bool IsRun => Run != null; /// /// @@ -85,32 +85,32 @@ public AssistantStreamEvent(global::G.ThreadStreamEvent? value) /// /// /// - public static implicit operator global::G.RunStreamEvent?(AssistantStreamEvent @this) => @this.Value2; + public static implicit operator global::G.RunStreamEvent?(AssistantStreamEvent @this) => @this.Run; /// /// /// public AssistantStreamEvent(global::G.RunStreamEvent? value) { - Value2 = value; + Run = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.RunStepStreamEvent? Value3 { get; init; } + public global::G.RunStepStreamEvent? RunStep { get; init; } #else - public global::G.RunStepStreamEvent? Value3 { get; } + public global::G.RunStepStreamEvent? RunStep { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(RunStep))] #endif - public bool IsValue3 => Value3 != null; + public bool IsRunStep => RunStep != null; /// /// @@ -120,32 +120,32 @@ public AssistantStreamEvent(global::G.RunStreamEvent? value) /// /// /// - public static implicit operator global::G.RunStepStreamEvent?(AssistantStreamEvent @this) => @this.Value3; + public static implicit operator global::G.RunStepStreamEvent?(AssistantStreamEvent @this) => @this.RunStep; /// /// /// public AssistantStreamEvent(global::G.RunStepStreamEvent? value) { - Value3 = value; + RunStep = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.MessageStreamEvent? Value4 { get; init; } + public global::G.MessageStreamEvent? Message { get; init; } #else - public global::G.MessageStreamEvent? Value4 { get; } + public global::G.MessageStreamEvent? Message { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Message))] #endif - public bool IsValue4 => Value4 != null; + public bool IsMessage => Message != null; /// /// @@ -155,32 +155,32 @@ public AssistantStreamEvent(global::G.RunStepStreamEvent? value) /// /// /// - public static implicit operator global::G.MessageStreamEvent?(AssistantStreamEvent @this) => @this.Value4; + public static implicit operator global::G.MessageStreamEvent?(AssistantStreamEvent @this) => @this.Message; /// /// /// public AssistantStreamEvent(global::G.MessageStreamEvent? value) { - Value4 = value; + Message = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ErrorEvent? Value5 { get; init; } + public global::G.ErrorEvent? Error { get; init; } #else - public global::G.ErrorEvent? Value5 { get; } + public global::G.ErrorEvent? Error { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Error))] #endif - public bool IsValue5 => Value5 != null; + public bool IsError => Error != null; /// /// @@ -190,32 +190,32 @@ public AssistantStreamEvent(global::G.MessageStreamEvent? value) /// /// /// - public static implicit operator global::G.ErrorEvent?(AssistantStreamEvent @this) => @this.Value5; + public static implicit operator global::G.ErrorEvent?(AssistantStreamEvent @this) => @this.Error; /// /// /// public AssistantStreamEvent(global::G.ErrorEvent? value) { - Value5 = value; + Error = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.DoneEvent? Value6 { get; init; } + public global::G.DoneEvent? Done { get; init; } #else - public global::G.DoneEvent? Value6 { get; } + public global::G.DoneEvent? Done { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value6))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Done))] #endif - public bool IsValue6 => Value6 != null; + public bool IsDone => Done != null; /// /// @@ -225,46 +225,46 @@ public AssistantStreamEvent(global::G.ErrorEvent? value) /// /// /// - public static implicit operator global::G.DoneEvent?(AssistantStreamEvent @this) => @this.Value6; + public static implicit operator global::G.DoneEvent?(AssistantStreamEvent @this) => @this.Done; /// /// /// public AssistantStreamEvent(global::G.DoneEvent? value) { - Value6 = value; + Done = value; } /// /// /// public AssistantStreamEvent( - global::G.ThreadStreamEvent? value1, - global::G.RunStreamEvent? value2, - global::G.RunStepStreamEvent? value3, - global::G.MessageStreamEvent? value4, - global::G.ErrorEvent? value5, - global::G.DoneEvent? value6 + global::G.ThreadStreamEvent? thread, + global::G.RunStreamEvent? run, + global::G.RunStepStreamEvent? runStep, + global::G.MessageStreamEvent? message, + global::G.ErrorEvent? error, + global::G.DoneEvent? done ) { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; - Value6 = value6; + Thread = thread; + Run = run; + RunStep = runStep; + Message = message; + Error = error; + Done = done; } /// /// /// public object? Object => - Value6 as object ?? - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object + Done as object ?? + Error as object ?? + Message as object ?? + RunStep as object ?? + Run as object ?? + Thread as object ; /// @@ -272,7 +272,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && !IsValue2 && IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && !IsValue3 && IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && !IsValue4 && IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && !IsValue5 && IsValue6 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 && !IsValue6; + return !IsThread && IsRun && IsRunStep && IsMessage && IsError && IsDone || IsThread && !IsRun && IsRunStep && IsMessage && IsError && IsDone || IsThread && IsRun && !IsRunStep && IsMessage && IsError && IsDone || IsThread && IsRun && IsRunStep && !IsMessage && IsError && IsDone || IsThread && IsRun && IsRunStep && IsMessage && !IsError && IsDone || IsThread && IsRun && IsRunStep && IsMessage && IsError && !IsDone; } /// @@ -282,17 +282,17 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Thread, typeof(global::G.ThreadStreamEvent), - Value2, + Run, typeof(global::G.RunStreamEvent), - Value3, + RunStep, typeof(global::G.RunStepStreamEvent), - Value4, + Message, typeof(global::G.MessageStreamEvent), - Value5, + Error, typeof(global::G.ErrorEvent), - Value6, + Done, typeof(global::G.DoneEvent), }; const int offset = unchecked((int)2166136261); @@ -309,12 +309,12 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(AssistantStreamEvent other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value6, other.Value6) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Thread, other.Thread) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Run, other.Run) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(RunStep, other.RunStep) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Message, other.Message) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Error, other.Error) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Done, other.Done) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs index 1f4d4d8f87..dedbff526f 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessage.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestSystemMessage? Value1 { get; init; } + public global::G.ChatCompletionRequestSystemMessage? System { get; init; } #else - public global::G.ChatCompletionRequestSystemMessage? Value1 { get; } + public global::G.ChatCompletionRequestSystemMessage? System { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(System))] #endif - public bool IsValue1 => Value1 != null; + public bool IsSystem => System != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.ChatCompletionRequestSystemMessage?(ChatCompletionRequestMessage @this) => @this.Value1; + public static implicit operator global::G.ChatCompletionRequestSystemMessage?(ChatCompletionRequestMessage @this) => @this.System; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestSystemMessage? value) { - Value1 = value; + System = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestUserMessage? Value2 { get; init; } + public global::G.ChatCompletionRequestUserMessage? User { get; init; } #else - public global::G.ChatCompletionRequestUserMessage? Value2 { get; } + public global::G.ChatCompletionRequestUserMessage? User { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(User))] #endif - public bool IsValue2 => Value2 != null; + public bool IsUser => User != null; /// /// @@ -71,32 +71,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestSystemMessage /// /// /// - public static implicit operator global::G.ChatCompletionRequestUserMessage?(ChatCompletionRequestMessage @this) => @this.Value2; + public static implicit operator global::G.ChatCompletionRequestUserMessage?(ChatCompletionRequestMessage @this) => @this.User; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestUserMessage? value) { - Value2 = value; + User = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestAssistantMessage? Value3 { get; init; } + public global::G.ChatCompletionRequestAssistantMessage? Assistant { get; init; } #else - public global::G.ChatCompletionRequestAssistantMessage? Value3 { get; } + public global::G.ChatCompletionRequestAssistantMessage? Assistant { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value3))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Assistant))] #endif - public bool IsValue3 => Value3 != null; + public bool IsAssistant => Assistant != null; /// /// @@ -106,32 +106,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestUserMessage? /// /// /// - public static implicit operator global::G.ChatCompletionRequestAssistantMessage?(ChatCompletionRequestMessage @this) => @this.Value3; + public static implicit operator global::G.ChatCompletionRequestAssistantMessage?(ChatCompletionRequestMessage @this) => @this.Assistant; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestAssistantMessage? value) { - Value3 = value; + Assistant = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestToolMessage? Value4 { get; init; } + public global::G.ChatCompletionRequestToolMessage? Tool { get; init; } #else - public global::G.ChatCompletionRequestToolMessage? Value4 { get; } + public global::G.ChatCompletionRequestToolMessage? Tool { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value4))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Tool))] #endif - public bool IsValue4 => Value4 != null; + public bool IsTool => Tool != null; /// /// @@ -141,32 +141,32 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestAssistantMess /// /// /// - public static implicit operator global::G.ChatCompletionRequestToolMessage?(ChatCompletionRequestMessage @this) => @this.Value4; + public static implicit operator global::G.ChatCompletionRequestToolMessage?(ChatCompletionRequestMessage @this) => @this.Tool; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestToolMessage? value) { - Value4 = value; + Tool = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestFunctionMessage? Value5 { get; init; } + public global::G.ChatCompletionRequestFunctionMessage? Function { get; init; } #else - public global::G.ChatCompletionRequestFunctionMessage? Value5 { get; } + public global::G.ChatCompletionRequestFunctionMessage? Function { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value5))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Function))] #endif - public bool IsValue5 => Value5 != null; + public bool IsFunction => Function != null; /// /// @@ -176,43 +176,43 @@ public ChatCompletionRequestMessage(global::G.ChatCompletionRequestToolMessage? /// /// /// - public static implicit operator global::G.ChatCompletionRequestFunctionMessage?(ChatCompletionRequestMessage @this) => @this.Value5; + public static implicit operator global::G.ChatCompletionRequestFunctionMessage?(ChatCompletionRequestMessage @this) => @this.Function; /// /// /// public ChatCompletionRequestMessage(global::G.ChatCompletionRequestFunctionMessage? value) { - Value5 = value; + Function = value; } /// /// /// public ChatCompletionRequestMessage( - global::G.ChatCompletionRequestSystemMessage? value1, - global::G.ChatCompletionRequestUserMessage? value2, - global::G.ChatCompletionRequestAssistantMessage? value3, - global::G.ChatCompletionRequestToolMessage? value4, - global::G.ChatCompletionRequestFunctionMessage? value5 + global::G.ChatCompletionRequestSystemMessage? system, + global::G.ChatCompletionRequestUserMessage? user, + global::G.ChatCompletionRequestAssistantMessage? assistant, + global::G.ChatCompletionRequestToolMessage? tool, + global::G.ChatCompletionRequestFunctionMessage? function ) { - Value1 = value1; - Value2 = value2; - Value3 = value3; - Value4 = value4; - Value5 = value5; + System = system; + User = user; + Assistant = assistant; + Tool = tool; + Function = function; } /// /// /// public object? Object => - Value5 as object ?? - Value4 as object ?? - Value3 as object ?? - Value2 as object ?? - Value1 as object + Function as object ?? + Tool as object ?? + Assistant as object ?? + User as object ?? + System as object ; /// @@ -220,7 +220,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 && IsValue3 && IsValue4 && IsValue5 || IsValue1 && !IsValue2 && IsValue3 && IsValue4 && IsValue5 || IsValue1 && IsValue2 && !IsValue3 && IsValue4 && IsValue5 || IsValue1 && IsValue2 && IsValue3 && !IsValue4 && IsValue5 || IsValue1 && IsValue2 && IsValue3 && IsValue4 && !IsValue5; + return !IsSystem && IsUser && IsAssistant && IsTool && IsFunction || IsSystem && !IsUser && IsAssistant && IsTool && IsFunction || IsSystem && IsUser && !IsAssistant && IsTool && IsFunction || IsSystem && IsUser && IsAssistant && !IsTool && IsFunction || IsSystem && IsUser && IsAssistant && IsTool && !IsFunction; } /// @@ -230,15 +230,15 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + System, typeof(global::G.ChatCompletionRequestSystemMessage), - Value2, + User, typeof(global::G.ChatCompletionRequestUserMessage), - Value3, + Assistant, typeof(global::G.ChatCompletionRequestAssistantMessage), - Value4, + Tool, typeof(global::G.ChatCompletionRequestToolMessage), - Value5, + Function, typeof(global::G.ChatCompletionRequestFunctionMessage), }; const int offset = unchecked((int)2166136261); @@ -255,11 +255,11 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChatCompletionRequestMessage other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value3, other.Value3) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value4, other.Value4) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value5, other.Value5) + global::System.Collections.Generic.EqualityComparer.Default.Equals(System, other.System) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(User, other.User) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Assistant, other.Assistant) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Tool, other.Tool) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Function, other.Function) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs index e4fc324e32..777f5e9548 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChatCompletionRequestMessageContentPart.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestMessageContentPartText? Value1 { get; init; } + public global::G.ChatCompletionRequestMessageContentPartText? Text { get; init; } #else - public global::G.ChatCompletionRequestMessageContentPartText? Value1 { get; } + public global::G.ChatCompletionRequestMessageContentPartText? Text { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Text))] #endif - public bool IsValue1 => Value1 != null; + public bool IsText => Text != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.ChatCompletionRequestMessageContentPartText?(ChatCompletionRequestMessageContentPart @this) => @this.Value1; + public static implicit operator global::G.ChatCompletionRequestMessageContentPartText?(ChatCompletionRequestMessageContentPart @this) => @this.Text; /// /// /// public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMessageContentPartText? value) { - Value1 = value; + Text = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.ChatCompletionRequestMessageContentPartImage? Value2 { get; init; } + public global::G.ChatCompletionRequestMessageContentPartImage? Image { get; init; } #else - public global::G.ChatCompletionRequestMessageContentPartImage? Value2 { get; } + public global::G.ChatCompletionRequestMessageContentPartImage? Image { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Image))] #endif - public bool IsValue2 => Value2 != null; + public bool IsImage => Image != null; /// /// @@ -71,34 +71,34 @@ public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMe /// /// /// - public static implicit operator global::G.ChatCompletionRequestMessageContentPartImage?(ChatCompletionRequestMessageContentPart @this) => @this.Value2; + public static implicit operator global::G.ChatCompletionRequestMessageContentPartImage?(ChatCompletionRequestMessageContentPart @this) => @this.Image; /// /// /// public ChatCompletionRequestMessageContentPart(global::G.ChatCompletionRequestMessageContentPartImage? value) { - Value2 = value; + Image = value; } /// /// /// public ChatCompletionRequestMessageContentPart( - global::G.ChatCompletionRequestMessageContentPartText? value1, - global::G.ChatCompletionRequestMessageContentPartImage? value2 + global::G.ChatCompletionRequestMessageContentPartText? text, + global::G.ChatCompletionRequestMessageContentPartImage? image ) { - Value1 = value1; - Value2 = value2; + Text = text; + Image = image; } /// /// /// public object? Object => - Value2 as object ?? - Value1 as object + Image as object ?? + Text as object ; /// @@ -106,7 +106,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 || IsValue1 && !IsValue2; + return !IsText && IsImage || IsText && !IsImage; } /// @@ -116,9 +116,9 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Text, typeof(global::G.ChatCompletionRequestMessageContentPartText), - Value2, + Image, typeof(global::G.ChatCompletionRequestMessageContentPartImage), }; const int offset = unchecked((int)2166136261); @@ -135,8 +135,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChatCompletionRequestMessageContentPart other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Text, other.Text) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Image, other.Image) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs index 8c6f2c4297..77375e0196 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#G.Models.ChunkingStrategyRequestParam.g.verified.cs @@ -15,18 +15,18 @@ namespace G /// /// #if NET6_0_OR_GREATER - public global::G.AutoChunkingStrategyRequestParam? Value1 { get; init; } + public global::G.AutoChunkingStrategyRequestParam? Auto { get; init; } #else - public global::G.AutoChunkingStrategyRequestParam? Value1 { get; } + public global::G.AutoChunkingStrategyRequestParam? Auto { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Auto))] #endif - public bool IsValue1 => Value1 != null; + public bool IsAuto => Auto != null; /// /// @@ -36,32 +36,32 @@ namespace G /// /// /// - public static implicit operator global::G.AutoChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Value1; + public static implicit operator global::G.AutoChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Auto; /// /// /// public ChunkingStrategyRequestParam(global::G.AutoChunkingStrategyRequestParam? value) { - Value1 = value; + Auto = value; } /// /// /// #if NET6_0_OR_GREATER - public global::G.StaticChunkingStrategyRequestParam? Value2 { get; init; } + public global::G.StaticChunkingStrategyRequestParam? Static { get; init; } #else - public global::G.StaticChunkingStrategyRequestParam? Value2 { get; } + public global::G.StaticChunkingStrategyRequestParam? Static { get; } #endif /// /// /// #if NET6_0_OR_GREATER - [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Static))] #endif - public bool IsValue2 => Value2 != null; + public bool IsStatic => Static != null; /// /// @@ -71,34 +71,34 @@ public ChunkingStrategyRequestParam(global::G.AutoChunkingStrategyRequestParam? /// /// /// - public static implicit operator global::G.StaticChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Value2; + public static implicit operator global::G.StaticChunkingStrategyRequestParam?(ChunkingStrategyRequestParam @this) => @this.Static; /// /// /// public ChunkingStrategyRequestParam(global::G.StaticChunkingStrategyRequestParam? value) { - Value2 = value; + Static = value; } /// /// /// public ChunkingStrategyRequestParam( - global::G.AutoChunkingStrategyRequestParam? value1, - global::G.StaticChunkingStrategyRequestParam? value2 + global::G.AutoChunkingStrategyRequestParam? auto, + global::G.StaticChunkingStrategyRequestParam? @static ) { - Value1 = value1; - Value2 = value2; + Auto = auto; + Static = @static; } /// /// /// public object? Object => - Value2 as object ?? - Value1 as object + Static as object ?? + Auto as object ; /// @@ -106,7 +106,7 @@ Value1 as object /// public bool Validate() { - return !IsValue1 && IsValue2 || IsValue1 && !IsValue2; + return !IsAuto && IsStatic || IsAuto && !IsStatic; } /// @@ -116,9 +116,9 @@ public override int GetHashCode() { var fields = new object?[] { - Value1, + Auto, typeof(global::G.AutoChunkingStrategyRequestParam), - Value2, + Static, typeof(global::G.StaticChunkingStrategyRequestParam), }; const int offset = unchecked((int)2166136261); @@ -135,8 +135,8 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null public bool Equals(ChunkingStrategyRequestParam other) { return - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Auto, other.Auto) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Static, other.Static) ; } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantStreamEvent.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantStreamEvent.g.verified.cs index cd6487fb7d..bd5db2c78a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantStreamEvent.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.AssistantStreamEvent.g.verified.cs @@ -17,108 +17,108 @@ public class AssistantStreamEventJsonConverter : global::System.Text.Json.Serial var readerCopy = reader; - global::G.ThreadStreamEvent? value1 = default; + global::G.ThreadStreamEvent? thread = default; try { - value1 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + thread = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.RunStreamEvent? value2 = default; + global::G.RunStreamEvent? run = default; try { - value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + run = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.RunStepStreamEvent? value3 = default; + global::G.RunStepStreamEvent? runStep = default; try { - value3 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + runStep = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.MessageStreamEvent? value4 = default; + global::G.MessageStreamEvent? message = default; try { - value4 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + message = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ErrorEvent? value5 = default; + global::G.ErrorEvent? error = default; try { - value5 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + error = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.DoneEvent? value6 = default; + global::G.DoneEvent? done = default; try { - value6 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + done = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } var result = new global::G.AssistantStreamEvent( - value1, + thread, - value2, + run, - value3, + runStep, - value4, + message, - value5, + error, - value6 + done ); if (!result.Validate()) { throw new global::System.Text.Json.JsonException($"Invalid JSON format for OneOf<{typeof(global::G.ThreadStreamEvent).Name}, {typeof(global::G.RunStreamEvent).Name}, {typeof(global::G.RunStepStreamEvent).Name}, {typeof(global::G.MessageStreamEvent).Name}, {typeof(global::G.ErrorEvent).Name}, {typeof(global::G.DoneEvent).Name}>"); } - if (value1 != null) + if (thread != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value2 != null) + else if (run != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value3 != null) + else if (runStep != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value4 != null) + else if (message != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value5 != null) + else if (error != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value6 != null) + else if (done != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } @@ -138,34 +138,34 @@ public override void Write( throw new global::System.Text.Json.JsonException($"Invalid OneOf<{typeof(global::G.ThreadStreamEvent).Name}, {typeof(global::G.RunStreamEvent).Name}, {typeof(global::G.RunStepStreamEvent).Name}, {typeof(global::G.MessageStreamEvent).Name}, {typeof(global::G.ErrorEvent).Name}, {typeof(global::G.DoneEvent).Name}> object."); } - if (value.IsValue1) + if (value.IsThread) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeof(global::G.ThreadStreamEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Thread, typeof(global::G.ThreadStreamEvent), options); } - else if (value.IsValue2) + else if (value.IsRun) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeof(global::G.RunStreamEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Run, typeof(global::G.RunStreamEvent), options); } - else if (value.IsValue3) + else if (value.IsRunStep) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3, typeof(global::G.RunStepStreamEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.RunStep, typeof(global::G.RunStepStreamEvent), options); } - else if (value.IsValue4) + else if (value.IsMessage) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4, typeof(global::G.MessageStreamEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Message, typeof(global::G.MessageStreamEvent), options); } - else if (value.IsValue5) + else if (value.IsError) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5, typeof(global::G.ErrorEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Error, typeof(global::G.ErrorEvent), options); } - else if (value.IsValue6) + else if (value.IsDone) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6, typeof(global::G.DoneEvent), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Done, typeof(global::G.DoneEvent), options); } } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessage.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessage.g.verified.cs index 118a5c3165..1f7651e2a5 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessage.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessage.g.verified.cs @@ -17,91 +17,91 @@ public class ChatCompletionRequestMessageJsonConverter : global::System.Text.Jso var readerCopy = reader; - global::G.ChatCompletionRequestSystemMessage? value1 = default; + global::G.ChatCompletionRequestSystemMessage? system = default; try { - value1 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + system = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ChatCompletionRequestUserMessage? value2 = default; + global::G.ChatCompletionRequestUserMessage? user = default; try { - value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + user = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ChatCompletionRequestAssistantMessage? value3 = default; + global::G.ChatCompletionRequestAssistantMessage? assistant = default; try { - value3 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + assistant = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ChatCompletionRequestToolMessage? value4 = default; + global::G.ChatCompletionRequestToolMessage? tool = default; try { - value4 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + tool = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ChatCompletionRequestFunctionMessage? value5 = default; + global::G.ChatCompletionRequestFunctionMessage? function = default; try { - value5 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + function = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } var result = new global::G.ChatCompletionRequestMessage( - value1, + system, - value2, + user, - value3, + assistant, - value4, + tool, - value5 + function ); if (!result.Validate()) { throw new global::System.Text.Json.JsonException($"Invalid JSON format for OneOf<{typeof(global::G.ChatCompletionRequestSystemMessage).Name}, {typeof(global::G.ChatCompletionRequestUserMessage).Name}, {typeof(global::G.ChatCompletionRequestAssistantMessage).Name}, {typeof(global::G.ChatCompletionRequestToolMessage).Name}, {typeof(global::G.ChatCompletionRequestFunctionMessage).Name}>"); } - if (value1 != null) + if (system != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value2 != null) + else if (user != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value3 != null) + else if (assistant != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value4 != null) + else if (tool != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value5 != null) + else if (function != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } @@ -121,29 +121,29 @@ public override void Write( throw new global::System.Text.Json.JsonException($"Invalid OneOf<{typeof(global::G.ChatCompletionRequestSystemMessage).Name}, {typeof(global::G.ChatCompletionRequestUserMessage).Name}, {typeof(global::G.ChatCompletionRequestAssistantMessage).Name}, {typeof(global::G.ChatCompletionRequestToolMessage).Name}, {typeof(global::G.ChatCompletionRequestFunctionMessage).Name}> object."); } - if (value.IsValue1) + if (value.IsSystem) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeof(global::G.ChatCompletionRequestSystemMessage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.System, typeof(global::G.ChatCompletionRequestSystemMessage), options); } - else if (value.IsValue2) + else if (value.IsUser) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeof(global::G.ChatCompletionRequestUserMessage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.User, typeof(global::G.ChatCompletionRequestUserMessage), options); } - else if (value.IsValue3) + else if (value.IsAssistant) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3, typeof(global::G.ChatCompletionRequestAssistantMessage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Assistant, typeof(global::G.ChatCompletionRequestAssistantMessage), options); } - else if (value.IsValue4) + else if (value.IsTool) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4, typeof(global::G.ChatCompletionRequestToolMessage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Tool, typeof(global::G.ChatCompletionRequestToolMessage), options); } - else if (value.IsValue5) + else if (value.IsFunction) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5, typeof(global::G.ChatCompletionRequestFunctionMessage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Function, typeof(global::G.ChatCompletionRequestFunctionMessage), options); } } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPart.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPart.g.verified.cs index efb8b9a125..6a45d540b6 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPart.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChatCompletionRequestMessageContentPart.g.verified.cs @@ -17,40 +17,40 @@ public class ChatCompletionRequestMessageContentPartJsonConverter : global::Syst var readerCopy = reader; - global::G.ChatCompletionRequestMessageContentPartText? value1 = default; + global::G.ChatCompletionRequestMessageContentPartText? text = default; try { - value1 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + text = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.ChatCompletionRequestMessageContentPartImage? value2 = default; + global::G.ChatCompletionRequestMessageContentPartImage? image = default; try { - value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + image = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } var result = new global::G.ChatCompletionRequestMessageContentPart( - value1, + text, - value2 + image ); if (!result.Validate()) { throw new global::System.Text.Json.JsonException($"Invalid JSON format for OneOf<{typeof(global::G.ChatCompletionRequestMessageContentPartText).Name}, {typeof(global::G.ChatCompletionRequestMessageContentPartImage).Name}>"); } - if (value1 != null) + if (text != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value2 != null) + else if (image != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } @@ -70,14 +70,14 @@ public override void Write( throw new global::System.Text.Json.JsonException($"Invalid OneOf<{typeof(global::G.ChatCompletionRequestMessageContentPartText).Name}, {typeof(global::G.ChatCompletionRequestMessageContentPartImage).Name}> object."); } - if (value.IsValue1) + if (value.IsText) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeof(global::G.ChatCompletionRequestMessageContentPartText), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Text, typeof(global::G.ChatCompletionRequestMessageContentPartText), options); } - else if (value.IsValue2) + else if (value.IsImage) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeof(global::G.ChatCompletionRequestMessageContentPartImage), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Image, typeof(global::G.ChatCompletionRequestMessageContentPartImage), options); } } } diff --git a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChunkingStrategyRequestParam.g.verified.cs b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChunkingStrategyRequestParam.g.verified.cs index c2f7f972e1..3945a2105a 100644 --- a/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChunkingStrategyRequestParam.g.verified.cs +++ b/src/tests/OpenApiGenerator.SnapshotTests/Snapshots/OpenAi/SystemTextJson/_#JsonConverters.ChunkingStrategyRequestParam.g.verified.cs @@ -17,40 +17,40 @@ public class ChunkingStrategyRequestParamJsonConverter : global::System.Text.Jso var readerCopy = reader; - global::G.AutoChunkingStrategyRequestParam? value1 = default; + global::G.AutoChunkingStrategyRequestParam? auto = default; try { - value1 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + auto = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } readerCopy = reader; - global::G.StaticChunkingStrategyRequestParam? value2 = default; + global::G.StaticChunkingStrategyRequestParam? @static = default; try { - value2 = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); + @static = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, options); } catch (global::System.Text.Json.JsonException) { } var result = new global::G.ChunkingStrategyRequestParam( - value1, + auto, - value2 + @static ); if (!result.Validate()) { throw new global::System.Text.Json.JsonException($"Invalid JSON format for OneOf<{typeof(global::G.AutoChunkingStrategyRequestParam).Name}, {typeof(global::G.StaticChunkingStrategyRequestParam).Name}>"); } - if (value1 != null) + if (auto != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } - else if (value2 != null) + else if (@static != null) { _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, options); } @@ -70,14 +70,14 @@ public override void Write( throw new global::System.Text.Json.JsonException($"Invalid OneOf<{typeof(global::G.AutoChunkingStrategyRequestParam).Name}, {typeof(global::G.StaticChunkingStrategyRequestParam).Name}> object."); } - if (value.IsValue1) + if (value.IsAuto) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeof(global::G.AutoChunkingStrategyRequestParam), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Auto, typeof(global::G.AutoChunkingStrategyRequestParam), options); } - else if (value.IsValue2) + else if (value.IsStatic) { - global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeof(global::G.StaticChunkingStrategyRequestParam), options); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Static, typeof(global::G.StaticChunkingStrategyRequestParam), options); } } } diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/AnyOfs/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/AnyOfs/_.verified.txt index 22f54bc80d..e5630b1631 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/AnyOfs/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/LangSmith/AnyOfs/_.verified.txt @@ -6,7 +6,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: AnyOf, @@ -15,7 +15,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: AnyOf, @@ -24,6 +24,6 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null } ] \ No newline at end of file diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/AnyOfs/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/AnyOfs/_.verified.txt index 33e32be325..8834092c49 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/AnyOfs/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/Ollama/AnyOfs/_.verified.txt @@ -6,7 +6,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: AnyOf, @@ -15,46 +15,68 @@ Namespace: G, Name: DoneReason, Summary: Reason why the model is done generating a response., - Types: [ + Properties: [ { - CSharpType: string, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: string, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: string, + CSharpTypeWithNullability: string?, + ShortCSharpTypeWithoutNullability: string, + ShortCSharpTypeWithNullability: string?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: string, - CSharpTypeWithNullability: string?, - ShortCSharpTypeWithoutNullability: string, - ShortCSharpTypeWithNullability: string?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.DoneReasonVariant2, - IsArray: false, - IsEnum: true, - Properties: [ - Stop, - Length, - Load - ], - EnumValues: [ - stop, - length, - load - ], - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.DoneReasonVariant2, + IsArray: false, + IsEnum: true, + Properties: [ + Stop, + Length, + Load + ], + EnumValues: [ + stop, + length, + load + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: global::G.DoneReasonVariant2, + CSharpTypeWithNullability: global::G.DoneReasonVariant2?, + ShortCSharpTypeWithoutNullability: DoneReasonVariant2, + ShortCSharpTypeWithNullability: DoneReasonVariant2?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.DoneReasonVariant2JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: global::G.DoneReasonVariant2, - CSharpTypeWithNullability: global::G.DoneReasonVariant2?, - ShortCSharpTypeWithoutNullability: DoneReasonVariant2, - ShortCSharpTypeWithNullability: DoneReasonVariant2?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.DoneReasonVariant2JsonConverter + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -65,46 +87,68 @@ Namespace: G, Name: CreateModelStatus, Summary: Status creating the model, - Types: [ + Properties: [ { - CSharpType: string, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: string, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: string, + CSharpTypeWithNullability: string?, + ShortCSharpTypeWithoutNullability: string, + ShortCSharpTypeWithNullability: string?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: string, - CSharpTypeWithNullability: string?, - ShortCSharpTypeWithoutNullability: string, - ShortCSharpTypeWithNullability: string?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.CreateModelStatusVariant2, - IsArray: false, - IsEnum: true, - Properties: [ - CreatingSystemLayer, - ParsingModelfile, - Success - ], - EnumValues: [ - creating system layer, - parsing modelfile, - success - ], - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.CreateModelStatusVariant2, + IsArray: false, + IsEnum: true, + Properties: [ + CreatingSystemLayer, + ParsingModelfile, + Success + ], + EnumValues: [ + creating system layer, + parsing modelfile, + success + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: global::G.CreateModelStatusVariant2, + CSharpTypeWithNullability: global::G.CreateModelStatusVariant2?, + ShortCSharpTypeWithoutNullability: CreateModelStatusVariant2, + ShortCSharpTypeWithNullability: CreateModelStatusVariant2?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.CreateModelStatusVariant2JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: global::G.CreateModelStatusVariant2, - CSharpTypeWithNullability: global::G.CreateModelStatusVariant2?, - ShortCSharpTypeWithoutNullability: CreateModelStatusVariant2, - ShortCSharpTypeWithNullability: CreateModelStatusVariant2?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.CreateModelStatusVariant2JsonConverter + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -117,52 +161,74 @@ Summary: Status pulling the model. Example: pulling manifest, - Types: [ + Properties: [ { - CSharpType: string, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: string, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: string, + CSharpTypeWithNullability: string?, + ShortCSharpTypeWithoutNullability: string, + ShortCSharpTypeWithNullability: string?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: string, - CSharpTypeWithNullability: string?, - ShortCSharpTypeWithoutNullability: string, - ShortCSharpTypeWithNullability: string?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.PullModelStatusVariant2, - IsArray: false, - IsEnum: true, - Properties: [ - PullingManifest, - DownloadingDigestname, - VerifyingSha256Digest, - WritingManifest, - RemovingAnyUnusedLayers, - Success - ], - EnumValues: [ - pulling manifest, - downloading digestname, - verifying sha256 digest, - writing manifest, - removing any unused layers, - success - ], - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.PullModelStatusVariant2, + IsArray: false, + IsEnum: true, + Properties: [ + PullingManifest, + DownloadingDigestname, + VerifyingSha256Digest, + WritingManifest, + RemovingAnyUnusedLayers, + Success + ], + EnumValues: [ + pulling manifest, + downloading digestname, + verifying sha256 digest, + writing manifest, + removing any unused layers, + success + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: global::G.PullModelStatusVariant2, + CSharpTypeWithNullability: global::G.PullModelStatusVariant2?, + ShortCSharpTypeWithoutNullability: PullModelStatusVariant2, + ShortCSharpTypeWithNullability: PullModelStatusVariant2?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.PullModelStatusVariant2JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: global::G.PullModelStatusVariant2, - CSharpTypeWithNullability: global::G.PullModelStatusVariant2?, - ShortCSharpTypeWithoutNullability: PullModelStatusVariant2, - ShortCSharpTypeWithNullability: PullModelStatusVariant2?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.PullModelStatusVariant2JsonConverter + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -173,48 +239,70 @@ Example: pulling manifest, Namespace: G, Name: PushModelStatus, Summary: Status pushing the model., - Types: [ + Properties: [ { - CSharpType: string, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: string, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: string, + CSharpTypeWithNullability: string?, + ShortCSharpTypeWithoutNullability: string, + ShortCSharpTypeWithNullability: string?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: string, - CSharpTypeWithNullability: string?, - ShortCSharpTypeWithoutNullability: string, - ShortCSharpTypeWithNullability: string?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.PushModelStatusVariant2, - IsArray: false, - IsEnum: true, - Properties: [ - RetrievingManifest, - StartingUpload, - PushingManifest, - Success - ], - EnumValues: [ - retrieving manifest, - starting upload, - pushing manifest, - success - ], - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.PushModelStatusVariant2, + IsArray: false, + IsEnum: true, + Properties: [ + RetrievingManifest, + StartingUpload, + PushingManifest, + Success + ], + EnumValues: [ + retrieving manifest, + starting upload, + pushing manifest, + success + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: true, + CSharpTypeWithoutNullability: global::G.PushModelStatusVariant2, + CSharpTypeWithNullability: global::G.PushModelStatusVariant2?, + ShortCSharpTypeWithoutNullability: PushModelStatusVariant2, + ShortCSharpTypeWithNullability: PushModelStatusVariant2?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.PushModelStatusVariant2JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: true, - CSharpTypeWithoutNullability: global::G.PushModelStatusVariant2, - CSharpTypeWithNullability: global::G.PushModelStatusVariant2?, - ShortCSharpTypeWithoutNullability: PushModelStatusVariant2, - ShortCSharpTypeWithNullability: PushModelStatusVariant2?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.PushModelStatusVariant2JsonConverter + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] } diff --git a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/AnyOfs/_.verified.txt b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/AnyOfs/_.verified.txt index 1bcbffb6e2..4c3b1673b4 100644 --- a/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/AnyOfs/_.verified.txt +++ b/src/tests/OpenApiGenerator.UnitTests/Snapshots/OpenAi/AnyOfs/_.verified.txt @@ -6,7 +6,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: AnyOf, @@ -15,7 +15,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -24,7 +24,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -33,7 +33,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -42,7 +42,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -51,7 +51,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -60,7 +60,7 @@ Namespace: System, Name: , Summary: , - Types: null + Properties: null }, { SubType: OneOf, @@ -69,44 +69,66 @@ Namespace: G, Name: ChatCompletionRequestMessageContentPart, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.ChatCompletionRequestMessageContentPartText, - IsArray: false, - IsEnum: false, - Properties: [ - type, - text - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Text, + Type: { + CSharpType: global::G.ChatCompletionRequestMessageContentPartText, + IsArray: false, + IsEnum: false, + Properties: [ + type, + text + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestMessageContentPartText, + CSharpTypeWithNullability: global::G.ChatCompletionRequestMessageContentPartText?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestMessageContentPartText, + ShortCSharpTypeWithNullability: ChatCompletionRequestMessageContentPartText?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestMessageContentPartText, - CSharpTypeWithNullability: global::G.ChatCompletionRequestMessageContentPartText?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestMessageContentPartText, - ShortCSharpTypeWithNullability: ChatCompletionRequestMessageContentPartText?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: text, + ArgumentName: text, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestMessageContentPartImage, - IsArray: false, - IsEnum: false, - Properties: [ - type, - image_url - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Image, + Type: { + CSharpType: global::G.ChatCompletionRequestMessageContentPartImage, + IsArray: false, + IsEnum: false, + Properties: [ + type, + image_url + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestMessageContentPartImage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestMessageContentPartImage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestMessageContentPartImage, + ShortCSharpTypeWithNullability: ChatCompletionRequestMessageContentPartImage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestMessageContentPartImage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestMessageContentPartImage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestMessageContentPartImage, - ShortCSharpTypeWithNullability: ChatCompletionRequestMessageContentPartImage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: image, + ArgumentName: image, + ParameterDefaultValue: default } ] }, @@ -117,108 +139,163 @@ Namespace: G, Name: ChatCompletionRequestMessage, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.ChatCompletionRequestSystemMessage, - IsArray: false, - IsEnum: false, - Properties: [ - content, - role, - name - ], - EnumValues: null, - Namespace: G, + Id: , + Name: System, + Type: { + CSharpType: global::G.ChatCompletionRequestSystemMessage, + IsArray: false, + IsEnum: false, + Properties: [ + content, + role, + name + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestSystemMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestSystemMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestSystemMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestSystemMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestSystemMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestSystemMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestSystemMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestSystemMessage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: system, + ArgumentName: system, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestUserMessage, - IsArray: false, - IsEnum: false, - Properties: [ - content, - role, - name - ], - EnumValues: null, - Namespace: G, + Id: , + Name: User, + Type: { + CSharpType: global::G.ChatCompletionRequestUserMessage, + IsArray: false, + IsEnum: false, + Properties: [ + content, + role, + name + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestUserMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestUserMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestUserMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestUserMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestUserMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestUserMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestUserMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestUserMessage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: user, + ArgumentName: user, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestAssistantMessage, - IsArray: false, - IsEnum: false, - Properties: [ - content, - role, - name, - tool_calls, - function_call - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Assistant, + Type: { + CSharpType: global::G.ChatCompletionRequestAssistantMessage, + IsArray: false, + IsEnum: false, + Properties: [ + content, + role, + name, + tool_calls, + function_call + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestAssistantMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestAssistantMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestAssistantMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestAssistantMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestAssistantMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestAssistantMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestAssistantMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestAssistantMessage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: assistant, + ArgumentName: assistant, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestToolMessage, - IsArray: false, - IsEnum: false, - Properties: [ - role, - content, - tool_call_id - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Tool, + Type: { + CSharpType: global::G.ChatCompletionRequestToolMessage, + IsArray: false, + IsEnum: false, + Properties: [ + role, + content, + tool_call_id + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestToolMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestToolMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestToolMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestToolMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestToolMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestToolMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestToolMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestToolMessage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: tool, + ArgumentName: tool, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestFunctionMessage, - IsArray: false, - IsEnum: false, - Properties: [ - role, - content, - name - ], - EnumValues: null, - Namespace: G, - IsDeprecated: true, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestFunctionMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestFunctionMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestFunctionMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestFunctionMessage?, - IsAnyOf: false, - ConverterType: + Id: , + Name: Function, + Type: { + CSharpType: global::G.ChatCompletionRequestFunctionMessage, + IsArray: false, + IsEnum: false, + Properties: [ + role, + content, + name + ], + EnumValues: null, + Namespace: G, + IsDeprecated: true, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestFunctionMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestFunctionMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestFunctionMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestFunctionMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, + IsDeprecated: false, + Summary: , + ConverterType: , + ParameterName: function, + ArgumentName: function, + ParameterDefaultValue: default } ] }, @@ -237,49 +314,71 @@ Specifying a particular tool via `{"type": "function", "function": {"name": "my_ `none` is the default when no tools are present. `auto` is the default if tools are present. , - Types: [ + Properties: [ { - CSharpType: global::G.ChatCompletionToolChoiceOptionVariant1, - IsArray: false, - IsEnum: true, - Properties: [ - None, - Auto, - Required - ], - EnumValues: [ - none, - auto, - required - ], - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.ChatCompletionToolChoiceOptionVariant1, + IsArray: false, + IsEnum: true, + Properties: [ + None, + Auto, + Required + ], + EnumValues: [ + none, + auto, + required + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionToolChoiceOptionVariant1, + CSharpTypeWithNullability: global::G.ChatCompletionToolChoiceOptionVariant1?, + ShortCSharpTypeWithoutNullability: ChatCompletionToolChoiceOptionVariant1, + ShortCSharpTypeWithNullability: ChatCompletionToolChoiceOptionVariant1?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.ChatCompletionToolChoiceOptionVariant1JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionToolChoiceOptionVariant1, - CSharpTypeWithNullability: global::G.ChatCompletionToolChoiceOptionVariant1?, - ShortCSharpTypeWithoutNullability: ChatCompletionToolChoiceOptionVariant1, - ShortCSharpTypeWithNullability: ChatCompletionToolChoiceOptionVariant1?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.ChatCompletionToolChoiceOptionVariant1JsonConverter + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionNamedToolChoice, - IsArray: false, - IsEnum: false, - Properties: [ - type, - function - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.ChatCompletionNamedToolChoice, + IsArray: false, + IsEnum: false, + Properties: [ + type, + function + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionNamedToolChoice, + CSharpTypeWithNullability: global::G.ChatCompletionNamedToolChoice?, + ShortCSharpTypeWithoutNullability: ChatCompletionNamedToolChoice, + ShortCSharpTypeWithNullability: ChatCompletionNamedToolChoice?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionNamedToolChoice, - CSharpTypeWithNullability: global::G.ChatCompletionNamedToolChoice?, - ShortCSharpTypeWithoutNullability: ChatCompletionNamedToolChoice, - ShortCSharpTypeWithNullability: ChatCompletionNamedToolChoice?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -296,46 +395,68 @@ Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the m **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. , - Types: [ + Properties: [ { - CSharpType: global::G.AssistantsApiResponseFormatOptionVariant1, - IsArray: false, - IsEnum: true, - Properties: [ - None, - Auto - ], - EnumValues: [ - none, - auto - ], - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.AssistantsApiResponseFormatOptionVariant1, + IsArray: false, + IsEnum: true, + Properties: [ + None, + Auto + ], + EnumValues: [ + none, + auto + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.AssistantsApiResponseFormatOptionVariant1, + CSharpTypeWithNullability: global::G.AssistantsApiResponseFormatOptionVariant1?, + ShortCSharpTypeWithoutNullability: AssistantsApiResponseFormatOptionVariant1, + ShortCSharpTypeWithNullability: AssistantsApiResponseFormatOptionVariant1?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatOptionVariant1JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.AssistantsApiResponseFormatOptionVariant1, - CSharpTypeWithNullability: global::G.AssistantsApiResponseFormatOptionVariant1?, - ShortCSharpTypeWithoutNullability: AssistantsApiResponseFormatOptionVariant1, - ShortCSharpTypeWithNullability: AssistantsApiResponseFormatOptionVariant1?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.AssistantsApiResponseFormatOptionVariant1JsonConverter + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.AssistantsApiResponseFormat, - IsArray: false, - IsEnum: false, - Properties: [ - type - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.AssistantsApiResponseFormat, + IsArray: false, + IsEnum: false, + Properties: [ + type + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.AssistantsApiResponseFormat, + CSharpTypeWithNullability: global::G.AssistantsApiResponseFormat?, + ShortCSharpTypeWithoutNullability: AssistantsApiResponseFormat, + ShortCSharpTypeWithNullability: AssistantsApiResponseFormat?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.AssistantsApiResponseFormat, - CSharpTypeWithNullability: global::G.AssistantsApiResponseFormat?, - ShortCSharpTypeWithoutNullability: AssistantsApiResponseFormat, - ShortCSharpTypeWithNullability: AssistantsApiResponseFormat?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -352,49 +473,71 @@ Controls which (if any) tool is called by the model. `required` means the model must call one or more tools before responding to the user. Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. , - Types: [ + Properties: [ { - CSharpType: global::G.AssistantsApiToolChoiceOptionVariant1, - IsArray: false, - IsEnum: true, - Properties: [ - None, - Auto, - Required - ], - EnumValues: [ - none, - auto, - required - ], - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.AssistantsApiToolChoiceOptionVariant1, + IsArray: false, + IsEnum: true, + Properties: [ + None, + Auto, + Required + ], + EnumValues: [ + none, + auto, + required + ], + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.AssistantsApiToolChoiceOptionVariant1, + CSharpTypeWithNullability: global::G.AssistantsApiToolChoiceOptionVariant1?, + ShortCSharpTypeWithoutNullability: AssistantsApiToolChoiceOptionVariant1, + ShortCSharpTypeWithNullability: AssistantsApiToolChoiceOptionVariant1?, + IsAnyOf: false, + ConverterType: global::OpenApiGenerator.JsonConverters.AssistantsApiToolChoiceOptionVariant1JsonConverter + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.AssistantsApiToolChoiceOptionVariant1, - CSharpTypeWithNullability: global::G.AssistantsApiToolChoiceOptionVariant1?, - ShortCSharpTypeWithoutNullability: AssistantsApiToolChoiceOptionVariant1, - ShortCSharpTypeWithNullability: AssistantsApiToolChoiceOptionVariant1?, - IsAnyOf: false, - ConverterType: global::OpenApiGenerator.JsonConverters.AssistantsApiToolChoiceOptionVariant1JsonConverter + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.AssistantsNamedToolChoice, - IsArray: false, - IsEnum: false, - Properties: [ - type, - function - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.AssistantsNamedToolChoice, + IsArray: false, + IsEnum: false, + Properties: [ + type, + function + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.AssistantsNamedToolChoice, + CSharpTypeWithNullability: global::G.AssistantsNamedToolChoice?, + ShortCSharpTypeWithoutNullability: AssistantsNamedToolChoice, + ShortCSharpTypeWithNullability: AssistantsNamedToolChoice?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.AssistantsNamedToolChoice, - CSharpTypeWithNullability: global::G.AssistantsNamedToolChoice?, - ShortCSharpTypeWithoutNullability: AssistantsNamedToolChoice, - ShortCSharpTypeWithNullability: AssistantsNamedToolChoice?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] }, @@ -405,43 +548,65 @@ Specifying a particular tool like `{"type": "file_search"}` or `{"type": "functi Namespace: G, Name: ChunkingStrategyRequestParam, Summary: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy., - Types: [ + Properties: [ { - CSharpType: global::G.AutoChunkingStrategyRequestParam, - IsArray: false, - IsEnum: false, - Properties: [ - type - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Auto, + Type: { + CSharpType: global::G.AutoChunkingStrategyRequestParam, + IsArray: false, + IsEnum: false, + Properties: [ + type + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.AutoChunkingStrategyRequestParam, + CSharpTypeWithNullability: global::G.AutoChunkingStrategyRequestParam?, + ShortCSharpTypeWithoutNullability: AutoChunkingStrategyRequestParam, + ShortCSharpTypeWithNullability: AutoChunkingStrategyRequestParam?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.AutoChunkingStrategyRequestParam, - CSharpTypeWithNullability: global::G.AutoChunkingStrategyRequestParam?, - ShortCSharpTypeWithoutNullability: AutoChunkingStrategyRequestParam, - ShortCSharpTypeWithNullability: AutoChunkingStrategyRequestParam?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: auto, + ArgumentName: auto, + ParameterDefaultValue: default }, { - CSharpType: global::G.StaticChunkingStrategyRequestParam, - IsArray: false, - IsEnum: false, - Properties: [ - type, - static - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Static, + Type: { + CSharpType: global::G.StaticChunkingStrategyRequestParam, + IsArray: false, + IsEnum: false, + Properties: [ + type, + static + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.StaticChunkingStrategyRequestParam, + CSharpTypeWithNullability: global::G.StaticChunkingStrategyRequestParam?, + ShortCSharpTypeWithoutNullability: StaticChunkingStrategyRequestParam, + ShortCSharpTypeWithNullability: StaticChunkingStrategyRequestParam?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.StaticChunkingStrategyRequestParam, - CSharpTypeWithNullability: global::G.StaticChunkingStrategyRequestParam?, - ShortCSharpTypeWithoutNullability: StaticChunkingStrategyRequestParam, - ShortCSharpTypeWithNullability: StaticChunkingStrategyRequestParam?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: @static, + ArgumentName: @static, + ParameterDefaultValue: default } ] }, @@ -472,112 +637,178 @@ We may add additional events over time, so we recommend handling unknown events in your code. See the [Assistants API quickstart](/docs/assistants/overview) to learn how to integrate the Assistants API with streaming. , - Types: [ + Properties: [ { - CSharpType: global::G.ThreadStreamEvent, - IsArray: false, - IsEnum: false, - OneOfCount: 1, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Thread, + Type: { + CSharpType: global::G.ThreadStreamEvent, + IsArray: false, + IsEnum: false, + OneOfCount: 1, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ThreadStreamEvent, + CSharpTypeWithNullability: global::G.ThreadStreamEvent?, + ShortCSharpTypeWithoutNullability: ThreadStreamEvent, + ShortCSharpTypeWithNullability: ThreadStreamEvent?, + IsAnyOf: true, + ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory1 + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ThreadStreamEvent, - CSharpTypeWithNullability: global::G.ThreadStreamEvent?, - ShortCSharpTypeWithoutNullability: ThreadStreamEvent, - ShortCSharpTypeWithNullability: ThreadStreamEvent?, - IsAnyOf: true, - ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory1 + Summary: , + ConverterType: , + ParameterName: thread, + ArgumentName: thread, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEvent, - IsArray: false, - IsEnum: false, - OneOfCount: 10, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Run, + Type: { + CSharpType: global::G.RunStreamEvent, + IsArray: false, + IsEnum: false, + OneOfCount: 10, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEvent, + CSharpTypeWithNullability: global::G.RunStreamEvent?, + ShortCSharpTypeWithoutNullability: RunStreamEvent, + ShortCSharpTypeWithNullability: RunStreamEvent?, + IsAnyOf: true, + ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory10 + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEvent, - CSharpTypeWithNullability: global::G.RunStreamEvent?, - ShortCSharpTypeWithoutNullability: RunStreamEvent, - ShortCSharpTypeWithNullability: RunStreamEvent?, - IsAnyOf: true, - ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory10 + Summary: , + ConverterType: , + ParameterName: run, + ArgumentName: run, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEvent, - IsArray: false, - IsEnum: false, - OneOfCount: 7, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: RunStep, + Type: { + CSharpType: global::G.RunStepStreamEvent, + IsArray: false, + IsEnum: false, + OneOfCount: 7, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEvent, + CSharpTypeWithNullability: global::G.RunStepStreamEvent?, + ShortCSharpTypeWithoutNullability: RunStepStreamEvent, + ShortCSharpTypeWithNullability: RunStepStreamEvent?, + IsAnyOf: true, + ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory7 + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEvent, - CSharpTypeWithNullability: global::G.RunStepStreamEvent?, - ShortCSharpTypeWithoutNullability: RunStepStreamEvent, - ShortCSharpTypeWithNullability: RunStepStreamEvent?, - IsAnyOf: true, - ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory7 + Summary: , + ConverterType: , + ParameterName: runStep, + ArgumentName: runStep, + ParameterDefaultValue: default }, { - CSharpType: global::G.MessageStreamEvent, - IsArray: false, - IsEnum: false, - OneOfCount: 5, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Message, + Type: { + CSharpType: global::G.MessageStreamEvent, + IsArray: false, + IsEnum: false, + OneOfCount: 5, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEvent, + CSharpTypeWithNullability: global::G.MessageStreamEvent?, + ShortCSharpTypeWithoutNullability: MessageStreamEvent, + ShortCSharpTypeWithNullability: MessageStreamEvent?, + IsAnyOf: true, + ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory5 + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEvent, - CSharpTypeWithNullability: global::G.MessageStreamEvent?, - ShortCSharpTypeWithoutNullability: MessageStreamEvent, - ShortCSharpTypeWithNullability: MessageStreamEvent?, - IsAnyOf: true, - ConverterType: global::OpenApiGenerator.JsonConverters.OneOfJsonConverterFactory5 + Summary: , + ConverterType: , + ParameterName: message, + ArgumentName: message, + ParameterDefaultValue: default }, { - CSharpType: global::G.ErrorEvent, - IsArray: false, - IsEnum: false, - Properties: [ - event, - data - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Error, + Type: { + CSharpType: global::G.ErrorEvent, + IsArray: false, + IsEnum: false, + Properties: [ + event, + data + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ErrorEvent, + CSharpTypeWithNullability: global::G.ErrorEvent?, + ShortCSharpTypeWithoutNullability: ErrorEvent, + ShortCSharpTypeWithNullability: ErrorEvent?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ErrorEvent, - CSharpTypeWithNullability: global::G.ErrorEvent?, - ShortCSharpTypeWithoutNullability: ErrorEvent, - ShortCSharpTypeWithNullability: ErrorEvent?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: error, + ArgumentName: error, + ParameterDefaultValue: default }, { - CSharpType: global::G.DoneEvent, - IsArray: false, - IsEnum: false, - Properties: [ - event, - data - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Done, + Type: { + CSharpType: global::G.DoneEvent, + IsArray: false, + IsEnum: false, + Properties: [ + event, + data + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.DoneEvent, + CSharpTypeWithNullability: global::G.DoneEvent?, + ShortCSharpTypeWithoutNullability: DoneEvent, + ShortCSharpTypeWithNullability: DoneEvent?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.DoneEvent, - CSharpTypeWithNullability: global::G.DoneEvent?, - ShortCSharpTypeWithoutNullability: DoneEvent, - ShortCSharpTypeWithNullability: DoneEvent?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: done, + ArgumentName: done, + ParameterDefaultValue: default } ] }, @@ -588,22 +819,33 @@ integrate the Assistants API with streaming. Namespace: G, Name: ThreadStreamEvent, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.ThreadStreamEventVariant1, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.ThreadStreamEventVariant1, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ThreadStreamEventVariant1, + CSharpTypeWithNullability: global::G.ThreadStreamEventVariant1?, + ShortCSharpTypeWithoutNullability: ThreadStreamEventVariant1, + ShortCSharpTypeWithNullability: ThreadStreamEventVariant1?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ThreadStreamEventVariant1, - CSharpTypeWithNullability: global::G.ThreadStreamEventVariant1?, - ShortCSharpTypeWithoutNullability: ThreadStreamEventVariant1, - ShortCSharpTypeWithNullability: ThreadStreamEventVariant1?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default } ] }, @@ -614,166 +856,276 @@ integrate the Assistants API with streaming. Namespace: G, Name: RunStreamEvent, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.RunStreamEventVariant1, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.RunStreamEventVariant1, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant1, + CSharpTypeWithNullability: global::G.RunStreamEventVariant1?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant1, + ShortCSharpTypeWithNullability: RunStreamEventVariant1?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant1, - CSharpTypeWithNullability: global::G.RunStreamEventVariant1?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant1, - ShortCSharpTypeWithNullability: RunStreamEventVariant1?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant2, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.RunStreamEventVariant2, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant2, + CSharpTypeWithNullability: global::G.RunStreamEventVariant2?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant2, + ShortCSharpTypeWithNullability: RunStreamEventVariant2?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant2, - CSharpTypeWithNullability: global::G.RunStreamEventVariant2?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant2, - ShortCSharpTypeWithNullability: RunStreamEventVariant2?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant3, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value3, + Type: { + CSharpType: global::G.RunStreamEventVariant3, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant3, + CSharpTypeWithNullability: global::G.RunStreamEventVariant3?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant3, + ShortCSharpTypeWithNullability: RunStreamEventVariant3?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant3, - CSharpTypeWithNullability: global::G.RunStreamEventVariant3?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant3, - ShortCSharpTypeWithNullability: RunStreamEventVariant3?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value3, + ArgumentName: value3, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant4, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value4, + Type: { + CSharpType: global::G.RunStreamEventVariant4, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant4, + CSharpTypeWithNullability: global::G.RunStreamEventVariant4?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant4, + ShortCSharpTypeWithNullability: RunStreamEventVariant4?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant4, - CSharpTypeWithNullability: global::G.RunStreamEventVariant4?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant4, - ShortCSharpTypeWithNullability: RunStreamEventVariant4?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value4, + ArgumentName: value4, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant5, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value5, + Type: { + CSharpType: global::G.RunStreamEventVariant5, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant5, + CSharpTypeWithNullability: global::G.RunStreamEventVariant5?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant5, + ShortCSharpTypeWithNullability: RunStreamEventVariant5?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant5, - CSharpTypeWithNullability: global::G.RunStreamEventVariant5?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant5, - ShortCSharpTypeWithNullability: RunStreamEventVariant5?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value5, + ArgumentName: value5, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant6, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value6, + Type: { + CSharpType: global::G.RunStreamEventVariant6, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant6, + CSharpTypeWithNullability: global::G.RunStreamEventVariant6?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant6, + ShortCSharpTypeWithNullability: RunStreamEventVariant6?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant6, - CSharpTypeWithNullability: global::G.RunStreamEventVariant6?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant6, - ShortCSharpTypeWithNullability: RunStreamEventVariant6?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value6, + ArgumentName: value6, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant7, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value7, + Type: { + CSharpType: global::G.RunStreamEventVariant7, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant7, + CSharpTypeWithNullability: global::G.RunStreamEventVariant7?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant7, + ShortCSharpTypeWithNullability: RunStreamEventVariant7?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant7, - CSharpTypeWithNullability: global::G.RunStreamEventVariant7?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant7, - ShortCSharpTypeWithNullability: RunStreamEventVariant7?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value7, + ArgumentName: value7, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant8, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value8, + Type: { + CSharpType: global::G.RunStreamEventVariant8, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant8, + CSharpTypeWithNullability: global::G.RunStreamEventVariant8?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant8, + ShortCSharpTypeWithNullability: RunStreamEventVariant8?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant8, - CSharpTypeWithNullability: global::G.RunStreamEventVariant8?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant8, - ShortCSharpTypeWithNullability: RunStreamEventVariant8?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value8, + ArgumentName: value8, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant9, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value9, + Type: { + CSharpType: global::G.RunStreamEventVariant9, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant9, + CSharpTypeWithNullability: global::G.RunStreamEventVariant9?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant9, + ShortCSharpTypeWithNullability: RunStreamEventVariant9?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant9, - CSharpTypeWithNullability: global::G.RunStreamEventVariant9?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant9, - ShortCSharpTypeWithNullability: RunStreamEventVariant9?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value9, + ArgumentName: value9, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStreamEventVariant10, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value10, + Type: { + CSharpType: global::G.RunStreamEventVariant10, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStreamEventVariant10, + CSharpTypeWithNullability: global::G.RunStreamEventVariant10?, + ShortCSharpTypeWithoutNullability: RunStreamEventVariant10, + ShortCSharpTypeWithNullability: RunStreamEventVariant10?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStreamEventVariant10, - CSharpTypeWithNullability: global::G.RunStreamEventVariant10?, - ShortCSharpTypeWithoutNullability: RunStreamEventVariant10, - ShortCSharpTypeWithNullability: RunStreamEventVariant10?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value10, + ArgumentName: value10, + ParameterDefaultValue: default } ] }, @@ -784,118 +1136,195 @@ integrate the Assistants API with streaming. Namespace: G, Name: RunStepStreamEvent, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.RunStepStreamEventVariant1, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.RunStepStreamEventVariant1, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant1, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant1?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant1, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant1?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant1, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant1?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant1, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant1?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant2, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.RunStepStreamEventVariant2, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant2, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant2?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant2, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant2?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant2, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant2?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant2, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant2?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant3, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value3, + Type: { + CSharpType: global::G.RunStepStreamEventVariant3, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant3, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant3?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant3, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant3?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant3, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant3?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant3, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant3?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value3, + ArgumentName: value3, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant4, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value4, + Type: { + CSharpType: global::G.RunStepStreamEventVariant4, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant4, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant4?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant4, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant4?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant4, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant4?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant4, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant4?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value4, + ArgumentName: value4, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant5, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value5, + Type: { + CSharpType: global::G.RunStepStreamEventVariant5, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant5, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant5?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant5, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant5?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant5, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant5?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant5, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant5?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value5, + ArgumentName: value5, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant6, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value6, + Type: { + CSharpType: global::G.RunStepStreamEventVariant6, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant6, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant6?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant6, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant6?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant6, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant6?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant6, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant6?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value6, + ArgumentName: value6, + ParameterDefaultValue: default }, { - CSharpType: global::G.RunStepStreamEventVariant7, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value7, + Type: { + CSharpType: global::G.RunStepStreamEventVariant7, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant7, + CSharpTypeWithNullability: global::G.RunStepStreamEventVariant7?, + ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant7, + ShortCSharpTypeWithNullability: RunStepStreamEventVariant7?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.RunStepStreamEventVariant7, - CSharpTypeWithNullability: global::G.RunStepStreamEventVariant7?, - ShortCSharpTypeWithoutNullability: RunStepStreamEventVariant7, - ShortCSharpTypeWithNullability: RunStepStreamEventVariant7?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value7, + ArgumentName: value7, + ParameterDefaultValue: default } ] }, @@ -906,86 +1335,141 @@ integrate the Assistants API with streaming. Namespace: G, Name: MessageStreamEvent, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.MessageStreamEventVariant1, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.MessageStreamEventVariant1, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant1, + CSharpTypeWithNullability: global::G.MessageStreamEventVariant1?, + ShortCSharpTypeWithoutNullability: MessageStreamEventVariant1, + ShortCSharpTypeWithNullability: MessageStreamEventVariant1?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant1, - CSharpTypeWithNullability: global::G.MessageStreamEventVariant1?, - ShortCSharpTypeWithoutNullability: MessageStreamEventVariant1, - ShortCSharpTypeWithNullability: MessageStreamEventVariant1?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.MessageStreamEventVariant2, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.MessageStreamEventVariant2, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant2, + CSharpTypeWithNullability: global::G.MessageStreamEventVariant2?, + ShortCSharpTypeWithoutNullability: MessageStreamEventVariant2, + ShortCSharpTypeWithNullability: MessageStreamEventVariant2?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant2, - CSharpTypeWithNullability: global::G.MessageStreamEventVariant2?, - ShortCSharpTypeWithoutNullability: MessageStreamEventVariant2, - ShortCSharpTypeWithNullability: MessageStreamEventVariant2?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default }, { - CSharpType: global::G.MessageStreamEventVariant3, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value3, + Type: { + CSharpType: global::G.MessageStreamEventVariant3, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant3, + CSharpTypeWithNullability: global::G.MessageStreamEventVariant3?, + ShortCSharpTypeWithoutNullability: MessageStreamEventVariant3, + ShortCSharpTypeWithNullability: MessageStreamEventVariant3?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant3, - CSharpTypeWithNullability: global::G.MessageStreamEventVariant3?, - ShortCSharpTypeWithoutNullability: MessageStreamEventVariant3, - ShortCSharpTypeWithNullability: MessageStreamEventVariant3?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value3, + ArgumentName: value3, + ParameterDefaultValue: default }, { - CSharpType: global::G.MessageStreamEventVariant4, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value4, + Type: { + CSharpType: global::G.MessageStreamEventVariant4, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant4, + CSharpTypeWithNullability: global::G.MessageStreamEventVariant4?, + ShortCSharpTypeWithoutNullability: MessageStreamEventVariant4, + ShortCSharpTypeWithNullability: MessageStreamEventVariant4?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant4, - CSharpTypeWithNullability: global::G.MessageStreamEventVariant4?, - ShortCSharpTypeWithoutNullability: MessageStreamEventVariant4, - ShortCSharpTypeWithNullability: MessageStreamEventVariant4?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value4, + ArgumentName: value4, + ParameterDefaultValue: default }, { - CSharpType: global::G.MessageStreamEventVariant5, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value5, + Type: { + CSharpType: global::G.MessageStreamEventVariant5, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant5, + CSharpTypeWithNullability: global::G.MessageStreamEventVariant5?, + ShortCSharpTypeWithoutNullability: MessageStreamEventVariant5, + ShortCSharpTypeWithNullability: MessageStreamEventVariant5?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.MessageStreamEventVariant5, - CSharpTypeWithNullability: global::G.MessageStreamEventVariant5?, - ShortCSharpTypeWithoutNullability: MessageStreamEventVariant5, - ShortCSharpTypeWithNullability: MessageStreamEventVariant5?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value5, + ArgumentName: value5, + ParameterDefaultValue: default } ] }, @@ -996,44 +1480,66 @@ integrate the Assistants API with streaming. Namespace: G, Name: FineTuneChatCompletionRequestAssistantMessage, Summary: , - Types: [ + Properties: [ { - CSharpType: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1, - IsArray: false, - IsEnum: false, - Properties: null, - EnumValues: null, - Namespace: G, + Id: , + Name: Value1, + Type: { + CSharpType: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1, + IsArray: false, + IsEnum: false, + Properties: null, + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1, + CSharpTypeWithNullability: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1?, + ShortCSharpTypeWithoutNullability: FineTuneChatCompletionRequestAssistantMessageVariant1, + ShortCSharpTypeWithNullability: FineTuneChatCompletionRequestAssistantMessageVariant1?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1, - CSharpTypeWithNullability: global::G.FineTuneChatCompletionRequestAssistantMessageVariant1?, - ShortCSharpTypeWithoutNullability: FineTuneChatCompletionRequestAssistantMessageVariant1, - ShortCSharpTypeWithNullability: FineTuneChatCompletionRequestAssistantMessageVariant1?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value1, + ArgumentName: value1, + ParameterDefaultValue: default }, { - CSharpType: global::G.ChatCompletionRequestAssistantMessage, - IsArray: false, - IsEnum: false, - Properties: [ - content, - role, - name, - tool_calls, - function_call - ], - EnumValues: null, - Namespace: G, + Id: , + Name: Value2, + Type: { + CSharpType: global::G.ChatCompletionRequestAssistantMessage, + IsArray: false, + IsEnum: false, + Properties: [ + content, + role, + name, + tool_calls, + function_call + ], + EnumValues: null, + Namespace: G, + IsDeprecated: false, + GenerateJsonSerializerContextTypes: false, + CSharpTypeWithoutNullability: global::G.ChatCompletionRequestAssistantMessage, + CSharpTypeWithNullability: global::G.ChatCompletionRequestAssistantMessage?, + ShortCSharpTypeWithoutNullability: ChatCompletionRequestAssistantMessage, + ShortCSharpTypeWithNullability: ChatCompletionRequestAssistantMessage?, + IsAnyOf: false, + ConverterType: + }, + IsRequired: false, IsDeprecated: false, - GenerateJsonSerializerContextTypes: false, - CSharpTypeWithoutNullability: global::G.ChatCompletionRequestAssistantMessage, - CSharpTypeWithNullability: global::G.ChatCompletionRequestAssistantMessage?, - ShortCSharpTypeWithoutNullability: ChatCompletionRequestAssistantMessage, - ShortCSharpTypeWithNullability: ChatCompletionRequestAssistantMessage?, - IsAnyOf: false, - ConverterType: + Summary: , + ConverterType: , + ParameterName: value2, + ArgumentName: value2, + ParameterDefaultValue: default } ] } diff --git a/src/tests/OpenApiGenerator.UnitTests/Tests.SmartNamedAnyOfNames.cs b/src/tests/OpenApiGenerator.UnitTests/Tests.SmartNamedAnyOfNames.cs new file mode 100644 index 0000000000..d1d5699577 --- /dev/null +++ b/src/tests/OpenApiGenerator.UnitTests/Tests.SmartNamedAnyOfNames.cs @@ -0,0 +1,15 @@ +using OpenApiGenerator.Core.Helpers; + +namespace OpenApiGenerator.UnitTests; + +[TestClass] +public partial class Tests +{ + [TestMethod] + public void SmartNamedAnyOfNames_Valid() + { + SmartNamedAnyOfNames.ComputeSmartName( + typeName: "ChatCompletionRequestMessageContentPartText", + className: "ChatCompletionRequestMessageContentPart").Should().Be("Text"); + } +} \ No newline at end of file