diff --git a/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem.g.cs
new file mode 100644
index 00000000..bfb25770
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class AnnotationsItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AnnotationsItem Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.MessageContentTextAnnotationsFileCitationObject? messageContentTextFileCitationObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType.FileCitation)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextAnnotationsFileCitationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentTextAnnotationsFileCitationObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageContentTextAnnotationsFilePathObject? messageContentTextFilePathObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType.FilePath)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextAnnotationsFilePathObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentTextAnnotationsFilePathObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.AnnotationsItem(
+ discriminator?.Type,
+ messageContentTextFileCitationObject,
+ messageContentTextFilePathObject
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AnnotationsItem value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsMessageContentTextFileCitationObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextAnnotationsFileCitationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentTextAnnotationsFileCitationObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageContentTextFileCitationObject, typeInfo);
+ }
+ else if (value.IsMessageContentTextFilePathObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextAnnotationsFilePathObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentTextAnnotationsFilePathObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageContentTextFilePathObject, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem2.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem2.g.cs
new file mode 100644
index 00000000..ad2e55e7
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AnnotationsItem2.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class AnnotationsItem2JsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AnnotationsItem2 Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.MessageDeltaContentTextAnnotationsFileCitationObject? messageDeltaContentTextFileCitationObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType.FileCitation)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFileCitationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentTextAnnotationsFileCitationObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageDeltaContentTextAnnotationsFilePathObject? messageDeltaContentTextFilePathObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType.FilePath)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFilePathObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentTextAnnotationsFilePathObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.AnnotationsItem2(
+ discriminator?.Type,
+ messageDeltaContentTextFileCitationObject,
+ messageDeltaContentTextFilePathObject
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AnnotationsItem2 value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsMessageDeltaContentTextFileCitationObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFileCitationObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFileCitationObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaContentTextFileCitationObject, typeInfo);
+ }
+ else if (value.IsMessageDeltaContentTextFilePathObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFilePathObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentTextAnnotationsFilePathObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaContentTextFilePathObject, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorType.g.cs
new file mode 100644
index 00000000..b61f6079
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantObjectToolDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantObjectToolDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantObjectToolDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantObjectToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantObjectToolDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantObjectToolDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..7af87d42
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantObjectToolDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantObjectToolDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantObjectToolDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantObjectToolDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantObjectToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantObjectToolDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantObjectToolDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEvent.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEvent.g.cs
index a97704cb..cd0006ba 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEvent.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEvent.g.cs
@@ -15,125 +15,217 @@ public class AssistantStreamEventJsonConverter : global::System.Text.Json.Serial
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- var
- readerCopy = reader;
- global::OpenAI.ThreadStreamEvent? thread = default;
- try
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.ErrorEvent? value1 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.Error)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ThreadStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ThreadStreamEvent).Name}");
- thread = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ErrorEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ErrorEvent)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.DoneEvent? value2 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.Done)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.DoneEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.DoneEvent)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
- global::OpenAI.RunStreamEvent? run = default;
- try
+ global::OpenAI.AssistantStreamEventVariant3? value3 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadCreated)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStreamEvent).Name}");
- run = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant3)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.AssistantStreamEventVariant4? value4 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunCreated)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant4)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
- global::OpenAI.RunStepStreamEvent? runStep = default;
- try
+ global::OpenAI.AssistantStreamEventVariant5? value5 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunQueued)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStepStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStepStreamEvent).Name}");
- runStep = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant5)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.AssistantStreamEventVariant6? value6 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunInProgress)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant6)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
- global::OpenAI.MessageStreamEvent? message = default;
- try
+ global::OpenAI.AssistantStreamEventVariant7? value7 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunRequiresAction)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageStreamEvent).Name}");
- message = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant7)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.AssistantStreamEventVariant8? value8 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunCompleted)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant8)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
- global::OpenAI.ErrorEvent? error = default;
- try
+ global::OpenAI.AssistantStreamEventVariant9? value9 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunIncomplete)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ErrorEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ErrorEvent).Name}");
- error = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant9)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.AssistantStreamEventVariant10? value10 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunFailed)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant10), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant10)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
- global::OpenAI.DoneEvent? done = default;
- try
+ global::OpenAI.AssistantStreamEventVariant11? value11 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunCancelling)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.DoneEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.DoneEvent).Name}");
- done = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant11), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant11)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- catch (global::System.Text.Json.JsonException)
+ global::OpenAI.AssistantStreamEventVariant12? value12 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunCancelled)
{
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant12), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant12)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- var result = new global::OpenAI.AssistantStreamEvent(
- thread,
- run,
- runStep,
- message,
- error,
- done
- );
-
- if (thread != null)
+ global::OpenAI.AssistantStreamEventVariant13? value13 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunExpired)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ThreadStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ThreadStreamEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant13), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant13)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- else if (run != null)
+ global::OpenAI.AssistantStreamEventVariant14? value14 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepCreated)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStreamEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant14), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant14)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- else if (runStep != null)
+ global::OpenAI.AssistantStreamEventVariant15? value15 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepInProgress)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStepStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStepStreamEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant15), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant15)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- else if (message != null)
+ global::OpenAI.AssistantStreamEventVariant16? value16 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepDelta)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageStreamEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant16), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant16)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- else if (error != null)
+ global::OpenAI.AssistantStreamEventVariant17? value17 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepCompleted)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ErrorEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ErrorEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant17), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant17)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
- else if (done != null)
+ global::OpenAI.AssistantStreamEventVariant18? value18 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepFailed)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.DoneEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.DoneEvent).Name}");
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant18), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant18)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant19? value19 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepCancelled)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant19), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant19)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant20? value20 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadRunStepExpired)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant20), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant20)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant21? value21 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadMessageCreated)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant21), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant21)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant22? value22 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadMessageInProgress)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant22), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant22)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant23? value23 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadMessageDelta)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant23), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant23)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant24? value24 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadMessageCompleted)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant24), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant24)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.AssistantStreamEventVariant25? value25 = default;
+ if (discriminator?.Event == global::OpenAI.AssistantStreamEventDiscriminatorEvent.ThreadMessageIncomplete)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant25), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AssistantStreamEventVariant25)}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
+ var result = new global::OpenAI.AssistantStreamEvent(
+ discriminator?.Event,
+ value1,
+ value2,
+ value3,
+ value4,
+ value5,
+ value6,
+ value7,
+ value8,
+ value9,
+ value10,
+ value11,
+ value12,
+ value13,
+ value14,
+ value15,
+ value16,
+ value17,
+ value18,
+ value19,
+ value20,
+ value21,
+ value22,
+ value23,
+ value24,
+ value25
+ );
+
return result;
}
@@ -146,41 +238,155 @@ public override void Write(
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- if (value.IsThread)
+ if (value.IsValue1)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ThreadStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ThreadStreamEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Thread, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ErrorEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ErrorEvent).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeInfo);
}
- else if (value.IsRun)
+ else if (value.IsValue2)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStreamEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Run, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.DoneEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.DoneEvent).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
}
- else if (value.IsRunStep)
+ else if (value.IsValue3)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.RunStepStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.RunStepStreamEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.RunStep, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant3), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant3).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value3, typeInfo);
}
- else if (value.IsMessage)
+ else if (value.IsValue4)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageStreamEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageStreamEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Message, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant4), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant4).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value4, typeInfo);
}
- else if (value.IsError)
+ else if (value.IsValue5)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ErrorEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ErrorEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Error, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant5), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant5).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value5, typeInfo);
}
- else if (value.IsDone)
+ else if (value.IsValue6)
{
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.DoneEvent), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.DoneEvent).Name}");
- global::System.Text.Json.JsonSerializer.Serialize(writer, value.Done, typeInfo);
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant6), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant6).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value6, typeInfo);
+ }
+ else if (value.IsValue7)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant7), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant7).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value7, typeInfo);
+ }
+ else if (value.IsValue8)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant8), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant8).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value8, typeInfo);
+ }
+ else if (value.IsValue9)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant9), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant9).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value9, typeInfo);
+ }
+ else if (value.IsValue10)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant10), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant10).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value10, typeInfo);
+ }
+ else if (value.IsValue11)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant11), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant11).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value11, typeInfo);
+ }
+ else if (value.IsValue12)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant12), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant12).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value12, typeInfo);
+ }
+ else if (value.IsValue13)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant13), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant13).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value13, typeInfo);
+ }
+ else if (value.IsValue14)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant14), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant14).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value14, typeInfo);
+ }
+ else if (value.IsValue15)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant15), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant15).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value15, typeInfo);
+ }
+ else if (value.IsValue16)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant16), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant16).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value16, typeInfo);
+ }
+ else if (value.IsValue17)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant17), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant17).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value17, typeInfo);
+ }
+ else if (value.IsValue18)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant18), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant18).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value18, typeInfo);
+ }
+ else if (value.IsValue19)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant19), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant19).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value19, typeInfo);
+ }
+ else if (value.IsValue20)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant20), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant20).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value20, typeInfo);
+ }
+ else if (value.IsValue21)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant21), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant21).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value21, typeInfo);
+ }
+ else if (value.IsValue22)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant22), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant22).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value22, typeInfo);
+ }
+ else if (value.IsValue23)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant23), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant23).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value23, typeInfo);
+ }
+ else if (value.IsValue24)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant24), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant24).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value24, typeInfo);
+ }
+ else if (value.IsValue25)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AssistantStreamEventVariant25), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AssistantStreamEventVariant25).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value25, typeInfo);
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEvent.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEvent.g.cs
new file mode 100644
index 00000000..cfc82f1f
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEvent.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventDiscriminatorEventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventDiscriminatorEvent Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventDiscriminatorEventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventDiscriminatorEvent)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventDiscriminatorEvent value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventDiscriminatorEventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEventNullable.g.cs
new file mode 100644
index 00000000..7ea756ce
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventDiscriminatorEventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventDiscriminatorEventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventDiscriminatorEvent? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventDiscriminatorEventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventDiscriminatorEvent)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventDiscriminatorEvent? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventDiscriminatorEventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10Event.g.cs
new file mode 100644
index 00000000..32037e12
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant10EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant10Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant10EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant10Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant10Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant10EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10EventNullable.g.cs
new file mode 100644
index 00000000..a25e2081
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant10EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant10EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant10Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant10EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant10Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant10Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant10EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11Event.g.cs
new file mode 100644
index 00000000..fae07416
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant11EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant11Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant11EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant11Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant11Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant11EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11EventNullable.g.cs
new file mode 100644
index 00000000..b43cb9c5
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant11EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant11EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant11Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant11EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant11Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant11Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant11EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12Event.g.cs
new file mode 100644
index 00000000..e44e3173
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant12EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant12Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant12EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant12Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant12Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant12EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12EventNullable.g.cs
new file mode 100644
index 00000000..541c0581
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant12EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant12EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant12Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant12EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant12Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant12Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant12EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13Event.g.cs
new file mode 100644
index 00000000..3cfd9d7d
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant13EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant13Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant13EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant13Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant13Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant13EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13EventNullable.g.cs
new file mode 100644
index 00000000..3959a1a8
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant13EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant13EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant13Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant13EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant13Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant13Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant13EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14Event.g.cs
new file mode 100644
index 00000000..39eeb7c1
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant14EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant14Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant14EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant14Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant14Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant14EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14EventNullable.g.cs
new file mode 100644
index 00000000..f9fdc804
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant14EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant14EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant14Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant14EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant14Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant14Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant14EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15Event.g.cs
new file mode 100644
index 00000000..894c60fc
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant15EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant15Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant15EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant15Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant15Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant15EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15EventNullable.g.cs
new file mode 100644
index 00000000..1f209bc1
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant15EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant15EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant15Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant15EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant15Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant15Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant15EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16Event.g.cs
new file mode 100644
index 00000000..778a139c
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant16EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant16Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant16EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant16Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant16Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant16EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16EventNullable.g.cs
new file mode 100644
index 00000000..c788c048
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant16EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant16EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant16Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant16EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant16Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant16Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant16EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17Event.g.cs
new file mode 100644
index 00000000..5e76ce49
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant17EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant17Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant17EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant17Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant17Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant17EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17EventNullable.g.cs
new file mode 100644
index 00000000..3d0da7df
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant17EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant17EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant17Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant17EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant17Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant17Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant17EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18Event.g.cs
new file mode 100644
index 00000000..4f3a09ee
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant18EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant18Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant18EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant18Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant18Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant18EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18EventNullable.g.cs
new file mode 100644
index 00000000..e56f6186
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant18EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant18EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant18Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant18EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant18Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant18Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant18EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19Event.g.cs
new file mode 100644
index 00000000..8743e2d6
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant19EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant19Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant19EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant19Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant19Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant19EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19EventNullable.g.cs
new file mode 100644
index 00000000..0c7fbee2
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant19EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant19EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant19Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant19EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant19Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant19Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant19EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20Event.g.cs
new file mode 100644
index 00000000..dddffa04
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant20EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant20Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant20EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant20Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant20Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant20EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20EventNullable.g.cs
new file mode 100644
index 00000000..584f1a18
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant20EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant20EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant20Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant20EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant20Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant20Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant20EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21Event.g.cs
new file mode 100644
index 00000000..e91ed5e5
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant21EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant21Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant21EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant21Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant21Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant21EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21EventNullable.g.cs
new file mode 100644
index 00000000..8e146ca3
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant21EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant21EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant21Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant21EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant21Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant21Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant21EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22Event.g.cs
new file mode 100644
index 00000000..0b42e8d3
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant22EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant22Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant22EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant22Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant22Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant22EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22EventNullable.g.cs
new file mode 100644
index 00000000..2c38205c
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant22EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant22EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant22Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant22EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant22Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant22Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant22EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23Event.g.cs
new file mode 100644
index 00000000..2ecedda2
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant23EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant23Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant23EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant23Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant23Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant23EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23EventNullable.g.cs
new file mode 100644
index 00000000..d7ea7f62
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant23EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant23EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant23Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant23EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant23Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant23Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant23EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24Event.g.cs
new file mode 100644
index 00000000..f4060ff2
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant24EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant24Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant24EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant24Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant24Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant24EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24EventNullable.g.cs
new file mode 100644
index 00000000..a860e3d6
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant24EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant24EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant24Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant24EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant24Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant24Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant24EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25Event.g.cs
new file mode 100644
index 00000000..cb751701
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant25EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant25Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant25EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant25Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant25Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant25EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25EventNullable.g.cs
new file mode 100644
index 00000000..ca8c4db9
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant25EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant25EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant25Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant25EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant25Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant25Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant25EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3Event.g.cs
similarity index 66%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3Event.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3Event.g.cs
index c797caef..ffbdceeb 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3Event.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3Event.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant3EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant3EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant3Event Read(
+ public override global::OpenAI.AssistantStreamEventVariant3Event Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant3EventJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant3EventExtensions.ToEnum(stringValue) ?? default;
+ return global::OpenAI.AssistantStreamEventVariant3EventExtensions.ToEnum(stringValue) ?? default;
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant3EventJsonConverter : global::Syste
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant3Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant3Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class MessageStreamEventVariant3EventJsonConverter : global::Syste
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant3Event value,
+ global::OpenAI.AssistantStreamEventVariant3Event value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant3EventExtensions.ToValueString(value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant3EventExtensions.ToValueString(value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3EventNullable.g.cs
similarity index 68%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2EventNullable.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3EventNullable.g.cs
index 8d664ba7..ab3c3220 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2EventNullable.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant3EventNullable.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant2EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant3EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant2Event? Read(
+ public override global::OpenAI.AssistantStreamEventVariant3Event? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant2EventNullableJsonConverter : globa
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant2EventExtensions.ToEnum(stringValue);
+ return global::OpenAI.AssistantStreamEventVariant3EventExtensions.ToEnum(stringValue);
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant2EventNullableJsonConverter : globa
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant2Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant3Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class MessageStreamEventVariant2EventNullableJsonConverter : globa
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant2Event? value,
+ global::OpenAI.AssistantStreamEventVariant3Event? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
}
else
{
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant2EventExtensions.ToValueString(value.Value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant3EventExtensions.ToValueString(value.Value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4Event.g.cs
similarity index 66%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1Event.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4Event.g.cs
index 1c5e562e..4f0762af 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1Event.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4Event.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant1EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant4EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant1Event Read(
+ public override global::OpenAI.AssistantStreamEventVariant4Event Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant1EventJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant1EventExtensions.ToEnum(stringValue) ?? default;
+ return global::OpenAI.AssistantStreamEventVariant4EventExtensions.ToEnum(stringValue) ?? default;
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant1EventJsonConverter : global::Syste
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant1Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant4Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class MessageStreamEventVariant1EventJsonConverter : global::Syste
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant1Event value,
+ global::OpenAI.AssistantStreamEventVariant4Event value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant1EventExtensions.ToValueString(value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant4EventExtensions.ToValueString(value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4EventNullable.g.cs
similarity index 68%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3EventNullable.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4EventNullable.g.cs
index 1b147431..ef2b2357 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant3EventNullable.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant4EventNullable.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant3EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant4EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant3Event? Read(
+ public override global::OpenAI.AssistantStreamEventVariant4Event? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant3EventNullableJsonConverter : globa
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant3EventExtensions.ToEnum(stringValue);
+ return global::OpenAI.AssistantStreamEventVariant4EventExtensions.ToEnum(stringValue);
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant3EventNullableJsonConverter : globa
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant3Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant4Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class MessageStreamEventVariant3EventNullableJsonConverter : globa
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant3Event? value,
+ global::OpenAI.AssistantStreamEventVariant4Event? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
}
else
{
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant3EventExtensions.ToValueString(value.Value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant4EventExtensions.ToValueString(value.Value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5Event.g.cs
similarity index 66%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4Event.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5Event.g.cs
index f855c65f..d5cd0b0e 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4Event.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5Event.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant4EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant5EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant4Event Read(
+ public override global::OpenAI.AssistantStreamEventVariant5Event Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant4EventJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant4EventExtensions.ToEnum(stringValue) ?? default;
+ return global::OpenAI.AssistantStreamEventVariant5EventExtensions.ToEnum(stringValue) ?? default;
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant4EventJsonConverter : global::Syste
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant4Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant5Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class MessageStreamEventVariant4EventJsonConverter : global::Syste
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant4Event value,
+ global::OpenAI.AssistantStreamEventVariant5Event value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant4EventExtensions.ToValueString(value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant5EventExtensions.ToValueString(value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5EventNullable.g.cs
similarity index 68%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1EventNullable.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5EventNullable.g.cs
index 7b965288..4857fda7 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant1EventNullable.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant5EventNullable.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant1EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant5EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant1Event? Read(
+ public override global::OpenAI.AssistantStreamEventVariant5Event? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant1EventNullableJsonConverter : globa
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant1EventExtensions.ToEnum(stringValue);
+ return global::OpenAI.AssistantStreamEventVariant5EventExtensions.ToEnum(stringValue);
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant1EventNullableJsonConverter : globa
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant1Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant5Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class MessageStreamEventVariant1EventNullableJsonConverter : globa
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant1Event? value,
+ global::OpenAI.AssistantStreamEventVariant5Event? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
}
else
{
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant1EventExtensions.ToValueString(value.Value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant5EventExtensions.ToValueString(value.Value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6Event.g.cs
similarity index 66%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2Event.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6Event.g.cs
index 8424ced5..ebe9e6c4 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant2Event.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6Event.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant2EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant6EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant2Event Read(
+ public override global::OpenAI.AssistantStreamEventVariant6Event Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant2EventJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant2EventExtensions.ToEnum(stringValue) ?? default;
+ return global::OpenAI.AssistantStreamEventVariant6EventExtensions.ToEnum(stringValue) ?? default;
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant2EventJsonConverter : global::Syste
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant2Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant6Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class MessageStreamEventVariant2EventJsonConverter : global::Syste
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant2Event value,
+ global::OpenAI.AssistantStreamEventVariant6Event value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant2EventExtensions.ToValueString(value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant6EventExtensions.ToValueString(value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6EventNullable.g.cs
similarity index 68%
rename from src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4EventNullable.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6EventNullable.g.cs
index 06254bf8..47ac5346 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.MessageStreamEventVariant4EventNullable.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant6EventNullable.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class MessageStreamEventVariant4EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class AssistantStreamEventVariant6EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.MessageStreamEventVariant4Event? Read(
+ public override global::OpenAI.AssistantStreamEventVariant6Event? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class MessageStreamEventVariant4EventNullableJsonConverter : globa
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.MessageStreamEventVariant4EventExtensions.ToEnum(stringValue);
+ return global::OpenAI.AssistantStreamEventVariant6EventExtensions.ToEnum(stringValue);
}
break;
@@ -26,7 +26,7 @@ public sealed class MessageStreamEventVariant4EventNullableJsonConverter : globa
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.MessageStreamEventVariant4Event)numValue;
+ return (global::OpenAI.AssistantStreamEventVariant6Event)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class MessageStreamEventVariant4EventNullableJsonConverter : globa
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.MessageStreamEventVariant4Event? value,
+ global::OpenAI.AssistantStreamEventVariant6Event? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
}
else
{
- writer.WriteStringValue(global::OpenAI.MessageStreamEventVariant4EventExtensions.ToValueString(value.Value));
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant6EventExtensions.ToValueString(value.Value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7Event.g.cs
new file mode 100644
index 00000000..dee0642f
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant7EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant7Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant7EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant7Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant7Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant7EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7EventNullable.g.cs
new file mode 100644
index 00000000..5fb43627
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant7EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant7EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant7Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant7EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant7Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant7Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant7EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8Event.g.cs
new file mode 100644
index 00000000..60b7549d
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant8EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant8Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant8EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant8Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant8Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant8EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8EventNullable.g.cs
new file mode 100644
index 00000000..518f427d
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant8EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant8EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant8Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant8EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant8Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant8Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant8EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9Event.g.cs
new file mode 100644
index 00000000..258a9559
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9Event.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant9EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant9Event Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant9EventExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant9Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant9Event value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant9EventExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9EventNullable.g.cs
new file mode 100644
index 00000000..763942c7
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.AssistantStreamEventVariant9EventNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class AssistantStreamEventVariant9EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.AssistantStreamEventVariant9Event? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.AssistantStreamEventVariant9EventExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.AssistantStreamEventVariant9Event)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.AssistantStreamEventVariant9Event? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.AssistantStreamEventVariant9EventExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPart.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPart.g.cs
index cc3d32ee..20fb0bc5 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPart.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPart.g.cs
@@ -15,49 +15,33 @@ public class ChatCompletionRequestAssistantMessageContentPartJsonConverter : glo
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- var
- readerCopy = reader;
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
global::OpenAI.ChatCompletionRequestMessageContentPartText? text = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType.Text)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText).Name}");
- text = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageContentPartText)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestMessageContentPartRefusal? refusal = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType.Refusal)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartRefusal), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartRefusal).Name}");
- refusal = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageContentPartRefusal)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
var result = new global::OpenAI.ChatCompletionRequestAssistantMessageContentPart(
+ discriminator?.Type,
text,
refusal
);
- if (text != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (refusal != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartRefusal), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartRefusal).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
-
return result;
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType.g.cs
new file mode 100644
index 00000000..50b16a70
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..94c07471
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestAssistantMessageContentPartDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessage.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessage.g.cs
index 9996f6db..73a97a24 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessage.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessage.g.cs
@@ -15,68 +15,50 @@ public class ChatCompletionRequestMessageJsonConverter : global::System.Text.Jso
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- var
- readerCopy = reader;
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
global::OpenAI.ChatCompletionRequestSystemMessage? system = default;
- try
+ if (discriminator?.Role == global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole.System)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestSystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestSystemMessage).Name}");
- system = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestSystemMessage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestUserMessage? user = default;
- try
+ if (discriminator?.Role == global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole.User)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestUserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestUserMessage).Name}");
- user = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestUserMessage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestAssistantMessage? assistant = default;
- try
+ if (discriminator?.Role == global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole.Assistant)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestAssistantMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestAssistantMessage).Name}");
- assistant = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestAssistantMessage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestToolMessage? tool = default;
- try
+ if (discriminator?.Role == global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole.Tool)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestToolMessage).Name}");
- tool = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestToolMessage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestFunctionMessage? function = default;
- try
+ if (discriminator?.Role == global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole.Function)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestFunctionMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestFunctionMessage).Name}");
- function = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestFunctionMessage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
var result = new global::OpenAI.ChatCompletionRequestMessage(
+ discriminator?.Role,
system,
user,
assistant,
@@ -84,37 +66,6 @@ public class ChatCompletionRequestMessageJsonConverter : global::System.Text.Jso
function
);
- if (system != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestSystemMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestSystemMessage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (user != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestUserMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestUserMessage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (assistant != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestAssistantMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestAssistantMessage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (tool != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestToolMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestToolMessage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (function != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestFunctionMessage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestFunctionMessage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
-
return result;
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRole.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRole.g.cs
new file mode 100644
index 00000000..14cd663f
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRole.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestMessageDiscriminatorRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestMessageDiscriminatorRoleExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestMessageDiscriminatorRoleExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRoleNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRoleNullable.g.cs
new file mode 100644
index 00000000..3170a33c
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestMessageDiscriminatorRoleNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestMessageDiscriminatorRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestMessageDiscriminatorRoleExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestMessageDiscriminatorRole? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestMessageDiscriminatorRoleExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPart.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPart.g.cs
index 91cff9b0..5a44c5d7 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPart.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPart.g.cs
@@ -15,68 +15,41 @@ public class ChatCompletionRequestUserMessageContentPartJsonConverter : global::
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- var
- readerCopy = reader;
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
global::OpenAI.ChatCompletionRequestMessageContentPartText? text = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType.Text)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText).Name}");
- text = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageContentPartText)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestMessageContentPartImage? image = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType.ImageUrl)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartImage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartImage).Name}");
- image = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageContentPartImage)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.ChatCompletionRequestMessageContentPartAudio? audio = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType.InputAudio)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartAudio), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartAudio).Name}");
- audio = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChatCompletionRequestMessageContentPartAudio)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
var result = new global::OpenAI.ChatCompletionRequestUserMessageContentPart(
+ discriminator?.Type,
text,
image,
audio
);
- if (text != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartText).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (image != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartImage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartImage).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (audio != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChatCompletionRequestMessageContentPartAudio), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.ChatCompletionRequestMessageContentPartAudio).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
-
return result;
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorType.g.cs
new file mode 100644
index 00000000..f3939c9a
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestUserMessageContentPartDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..964e1161
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChatCompletionRequestUserMessageContentPartDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.ChatCompletionRequestUserMessageContentPartDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParam.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParam.g.cs
index 4566bfa5..4ceb7f51 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParam.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParam.g.cs
@@ -15,49 +15,33 @@ public class ChunkingStrategyRequestParamJsonConverter : global::System.Text.Jso
options = options ?? throw new global::System.ArgumentNullException(nameof(options));
var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
- var
- readerCopy = reader;
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.ChunkingStrategyRequestParamDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.ChunkingStrategyRequestParamDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
global::OpenAI.AutoChunkingStrategyRequestParam? auto = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType.Auto)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AutoChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AutoChunkingStrategyRequestParam).Name}");
- auto = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AutoChunkingStrategyRequestParam)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
-
- readerCopy = reader;
global::OpenAI.StaticChunkingStrategyRequestParam? @static = default;
- try
+ if (discriminator?.Type == global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType.Static)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.StaticChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.StaticChunkingStrategyRequestParam).Name}");
- @static = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
- }
- catch (global::System.Text.Json.JsonException)
- {
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.StaticChunkingStrategyRequestParam)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
var result = new global::OpenAI.ChunkingStrategyRequestParam(
+ discriminator?.Type,
auto,
@static
);
- if (auto != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AutoChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AutoChunkingStrategyRequestParam).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
- else if (@static != null)
- {
- var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.StaticChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
- throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.StaticChunkingStrategyRequestParam).Name}");
- _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
- }
-
return result;
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorType.g.cs
new file mode 100644
index 00000000..168ccdea
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChunkingStrategyRequestParamDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChunkingStrategyRequestParamDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.ChunkingStrategyRequestParamDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..1482893c
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ChunkingStrategyRequestParamDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class ChunkingStrategyRequestParamDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.ChunkingStrategyRequestParamDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ChunkingStrategyRequestParamDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.ChunkingStrategyRequestParamDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ContentItem.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ContentItem.g.cs
new file mode 100644
index 00000000..94781420
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ContentItem.g.cs
@@ -0,0 +1,99 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class ContentItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ContentItem Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.MessageDeltaContentImageFileObject? messageDeltaImageFileObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminatorType.ImageFile)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentImageFileObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageDeltaContentTextObject? messageDeltaTextObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminatorType.Text)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentTextObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageDeltaContentRefusalObject? messageDeltaRefusalObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminatorType.Refusal)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentRefusalObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentRefusalObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageDeltaContentImageUrlObject? messageDeltaImageUrlObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageDeltaObjectDeltaContentItemDiscriminatorType.ImageUrl)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageDeltaContentImageUrlObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.ContentItem(
+ discriminator?.Type,
+ messageDeltaImageFileObject,
+ messageDeltaTextObject,
+ messageDeltaRefusalObject,
+ messageDeltaImageUrlObject
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ContentItem value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsMessageDeltaImageFileObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentImageFileObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaImageFileObject, typeInfo);
+ }
+ else if (value.IsMessageDeltaTextObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentTextObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaTextObject, typeInfo);
+ }
+ else if (value.IsMessageDeltaRefusalObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentRefusalObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentRefusalObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaRefusalObject, typeInfo);
+ }
+ else if (value.IsMessageDeltaImageUrlObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageDeltaContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageDeltaContentImageUrlObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageDeltaImageUrlObject, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ContentItem2.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ContentItem2.g.cs
new file mode 100644
index 00000000..caf49be7
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ContentItem2.g.cs
@@ -0,0 +1,99 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class ContentItem2JsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ContentItem2 Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageObjectContentItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageObjectContentItemDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.MessageContentImageFileObject? messageImageFileObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageObjectContentItemDiscriminatorType.ImageFile)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentImageFileObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageContentImageUrlObject? messageImageUrlObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageObjectContentItemDiscriminatorType.ImageUrl)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentImageUrlObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageContentTextObject? messageTextObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageObjectContentItemDiscriminatorType.Text)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentTextObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageContentRefusalObject? messageRefusalObject = default;
+ if (discriminator?.Type == global::OpenAI.MessageObjectContentItemDiscriminatorType.Refusal)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentRefusalObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentRefusalObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.ContentItem2(
+ discriminator?.Type,
+ messageImageFileObject,
+ messageImageUrlObject,
+ messageTextObject,
+ messageRefusalObject
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ContentItem2 value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsMessageImageFileObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentImageFileObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageImageFileObject, typeInfo);
+ }
+ else if (value.IsMessageImageUrlObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentImageUrlObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageImageUrlObject, typeInfo);
+ }
+ else if (value.IsMessageTextObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentTextObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageTextObject, typeInfo);
+ }
+ else if (value.IsMessageRefusalObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentRefusalObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentRefusalObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageRefusalObject, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.ContentVariant2Item.g.cs b/src/libs/OpenAI/Generated/JsonConverters.ContentVariant2Item.g.cs
new file mode 100644
index 00000000..7c127b87
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.ContentVariant2Item.g.cs
@@ -0,0 +1,85 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class ContentVariant2ItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.ContentVariant2Item Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.MessageContentImageFileObject? messageImageFileObject = default;
+ if (discriminator?.Type == global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType.ImageFile)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentImageFileObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageContentImageUrlObject? messageImageUrlObject = default;
+ if (discriminator?.Type == global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType.ImageUrl)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageContentImageUrlObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.MessageRequestContentTextObject? messageRequestTextObject = default;
+ if (discriminator?.Type == global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType.Text)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageRequestContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.MessageRequestContentTextObject)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.ContentVariant2Item(
+ discriminator?.Type,
+ messageImageFileObject,
+ messageImageUrlObject,
+ messageRequestTextObject
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.ContentVariant2Item value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsMessageImageFileObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageFileObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentImageFileObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageImageFileObject, typeInfo);
+ }
+ else if (value.IsMessageImageUrlObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageContentImageUrlObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageContentImageUrlObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageImageUrlObject, typeInfo);
+ }
+ else if (value.IsMessageRequestTextObject)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.MessageRequestContentTextObject), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.MessageRequestContentTextObject).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.MessageRequestTextObject, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorType.g.cs
new file mode 100644
index 00000000..5a5114ea
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestToolDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateAssistantRequestToolDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateAssistantRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateAssistantRequestToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateAssistantRequestToolDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateAssistantRequestToolDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..156d6549
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestToolDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateAssistantRequestToolDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateAssistantRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateAssistantRequestToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateAssistantRequestToolDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateAssistantRequestToolDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs
new file mode 100644
index 00000000..92d98591
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1? value1 = default;
+ if (discriminator?.Type == global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.Auto)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2? value2 = default;
+ if (discriminator?.Type == global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.Static)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy(
+ discriminator?.Type,
+ value1,
+ value2
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategy value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsValue1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeInfo);
+ }
+ else if (value.IsValue2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs
new file mode 100644
index 00000000..bc661fc5
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..7485f0d2
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateAssistantRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorType.g.cs
new file mode 100644
index 00000000..644a4c77
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestResponseFormatDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..14feb24b
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateChatCompletionRequestResponseFormatDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateChatCompletionRequestResponseFormatDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateChatCompletionRequestResponseFormatDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorType.g.cs
new file mode 100644
index 00000000..444b5845
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateMessageRequestAttachmentToolDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..932d17b7
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestAttachmentToolDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateMessageRequestAttachmentToolDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateMessageRequestAttachmentToolDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorType.g.cs
new file mode 100644
index 00000000..7ff1493b
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateMessageRequestContentVariant2ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..d37b828f
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateMessageRequestContentVariant2ItemDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateMessageRequestContentVariant2ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateMessageRequestContentVariant2ItemDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorType.g.cs
new file mode 100644
index 00000000..554ac874
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateModerationRequestInputVariant3ItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..fab34a87
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateModerationRequestInputVariant3ItemDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateModerationRequestInputVariant3ItemDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorType.g.cs
new file mode 100644
index 00000000..a5df23bd
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateRunRequestToolDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateRunRequestToolDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateRunRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateRunRequestToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateRunRequestToolDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateRunRequestToolDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..6f6c0d38
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateRunRequestToolDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateRunRequestToolDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateRunRequestToolDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateRunRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateRunRequestToolDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateRunRequestToolDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateRunRequestToolDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1Event.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorType.g.cs
similarity index 66%
rename from src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1Event.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorType.g.cs
index 2f0b1958..10e04490 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1Event.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorType.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class RunStepStreamEventVariant1EventJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class CreateThreadAndRunRequestToolDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.RunStepStreamEventVariant1Event Read(
+ public override global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class RunStepStreamEventVariant1EventJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.RunStepStreamEventVariant1EventExtensions.ToEnum(stringValue) ?? default;
+ return global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
}
break;
@@ -26,7 +26,7 @@ public sealed class RunStepStreamEventVariant1EventJsonConverter : global::Syste
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.RunStepStreamEventVariant1Event)numValue;
+ return (global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,12 +38,12 @@ public sealed class RunStepStreamEventVariant1EventJsonConverter : global::Syste
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.RunStepStreamEventVariant1Event value,
+ global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
- writer.WriteStringValue(global::OpenAI.RunStepStreamEventVariant1EventExtensions.ToValueString(value));
+ writer.WriteStringValue(global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorTypeExtensions.ToValueString(value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1EventNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorTypeNullable.g.cs
similarity index 68%
rename from src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1EventNullable.g.cs
rename to src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorTypeNullable.g.cs
index 0487684c..51ee5ef3 100644
--- a/src/libs/OpenAI/Generated/JsonConverters.RunStepStreamEventVariant1EventNullable.g.cs
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadAndRunRequestToolDiscriminatorTypeNullable.g.cs
@@ -3,10 +3,10 @@
namespace OpenAI.JsonConverters
{
///
- public sealed class RunStepStreamEventVariant1EventNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ public sealed class CreateThreadAndRunRequestToolDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
{
///
- public override global::OpenAI.RunStepStreamEventVariant1Event? Read(
+ public override global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
@@ -18,7 +18,7 @@ public sealed class RunStepStreamEventVariant1EventNullableJsonConverter : globa
var stringValue = reader.GetString();
if (stringValue != null)
{
- return global::OpenAI.RunStepStreamEventVariant1EventExtensions.ToEnum(stringValue);
+ return global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorTypeExtensions.ToEnum(stringValue);
}
break;
@@ -26,7 +26,7 @@ public sealed class RunStepStreamEventVariant1EventNullableJsonConverter : globa
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
- return (global::OpenAI.RunStepStreamEventVariant1Event)numValue;
+ return (global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
@@ -38,7 +38,7 @@ public sealed class RunStepStreamEventVariant1EventNullableJsonConverter : globa
///
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
- global::OpenAI.RunStepStreamEventVariant1Event? value,
+ global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorType? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
@@ -49,7 +49,7 @@ public override void Write(
}
else
{
- writer.WriteStringValue(global::OpenAI.RunStepStreamEventVariant1EventExtensions.ToValueString(value.Value));
+ writer.WriteStringValue(global::OpenAI.CreateThreadAndRunRequestToolDiscriminatorTypeExtensions.ToValueString(value.Value));
}
}
}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs
new file mode 100644
index 00000000..ef7d3afc
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1? value1 = default;
+ if (discriminator?.Type == global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.Auto)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2? value2 = default;
+ if (discriminator?.Type == global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.Static)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy(
+ discriminator?.Type,
+ value1,
+ value2
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategy value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsValue1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant1).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeInfo);
+ }
+ else if (value.IsValue2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyVariant2).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs
new file mode 100644
index 00000000..3f413755
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..46477ed8
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateThreadRequestToolResourcesFileSearchVectorStoreChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategy.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategy.g.cs
new file mode 100644
index 00000000..7830c025
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategy.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class CreateVectorStoreRequestChunkingStrategyJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateVectorStoreRequestChunkingStrategy Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.AutoChunkingStrategyRequestParam? autoParam = default;
+ if (discriminator?.Type == global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType.Auto)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AutoChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.AutoChunkingStrategyRequestParam)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.StaticChunkingStrategyRequestParam? staticParam = default;
+ if (discriminator?.Type == global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType.Static)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.StaticChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.StaticChunkingStrategyRequestParam)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.CreateVectorStoreRequestChunkingStrategy(
+ discriminator?.Type,
+ autoParam,
+ staticParam
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateVectorStoreRequestChunkingStrategy value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsAutoParam)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.AutoChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.AutoChunkingStrategyRequestParam).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.AutoParam, typeInfo);
+ }
+ else if (value.IsStaticParam)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.StaticChunkingStrategyRequestParam), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.StaticChunkingStrategyRequestParam).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.StaticParam, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorType.g.cs
new file mode 100644
index 00000000..638cda8f
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..4c273dd5
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.CreateVectorStoreRequestChunkingStrategyDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.InputVariant3Item.g.cs b/src/libs/OpenAI/Generated/JsonConverters.InputVariant3Item.g.cs
new file mode 100644
index 00000000..1fcfba90
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.InputVariant3Item.g.cs
@@ -0,0 +1,71 @@
+#nullable enable
+#pragma warning disable CS0618 // Type or member is obsolete
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public class InputVariant3ItemJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.InputVariant3Item Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+
+ var readerCopy = reader;
+ var discriminatorTypeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminator), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminator)}");
+ var discriminator = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, discriminatorTypeInfo);
+
+ global::OpenAI.CreateModerationRequestInputVariant3ItemVariant1? value1 = default;
+ if (discriminator?.Type == global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType.ImageUrl)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant1)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+ global::OpenAI.CreateModerationRequestInputVariant3ItemVariant2? value2 = default;
+ if (discriminator?.Type == global::OpenAI.CreateModerationRequestInputVariant3ItemDiscriminatorType.Text)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant2)}");
+ _ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
+ }
+
+ var result = new global::OpenAI.InputVariant3Item(
+ discriminator?.Type,
+ value1,
+ value2
+ );
+
+ return result;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.InputVariant3Item value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ options = options ?? throw new global::System.ArgumentNullException(nameof(options));
+ var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set.");
+
+ if (value.IsValue1)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant1).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1, typeInfo);
+ }
+ else if (value.IsValue2)
+ {
+ var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ??
+ throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::OpenAI.CreateModerationRequestInputVariant3ItemVariant2).Name}");
+ global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2, typeInfo);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorType.g.cs
new file mode 100644
index 00000000..0e659603
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class MessageContentTextObjectTextAnnotationDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..45947067
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.MessageContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class MessageContentTextObjectTextAnnotationDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.MessageContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType.g.cs
new file mode 100644
index 00000000..3b054297
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToEnum(stringValue) ?? default;
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ writer.WriteStringValue(global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToValueString(value));
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs
new file mode 100644
index 00000000..0c8546ac
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeNullable.g.cs
@@ -0,0 +1,56 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///
+ public override global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType? Read(
+ ref global::System.Text.Json.Utf8JsonReader reader,
+ global::System.Type typeToConvert,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ switch (reader.TokenType)
+ {
+ case global::System.Text.Json.JsonTokenType.String:
+ {
+ var stringValue = reader.GetString();
+ if (stringValue != null)
+ {
+ return global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToEnum(stringValue);
+ }
+
+ break;
+ }
+ case global::System.Text.Json.JsonTokenType.Number:
+ {
+ var numValue = reader.GetInt32();
+ return (global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType)numValue;
+ }
+ default:
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ }
+
+ return default;
+ }
+
+ ///
+ public override void Write(
+ global::System.Text.Json.Utf8JsonWriter writer,
+ global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorType? value,
+ global::System.Text.Json.JsonSerializerOptions options)
+ {
+ writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
+
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ }
+ else
+ {
+ writer.WriteStringValue(global::OpenAI.MessageDeltaContentTextObjectTextAnnotationDiscriminatorTypeExtensions.ToValueString(value.Value));
+ }
+ }
+ }
+}
diff --git a/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaObjectDeltaContentItemDiscriminatorType.g.cs b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaObjectDeltaContentItemDiscriminatorType.g.cs
new file mode 100644
index 00000000..97074ae4
--- /dev/null
+++ b/src/libs/OpenAI/Generated/JsonConverters.MessageDeltaObjectDeltaContentItemDiscriminatorType.g.cs
@@ -0,0 +1,49 @@
+#nullable enable
+
+namespace OpenAI.JsonConverters
+{
+ ///
+ public sealed class MessageDeltaObjectDeltaContentItemDiscriminatorTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter
+ {
+ ///