// <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 { internal sealed partial class TestJsonSerializerContext { private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatOptions>? _ChatOptions; /// <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.ChatOptions> ChatOptions #nullable enable annotations { get => _ChatOptions ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatOptions>)Options.GetTypeInfo(typeof(global::Microsoft.Extensions.AI.ChatOptions)); } private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatOptions> Create_ChatOptions(global::System.Text.Json.JsonSerializerOptions options) { if (!TryGetTypeInfoForRuntimeCustomConverter<global::Microsoft.Extensions.AI.ChatOptions>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Microsoft.Extensions.AI.ChatOptions> jsonTypeInfo)) { var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<global::Microsoft.Extensions.AI.ChatOptions> { ObjectCreator = () => new global::Microsoft.Extensions.AI.ChatOptions(), ObjectWithParameterizedConstructorCreator = null, PropertyMetadataInitializer = _ => ChatOptionsPropInit(options), ConstructorParameterMetadataInitializer = null, ConstructorAttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty<global::System.Type>(), modifiers: null), SerializeHandler = ChatOptionsSerializeHandler, }; jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo<global::Microsoft.Extensions.AI.ChatOptions>(options, objectInfo); jsonTypeInfo.NumberHandling = null; } jsonTypeInfo.OriginatingResolver = this; return jsonTypeInfo; } private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] ChatOptionsPropInit(global::System.Text.Json.JsonSerializerOptions options) { var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[20]; var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ConversationId, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ConversationId = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ConversationId", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("ConversationId", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), }; properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(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.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Instructions, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Instructions = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Instructions", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("Instructions", 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<float?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Temperature, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Temperature = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Temperature", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("Temperature", InstanceMemberBindingFlags, null, typeof(float?), global::System.Array.Empty<global::System.Type>(), null), }; properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<float?>(options, info2); var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).MaxOutputTokens, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).MaxOutputTokens = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "MaxOutputTokens", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("MaxOutputTokens", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), }; properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int?>(options, info3); var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<float?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).TopP, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).TopP = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "TopP", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("TopP", InstanceMemberBindingFlags, null, typeof(float?), global::System.Array.Empty<global::System.Type>(), null), }; properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<float?>(options, info4); var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<int?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).TopK, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).TopK = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "TopK", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("TopK", InstanceMemberBindingFlags, null, typeof(int?), global::System.Array.Empty<global::System.Type>(), null), }; properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<int?>(options, info5); var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<float?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).FrequencyPenalty, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).FrequencyPenalty = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "FrequencyPenalty", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("FrequencyPenalty", InstanceMemberBindingFlags, null, typeof(float?), global::System.Array.Empty<global::System.Type>(), null), }; properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<float?>(options, info6); var info7 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<float?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).PresencePenalty, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).PresencePenalty = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "PresencePenalty", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("PresencePenalty", InstanceMemberBindingFlags, null, typeof(float?), global::System.Array.Empty<global::System.Type>(), null), }; properties[7] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<float?>(options, info7); var info8 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<long?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Seed, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Seed = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Seed", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("Seed", InstanceMemberBindingFlags, null, typeof(long?), global::System.Array.Empty<global::System.Type>(), null), }; properties[8] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<long?>(options, info8); var info9 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.ReasoningOptions> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Reasoning, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).Reasoning = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Reasoning", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("Reasoning", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ReasoningOptions), global::System.Array.Empty<global::System.Type>(), null), }; properties[9] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.ReasoningOptions>(options, info9); var info10 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.ChatResponseFormat> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ResponseFormat, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ResponseFormat = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ResponseFormat", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("ResponseFormat", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ChatResponseFormat), global::System.Array.Empty<global::System.Type>(), null), }; properties[10] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.ChatResponseFormat>(options, info10); var info11 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<string> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ModelId, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ModelId = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ModelId", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("ModelId", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty<global::System.Type>(), null), }; properties[11] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<string>(options, info11); var info12 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.IList<string>> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).StopSequences, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).StopSequences = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "StopSequences", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("StopSequences", InstanceMemberBindingFlags, null, typeof(global::System.Collections.Generic.IList<string>), global::System.Array.Empty<global::System.Type>(), null), }; properties[12] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.IList<string>>(options, info12); var info13 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AllowMultipleToolCalls, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AllowMultipleToolCalls = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "AllowMultipleToolCalls", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("AllowMultipleToolCalls", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null), }; properties[13] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info13); var info14 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.ChatToolMode> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ToolMode, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ToolMode = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ToolMode", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("ToolMode", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ChatToolMode), global::System.Array.Empty<global::System.Type>(), null), }; properties[14] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.ChatToolMode>(options, info14); var info15 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<object> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = null, Setter = null, IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "Tools", JsonPropertyName = null, AttributeProviderFactory = static () => null, }; properties[15] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<object>(options, info15); var info16 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<bool?> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AllowBackgroundResponses, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AllowBackgroundResponses = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "AllowBackgroundResponses", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("AllowBackgroundResponses", InstanceMemberBindingFlags, null, typeof(bool?), global::System.Array.Empty<global::System.Type>(), null), }; properties[16] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<bool?>(options, info16); var info17 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.ResponseContinuationToken> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ContinuationToken, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).ContinuationToken = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "ContinuationToken", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("ContinuationToken", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.ResponseContinuationToken), global::System.Array.Empty<global::System.Type>(), null), }; properties[17] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.ResponseContinuationToken>(options, info17); var info18 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<object> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = null, Setter = null, IgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.Always, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "RawRepresentationFactory", JsonPropertyName = null, AttributeProviderFactory = static () => null, }; properties[18] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<object>(options, info18); var info19 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary> { IsProperty = true, IsPublic = true, IsVirtual = false, DeclaringType = typeof(global::Microsoft.Extensions.AI.ChatOptions), Converter = null, Getter = static obj => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AdditionalProperties, Setter = static (obj, value) => ((global::Microsoft.Extensions.AI.ChatOptions)obj).AdditionalProperties = value!, IgnoreCondition = null, HasJsonInclude = false, IsExtensionData = false, NumberHandling = null, PropertyName = "AdditionalProperties", JsonPropertyName = null, AttributeProviderFactory = static () => typeof(global::Microsoft.Extensions.AI.ChatOptions).GetProperty("AdditionalProperties", InstanceMemberBindingFlags, null, typeof(global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary), global::System.Array.Empty<global::System.Type>(), null), }; properties[19] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary>(options, info19); 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 ChatOptionsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::Microsoft.Extensions.AI.ChatOptions? value) { if (value is null) { writer.WriteNullValue(); return; } writer.WriteStartObject(); string __value_ConversationId = ((global::Microsoft.Extensions.AI.ChatOptions)value).ConversationId; if (__value_ConversationId is not null) { writer.WriteString(PropName_conversationId, __value_ConversationId); } string __value_Instructions = ((global::Microsoft.Extensions.AI.ChatOptions)value).Instructions; if (__value_Instructions is not null) { writer.WriteString(PropName_instructions, __value_Instructions); } float? __value_Temperature = ((global::Microsoft.Extensions.AI.ChatOptions)value).Temperature; if (__value_Temperature is not null) { writer.WritePropertyName(PropName_temperature); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_Temperature, NullableSingle); } int? __value_MaxOutputTokens = ((global::Microsoft.Extensions.AI.ChatOptions)value).MaxOutputTokens; if (__value_MaxOutputTokens is not null) { writer.WritePropertyName(PropName_maxOutputTokens); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_MaxOutputTokens, NullableInt32); } float? __value_TopP = ((global::Microsoft.Extensions.AI.ChatOptions)value).TopP; if (__value_TopP is not null) { writer.WritePropertyName(PropName_topP); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_TopP, NullableSingle); } int? __value_TopK = ((global::Microsoft.Extensions.AI.ChatOptions)value).TopK; if (__value_TopK is not null) { writer.WritePropertyName(PropName_topK); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_TopK, NullableInt32); } float? __value_FrequencyPenalty = ((global::Microsoft.Extensions.AI.ChatOptions)value).FrequencyPenalty; if (__value_FrequencyPenalty is not null) { writer.WritePropertyName(PropName_frequencyPenalty); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_FrequencyPenalty, NullableSingle); } float? __value_PresencePenalty = ((global::Microsoft.Extensions.AI.ChatOptions)value).PresencePenalty; if (__value_PresencePenalty is not null) { writer.WritePropertyName(PropName_presencePenalty); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_PresencePenalty, NullableSingle); } long? __value_Seed = ((global::Microsoft.Extensions.AI.ChatOptions)value).Seed; if (__value_Seed is not null) { writer.WritePropertyName(PropName_seed); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_Seed, NullableInt64); } global::Microsoft.Extensions.AI.ReasoningOptions __value_Reasoning = ((global::Microsoft.Extensions.AI.ChatOptions)value).Reasoning; if (__value_Reasoning is not null) { writer.WritePropertyName(PropName_reasoning); ReasoningOptionsSerializeHandler(writer, __value_Reasoning); } global::Microsoft.Extensions.AI.ChatResponseFormat __value_ResponseFormat = ((global::Microsoft.Extensions.AI.ChatOptions)value).ResponseFormat; if (__value_ResponseFormat is not null) { writer.WritePropertyName(PropName_responseFormat); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_ResponseFormat, ChatResponseFormat); } string __value_ModelId = ((global::Microsoft.Extensions.AI.ChatOptions)value).ModelId; if (__value_ModelId is not null) { writer.WriteString(PropName_modelId, __value_ModelId); } global::System.Collections.Generic.IList<string> __value_StopSequences = ((global::Microsoft.Extensions.AI.ChatOptions)value).StopSequences; if (__value_StopSequences is not null) { writer.WritePropertyName(PropName_stopSequences); IListStringSerializeHandler(writer, __value_StopSequences); } bool? __value_AllowMultipleToolCalls = ((global::Microsoft.Extensions.AI.ChatOptions)value).AllowMultipleToolCalls; if (__value_AllowMultipleToolCalls is not null) { writer.WritePropertyName(PropName_allowMultipleToolCalls); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_AllowMultipleToolCalls, NullableBoolean); } global::Microsoft.Extensions.AI.ChatToolMode __value_ToolMode = ((global::Microsoft.Extensions.AI.ChatOptions)value).ToolMode; if (__value_ToolMode is not null) { writer.WritePropertyName(PropName_toolMode); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_ToolMode, ChatToolMode); } bool? __value_AllowBackgroundResponses = ((global::Microsoft.Extensions.AI.ChatOptions)value).AllowBackgroundResponses; if (__value_AllowBackgroundResponses is not null) { writer.WritePropertyName(PropName_allowBackgroundResponses); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_AllowBackgroundResponses, NullableBoolean); } global::Microsoft.Extensions.AI.ResponseContinuationToken __value_ContinuationToken = ((global::Microsoft.Extensions.AI.ChatOptions)value).ContinuationToken; if (__value_ContinuationToken is not null) { writer.WritePropertyName(PropName_continuationToken); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_ContinuationToken, ResponseContinuationToken); } global::Microsoft.Extensions.AI.AdditionalPropertiesDictionary __value_AdditionalProperties = ((global::Microsoft.Extensions.AI.ChatOptions)value).AdditionalProperties; if (__value_AdditionalProperties is not null) { writer.WritePropertyName(PropName_additionalProperties); global::System.Text.Json.JsonSerializer.Serialize(writer, __value_AdditionalProperties, AdditionalPropertiesDictionary); } writer.WriteEndObject(); } } }