Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/libs/tryAGI.OpenAI/Generated/AllOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public static implicit operator AllOf<T1, T2>(T1 value) => new AllOf<T1, T2>(value);
public static implicit operator AllOf<T1, T2>(T1 value) => new AllOf<T1, T2>((T1?)value);

/// <summary>
///
Expand Down Expand Up @@ -63,7 +63,7 @@ public AllOf(T1? value)
/// <summary>
///
/// </summary>
public static implicit operator AllOf<T1, T2>(T2 value) => new AllOf<T1, T2>(value);
public static implicit operator AllOf<T1, T2>(T2 value) => new AllOf<T1, T2>((T2?)value);

/// <summary>
///
Expand Down
4 changes: 2 additions & 2 deletions src/libs/tryAGI.OpenAI/Generated/AnyOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace tryAGI.OpenAI
/// <summary>
///
/// </summary>
public static implicit operator AnyOf<T1, T2>(T1 value) => new AnyOf<T1, T2>(value);
public static implicit operator AnyOf<T1, T2>(T1 value) => new AnyOf<T1, T2>((T1?)value);

/// <summary>
///
Expand Down Expand Up @@ -63,7 +63,7 @@ public AnyOf(T1? value)
/// <summary>
///
/// </summary>
public static implicit operator AnyOf<T1, T2>(T2 value) => new AnyOf<T1, T2>(value);
public static implicit operator AnyOf<T1, T2>(T2 value) => new AnyOf<T1, T2>((T2?)value);

/// <summary>
///
Expand Down
48 changes: 24 additions & 24 deletions src/libs/tryAGI.OpenAI/Generated/JsonConverters.Annotation.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ public class AnnotationJsonConverter : global::System.Text.Json.Serialization.Js

var
readerCopy = reader;
global::tryAGI.OpenAI.FileCitation? fileCitation = default;
global::tryAGI.OpenAI.FileCitationBody? fileCitationBody = default;
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitation> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitation).Name}");
fileCitation = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitationBody> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitationBody).Name}");
fileCitationBody = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
}

readerCopy = reader;
global::tryAGI.OpenAI.UrlCitation? urlCitation = default;
global::tryAGI.OpenAI.UrlCitationBody? urlCitationBody = default;
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitation> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitation).Name}");
urlCitation = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitationBody> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitationBody).Name}");
urlCitationBody = global::System.Text.Json.JsonSerializer.Deserialize(ref readerCopy, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -53,21 +53,21 @@ public class AnnotationJsonConverter : global::System.Text.Json.Serialization.Js
}

var result = new global::tryAGI.OpenAI.Annotation(
fileCitation,
urlCitation,
fileCitationBody,
urlCitationBody,
filePath
);

if (fileCitation != null)
if (fileCitationBody != null)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitation> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitation).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitationBody> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitationBody).Name}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
else if (urlCitation != null)
else if (urlCitationBody != null)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitation> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitation).Name}");
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitationBody> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitationBody).Name}");
_ = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo);
}
else if (filePath != null)
Expand All @@ -89,17 +89,17 @@ 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.IsFileCitation)
if (value.IsFileCitationBody)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitation?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitation).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.FileCitation, typeInfo);
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.FileCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.FileCitationBody?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.FileCitationBody).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.FileCitationBody, typeInfo);
}
else if (value.IsUrlCitation)
else if (value.IsUrlCitationBody)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitation), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitation?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitation).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.UrlCitation, typeInfo);
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.UrlCitationBody), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.UrlCitationBody?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.UrlCitationBody).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.UrlCitationBody, typeInfo);
}
else if (value.IsFilePath)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class CodeInterpreterToolTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.CodeInterpreterToolType>
public sealed class ApproximateLocationTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ApproximateLocationType>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.CodeInterpreterToolType Read(
public override global::tryAGI.OpenAI.ApproximateLocationType Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,15 +18,15 @@ public sealed class CodeInterpreterToolTypeJsonConverter : global::System.Text.J
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.CodeInterpreterToolTypeExtensions.ToEnum(stringValue) ?? default;
return global::tryAGI.OpenAI.ApproximateLocationTypeExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.CodeInterpreterToolType)numValue;
return (global::tryAGI.OpenAI.ApproximateLocationType)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -38,12 +38,12 @@ public sealed class CodeInterpreterToolTypeJsonConverter : global::System.Text.J
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.CodeInterpreterToolType value,
global::tryAGI.OpenAI.ApproximateLocationType value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::tryAGI.OpenAI.CodeInterpreterToolTypeExtensions.ToValueString(value));
writer.WriteStringValue(global::tryAGI.OpenAI.ApproximateLocationTypeExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class CodeInterpreterToolTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.CodeInterpreterToolType?>
public sealed class ApproximateLocationTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.ApproximateLocationType?>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.CodeInterpreterToolType? Read(
public override global::tryAGI.OpenAI.ApproximateLocationType? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,15 +18,15 @@ public sealed class CodeInterpreterToolTypeNullableJsonConverter : global::Syste
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.CodeInterpreterToolTypeExtensions.ToEnum(stringValue);
return global::tryAGI.OpenAI.ApproximateLocationTypeExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.CodeInterpreterToolType)numValue;
return (global::tryAGI.OpenAI.ApproximateLocationType)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -38,7 +38,7 @@ public sealed class CodeInterpreterToolTypeNullableJsonConverter : global::Syste
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.CodeInterpreterToolType? value,
global::tryAGI.OpenAI.ApproximateLocationType? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -49,7 +49,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::tryAGI.OpenAI.CodeInterpreterToolTypeExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::tryAGI.OpenAI.ApproximateLocationTypeExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebSearchToolTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebSearchToolType>
public sealed class CertificateObjectJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.CertificateObject>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebSearchToolType Read(
public override global::tryAGI.OpenAI.CertificateObject Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,15 +18,15 @@ public sealed class WebSearchToolTypeJsonConverter : global::System.Text.Json.Se
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebSearchToolTypeExtensions.ToEnum(stringValue) ?? default;
return global::tryAGI.OpenAI.CertificateObjectExtensions.ToEnum(stringValue) ?? default;
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebSearchToolType)numValue;
return (global::tryAGI.OpenAI.CertificateObject)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -38,12 +38,12 @@ public sealed class WebSearchToolTypeJsonConverter : global::System.Text.Json.Se
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebSearchToolType value,
global::tryAGI.OpenAI.CertificateObject value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));

writer.WriteStringValue(global::tryAGI.OpenAI.WebSearchToolTypeExtensions.ToValueString(value));
writer.WriteStringValue(global::tryAGI.OpenAI.CertificateObjectExtensions.ToValueString(value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace tryAGI.OpenAI.JsonConverters
{
/// <inheritdoc />
public sealed class WebSearchToolTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.WebSearchToolType?>
public sealed class CertificateObjectNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::tryAGI.OpenAI.CertificateObject?>
{
/// <inheritdoc />
public override global::tryAGI.OpenAI.WebSearchToolType? Read(
public override global::tryAGI.OpenAI.CertificateObject? Read(
ref global::System.Text.Json.Utf8JsonReader reader,
global::System.Type typeToConvert,
global::System.Text.Json.JsonSerializerOptions options)
Expand All @@ -18,15 +18,15 @@ public sealed class WebSearchToolTypeNullableJsonConverter : global::System.Text
var stringValue = reader.GetString();
if (stringValue != null)
{
return global::tryAGI.OpenAI.WebSearchToolTypeExtensions.ToEnum(stringValue);
return global::tryAGI.OpenAI.CertificateObjectExtensions.ToEnum(stringValue);
}

break;
}
case global::System.Text.Json.JsonTokenType.Number:
{
var numValue = reader.GetInt32();
return (global::tryAGI.OpenAI.WebSearchToolType)numValue;
return (global::tryAGI.OpenAI.CertificateObject)numValue;
}
default:
throw new global::System.ArgumentOutOfRangeException(nameof(reader));
Expand All @@ -38,7 +38,7 @@ public sealed class WebSearchToolTypeNullableJsonConverter : global::System.Text
/// <inheritdoc />
public override void Write(
global::System.Text.Json.Utf8JsonWriter writer,
global::tryAGI.OpenAI.WebSearchToolType? value,
global::tryAGI.OpenAI.CertificateObject? value,
global::System.Text.Json.JsonSerializerOptions options)
{
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer));
Expand All @@ -49,7 +49,7 @@ public override void Write(
}
else
{
writer.WriteStringValue(global::tryAGI.OpenAI.WebSearchToolTypeExtensions.ToValueString(value.Value));
writer.WriteStringValue(global::tryAGI.OpenAI.CertificateObjectExtensions.ToValueString(value.Value));
}
}
}
Expand Down
Loading
Loading