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