// <auto-generated/>
#nullable enable annotations
#nullable disable warnings
// Suppress warnings about [Obsolete] member usage in generated code.
#pragma warning disable CS0612, CS0618
namespace Microsoft.Extensions.AI.Evaluation.Reporting.JsonSerialization
{
internal static partial class AzureStorageJsonUtilities
{
private sealed partial class JsonContext
{
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails>? _ChatTurnDetails;
/// <summary>
/// Defines the source generated JSON serialization contract metadata for a given type.
/// </summary>
#nullable disable annotations // Marking the property type as nullable-oblivious.
public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails> ChatTurnDetails
#nullable enable annotations
{
get => _ChatTurnDetails ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails));
}
private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails> Create_ChatTurnDetails(global::System.Text.Json.JsonSerializerOptions options)
{
if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails> jsonTypeInfo))
{
var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails>
{
ObjectCreator = null,
ObjectWithParameterizedConstructorCreator = static args => new global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails((global::System.TimeSpan)args[0], (string)args[1], (string)args[2], (global::Microsoft.Extensions.AI.UsageDetails)args[3], (string)args[4], (bool?)args[5]),
PropertyMetadataInitializer = _ => ChatTurnDetailsPropInit(options),
ConstructorParameterMetadataInitializer = ChatTurnDetailsCtorParamInit,
ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetConstructor(InstanceMemberBindingFlags, binder: null, new[] {typeof(global::System.TimeSpan), typeof(string), typeof(string), typeof(global::Microsoft.Extensions.AI.UsageDetails), typeof(string), typeof(bool?)}, modifiers: null),
SerializeHandler = ChatTurnDetailsSerializeHandler,
};
jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails>(options, objectInfo);
jsonTypeInfo.NumberHandling = null;
}
jsonTypeInfo.OriginatingResolver = this;
return jsonTypeInfo;
}
private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ChatTurnDetailsPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[6];
var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.TimeSpan>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Latency,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Latency = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Latency",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("Latency", InstanceMemberBindingFlags, null, typeof(global::System.TimeSpan), global::System.Array.Empty<global::System.Type>(), null),
};
properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.TimeSpan>(options, info0);
var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Model,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Model = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Model",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("Model", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info1);
var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).ModelProvider,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).ModelProvider = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "ModelProvider",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("ModelProvider", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info2);
var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.UsageDetails>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Usage,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).Usage = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "Usage",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("Usage", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.UsageDetails), global::System.Array.Empty<global::System.Type>(), null),
};
properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.UsageDetails>(options, info3);
var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).CacheKey,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).CacheKey = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "CacheKey",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("CacheKey", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null),
};
properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info4);
var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?>
{
IsProperty = true,
IsPublic = true,
IsVirtual = false,
DeclaringType = typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails),
Converter = null,
Getter = static obj => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).CacheHit,
Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)obj).CacheHit = value!,
IgnoreCondition = null,
HasJsonInclude = false,
IsExtensionData = false,
NumberHandling = null,
PropertyName = "CacheHit",
JsonPropertyName = null,
AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails).GetProperty("CacheHit", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null),
};
properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info5);
return properties;
}
// Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
// methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
private void ChatTurnDetailsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails? value)
{
if (value is null)
{
writer.WriteNullValue();
return;
}
writer.WriteStartObject();
writer.WritePropertyName(PropName_latency);
global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).Latency, TimeSpan);
string __value_Model = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).Model;
if (__value_Model is not null)
{
writer.WriteString(PropName_model, __value_Model);
}
string __value_ModelProvider = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).ModelProvider;
if (__value_ModelProvider is not null)
{
writer.WriteString(PropName_modelProvider, __value_ModelProvider);
}
global::Microsoft.Extensions.AI.UsageDetails __value_Usage = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).Usage;
if (__value_Usage is not null)
{
writer.WritePropertyName(PropName_usage);
UsageDetailsSerializeHandler(writer, __value_Usage);
}
string __value_CacheKey = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).CacheKey;
if (__value_CacheKey is not null)
{
writer.WriteString(PropName_cacheKey, __value_CacheKey);
}
bool? __value_CacheHit = ((global::Microsoft.Extensions.AI.Evaluation.Reporting.ChatTurnDetails)value).CacheHit;
if (__value_CacheHit is not null)
{
writer.WritePropertyName(PropName_cacheHit);
global::System.Text.Json.JsonSerializer.Serialize(writer, __value_CacheHit, NullableBoolean);
}
writer.WriteEndObject();
}
private static global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[] ChatTurnDetailsCtorParamInit() => new global::System.Text.Json.Serialization.Metadata.JsonParameterInfoValues[]
{
new()
{
Name = "latency",
ParameterType = typeof(global::System.TimeSpan),
Position = 0,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = false,
},
new()
{
Name = "model",
ParameterType = typeof(string),
Position = 1,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
new()
{
Name = "modelProvider",
ParameterType = typeof(string),
Position = 2,
HasDefaultValue = false,
DefaultValue = null,
IsNullable = true,
},
new()
{
Name = "usage",
ParameterType = typeof(global::Microsoft.Extensions.AI.UsageDetails),
Position = 3,
HasDefaultValue = true,
DefaultValue = default(global::Microsoft.Extensions.AI.UsageDetails),
IsNullable = true,
},
new()
{
Name = "cacheKey",
ParameterType = typeof(string),
Position = 4,
HasDefaultValue = true,
DefaultValue = default(string),
IsNullable = true,
},
new()
{
Name = "cacheHit",
ParameterType = typeof(bool?),
Position = 5,
HasDefaultValue = true,
DefaultValue = default(bool?),
IsNullable = true,
},
};
}
}
}