diff --git a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.cs b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.cs index 195cf062eb3..4e3f90aa47f 100644 --- a/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.cs +++ b/src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonUtilities.Schema.cs @@ -302,7 +302,7 @@ JsonNode TransformSchemaNode(JsonSchemaExporterContext ctx, JsonNode schema) _ = objSchema.TryGetPropertyValue(RequiredPropertyName, out JsonNode? required); if (required is not JsonArray { } requiredArray || requiredArray.Count != propertiesObj.Count) { - requiredArray = [.. propertiesObj.Select(prop => prop.Key)]; + requiredArray = [.. propertiesObj.Select(prop => (JsonNode)prop.Key)]; objSchema[RequiredPropertyName] = requiredArray; } }