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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AssistantsApiResponseFormatOptionJsonConverter : global::System.Tex
if (__score2 > __bestScore) { __bestScore = __score2; __bestIndex = 2; }
if (__score3 > __bestScore) { __bestScore = __score3; __bestIndex = 3; }

global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum? value1 = default;
global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum? @enum = default;
global::tryAGI.OpenAI.ResponseFormatText? text = default;
global::tryAGI.OpenAI.ResponseFormatJsonObject? jsonObject = default;
global::tryAGI.OpenAI.ResponseFormatJsonSchema? jsonSchema = default;
Expand All @@ -53,7 +53,7 @@ public class AssistantsApiResponseFormatOptionJsonConverter : global::System.Tex
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum).Name}");
value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
@enum = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand Down Expand Up @@ -109,13 +109,13 @@ public class AssistantsApiResponseFormatOptionJsonConverter : global::System.Tex
}
}

if (value1 == null && text == null && jsonObject == null && jsonSchema == null)
if (@enum == null && text == null && jsonObject == null && jsonSchema == null)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum).Name}");
value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
@enum = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand Down Expand Up @@ -165,7 +165,7 @@ public class AssistantsApiResponseFormatOptionJsonConverter : global::System.Tex
}

var __value = new global::tryAGI.OpenAI.AssistantsApiResponseFormatOption(
value1,
@enum,

text,

Expand All @@ -186,11 +186,11 @@ 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.IsValue1)
if (value.IsEnum)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiResponseFormatOptionEnum).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!.Value, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Enum!.Value, typeInfo);
}
else if (value.IsText)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; }
if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }

global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum? value1 = default;
global::tryAGI.OpenAI.AssistantsNamedToolChoice? value2 = default;
global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum? @enum = default;
global::tryAGI.OpenAI.AssistantsNamedToolChoice? named = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
Expand All @@ -45,7 +45,7 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum).Name}");
value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
@enum = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -60,7 +60,7 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsNamedToolChoice> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
named = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -71,13 +71,13 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
}
}

if (value1 == null && value2 == null)
if (@enum == null && named == null)
{
try
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum).Name}");
value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
@enum = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -90,7 +90,7 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsNamedToolChoice> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
named = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -101,9 +101,9 @@ public class AssistantsApiToolChoiceOptionJsonConverter : global::System.Text.Js
}

var __value = new global::tryAGI.OpenAI.AssistantsApiToolChoiceOption(
value1,
@enum,

value2
named
);

return __value;
Expand All @@ -118,17 +118,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.IsValue1)
if (value.IsEnum)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsApiToolChoiceOptionEnum).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!.Value, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Enum!.Value, typeInfo);
}
else if (value.IsValue2)
else if (value.IsNamed)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.AssistantsNamedToolChoice?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.AssistantsNamedToolChoice).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Named!, typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ComputerToolCallOutputResourceJsonConverter : global::System.Text.J
if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; }

global::tryAGI.OpenAI.ComputerToolCallOutput? computerToolCallOutput = default;
global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2? value2 = default;
global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2? computerToolCallOutputResourceVariant2 = default;
if (__bestIndex >= 0)
{
if (__bestIndex == 0)
Expand All @@ -67,7 +67,7 @@ public class ComputerToolCallOutputResourceJsonConverter : global::System.Text.J
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
computerToolCallOutputResourceVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -78,7 +78,7 @@ public class ComputerToolCallOutputResourceJsonConverter : global::System.Text.J
}
}

if (computerToolCallOutput == null && value2 == null)
if (computerToolCallOutput == null && computerToolCallOutputResourceVariant2 == null)
{
try
{
Expand All @@ -97,7 +97,7 @@ public class ComputerToolCallOutputResourceJsonConverter : global::System.Text.J
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2).Name}");
value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
computerToolCallOutputResourceVariant2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo);
}
catch (global::System.Text.Json.JsonException)
{
Expand All @@ -110,7 +110,7 @@ public class ComputerToolCallOutputResourceJsonConverter : global::System.Text.J
var __value = new global::tryAGI.OpenAI.ComputerToolCallOutputResource(
computerToolCallOutput,

value2
computerToolCallOutputResourceVariant2
);

return __value;
Expand All @@ -131,11 +131,11 @@ public override void Write(
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.ComputerToolCallOutput).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ComputerToolCallOutput!, typeInfo);
}
else if (value.IsValue2)
else if (value.IsComputerToolCallOutputResourceVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::tryAGI.OpenAI.ComputerToolCallOutputResourceVariant2).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ComputerToolCallOutputResourceVariant2!, typeInfo);
}
}
}
Expand Down
Loading
Loading