Added tests which guard the JSON of visual briefings and model answers before source generation

This commit is contained in:
Thorsten Sommer committed 2026-11-03 08:17:30 +01:00
1 parent 24e3c22db3
commit e54566f1f7
22 files changed
+1102 -12

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ public abstract class AgentBase(ILogger<AgentBase> logger, SettingsManager setti
Time = DateTimeOffset.UtcNow,
};
protected static readonly JsonSerializerOptions JSON_SERIALIZER_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_SERIALIZER_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
};
@@ -14,7 +14,7 @@ internal sealed class LauncherTextsResponse
{
public const string SCHEMA_VERSION_VALUE = "assistant_builder_launcher_texts_v1";
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
AllowTrailingCommas = false,
@@ -4,7 +4,7 @@ namespace AIStudio.Assistants.Builder;
internal sealed partial class LuaResponse
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
AllowTrailingCommas = false,
@@ -13,7 +13,7 @@ namespace AIStudio.Assistants.ERI;
/// </remarks>
internal sealed class ERIServerFileList
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
AllowTrailingCommas = false,
@@ -17,7 +17,7 @@ namespace AIStudio.Assistants.PromptOptimizer;
public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialogPromptOptimizer>
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNameCaseInsensitive = true,
};
@@ -8,7 +8,7 @@ namespace AIStudio.Assistants.SWOTAnalysis;
/// </summary>
internal static class SwotModelAnswer
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNameCaseInsensitive = true,
AllowTrailingCommas = true,
@@ -7,7 +7,7 @@ namespace AIStudio.Tools.PowerPoint;
internal sealed partial record SlideDeckSpec
{
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
internal static readonly JsonSerializerOptions JSON_OPTIONS = new()
{
PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower,
PropertyNameCaseInsensitive = true,
@@ -158,17 +158,18 @@ internal sealed partial record SlideDeckSpec
private static string Clean(string? text) => text?.Trim() ?? string.Empty;
//
// What the model writes, before anything is checked. Every value may be missing or null.
// What the model writes, before anything is checked. Every value may be missing or null. Internal
// rather than private, so that the JSON context of the deck can name them:
//
private sealed class DeckDto
internal sealed class DeckDto
{
public string? Title { get; set; }
public List<SlideDto?>? Slides { get; set; }
}
private sealed class SlideDto
internal sealed class SlideDto
{
public int? TemplateSlide { get; set; }
@@ -191,7 +192,7 @@ internal sealed partial record SlideDeckSpec
public JsonElement? Remove { get; set; }
}
private sealed class TableDto
internal sealed class TableDto
{
public List<JsonElement>? Headers { get; set; }