Refused JSON contracts built by reflection and checked all of them in the trimmed build (#1152)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-03 18:29:50 +01:00
1 parent f864359290
commit 0b42c0288e
23 files changed
+535 -99

No files matched your search

@@ -0,0 +1,15 @@
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
namespace AIStudio.Tools.ToolCallingSystem;
/// <summary>
/// The contracts of the options with which a tool result is written for the model, built at compile time.
/// </summary>
/// <remarks>
/// A JSON result is a tree of JSON nodes, which writes itself and needs no contract from the options. The
/// context is there all the same, so that these options can never fall back to reflection either.
/// </remarks>
[JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata)]
[JsonSerializable(typeof(JsonNode))]
internal sealed partial class ToolExecutionResultJsonContext : JsonSerializerContext;