Made the JSON types of the model answers settable instead of init-only

This commit is contained in:
Thorsten Sommer committed 2026-11-03 08:54:42 +01:00
1 parent 59910b2ef4
commit 319612c7c3
7 files changed
+30 -30

No files matched your search

@@ -8,8 +8,8 @@ public sealed record AssistantAuditResult
/// <summary>
/// Gets the serialized audit level returned by the model before callers normalize it to <see cref="AssistantAuditLevel"/>.
/// </summary>
public string Level { get; init; } = string.Empty;
public string Summary { get; init; } = string.Empty;
public float Confidence { get; init; }
public List<AssistantAuditFinding> Findings { get; init; } = [];
public string Level { get; set; } = string.Empty;
public string Summary { get; set; } = string.Empty;
public float Confidence { get; set; }
public List<AssistantAuditFinding> Findings { get; set; } = [];
}
@@ -2,12 +2,12 @@ namespace AIStudio.Assistants.Builder;
internal sealed class AssistantBuilderAssistantMetadata
{
public string Kind { get; init; } = string.Empty;
public string Title { get; init; } = string.Empty;
public string Description { get; init; } = string.Empty;
public string? SystemPrompt { get; init; }
public string? SubmitText { get; init; }
public bool? AllowAiStudioProfiles { get; init; }
public string[]? ToolIds { get; init; }
public AssistantBuilderChatLaunchMetadata? Launch { get; init; }
public string Kind { get; set; } = string.Empty;
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string? SystemPrompt { get; set; }
public string? SubmitText { get; set; }
public bool? AllowAiStudioProfiles { get; set; }
public string[]? ToolIds { get; set; }
public AssistantBuilderChatLaunchMetadata? Launch { get; set; }
}
@@ -6,10 +6,10 @@ internal sealed class AssistantBuilderChatLaunchMetadata
/// The workspace the chat is created in. A model leaves this field out for a launcher that
/// opens a chat without a workspace, which is why it stays empty rather than null.
/// </summary>
public string WorkspaceName { get; init; } = string.Empty;
public string? ProviderId { get; init; }
public string? ProfileId { get; init; }
public string? ChatTemplateId { get; init; }
public string[]? DataSourceIds { get; init; }
public string[]? ToolIds { get; init; }
public string WorkspaceName { get; set; } = string.Empty;
public string? ProviderId { get; set; }
public string? ProfileId { get; set; }
public string? ChatTemplateId { get; set; }
public string[]? DataSourceIds { get; set; }
public string[]? ToolIds { get; set; }
}
@@ -2,7 +2,7 @@ namespace AIStudio.Assistants.Builder;
internal sealed class AssistantBuilderPluginMetadata
{
public string Name { get; init; } = string.Empty;
public string Description { get; init; } = string.Empty;
public string[] Categories { get; init; } = [];
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string[] Categories { get; set; } = [];
}
@@ -22,22 +22,22 @@ internal sealed class LauncherTextsResponse
MaxDepth = 8,
};
public string SchemaVersion { get; init; } = string.Empty;
public string SchemaVersion { get; set; } = string.Empty;
/// <summary>
/// The plugin name, shown on the plugins page.
/// </summary>
public string PluginName { get; init; } = string.Empty;
public string PluginName { get; set; } = string.Empty;
/// <summary>
/// The title on the tile.
/// </summary>
public string Title { get; init; } = string.Empty;
public string Title { get; set; } = string.Empty;
/// <summary>
/// The short description, used for both the plugin and the tile.
/// </summary>
public string Description { get; init; } = string.Empty;
public string Description { get; set; } = string.Empty;
public static bool TryParse(string modelResponse, out LauncherTextsResponse response, out LuaResponseParseError error, out string technicalDetails)
{
@@ -3,8 +3,8 @@ namespace AIStudio.Assistants.Builder;
internal sealed partial class LuaResponse
{
public const string SCHEMA_VERSION_VALUE = "assistant_builder_lua_response_v2";
public string SchemaVersion { get; init; } = string.Empty;
public AssistantBuilderPluginMetadata? Plugin { get; init; }
public AssistantBuilderAssistantMetadata? Assistant { get; init; }
public string FullLua { get; init; } = string.Empty;
public string SchemaVersion { get; set; } = string.Empty;
public AssistantBuilderPluginMetadata? Plugin { get; set; }
public AssistantBuilderAssistantMetadata? Assistant { get; set; }
public string FullLua { get; set; } = string.Empty;
}
@@ -24,7 +24,7 @@ internal sealed class ERIServerFileList
/// <summary>
/// The paths of the files, relative to the base directory.
/// </summary>
public List<string>? Files { get; init; }
public List<string>? Files { get; set; }
/// <summary>
/// Reads the list of files out of the answer of the model.