mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-05-21 02:52:15 +00:00
useful xml docstrings
This commit is contained in:
parent
f897ff3b5d
commit
b579129535
@ -2,13 +2,23 @@ using System.Text.Json.Serialization;
|
|||||||
|
|
||||||
namespace AIStudio.Agents.AssistantAudit;
|
namespace AIStudio.Agents.AssistantAudit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a single structured security finding produced by the assistant audit agent.
|
||||||
|
/// </summary>
|
||||||
public sealed class AssistantAuditFinding
|
public sealed class AssistantAuditFinding
|
||||||
{
|
{
|
||||||
private readonly AssistantAuditLevel severity = AssistantAuditLevel.UNKNOWN;
|
#pragma warning disable MWAIS0005
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the normalized internal severity level derived from <see cref="SeverityText"/>.
|
||||||
|
/// </summary>
|
||||||
|
#pragma warning restore MWAIS0005
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public AssistantAuditLevel Severity => this.severity;
|
public AssistantAuditLevel Severity { get; private init; } = AssistantAuditLevel.UNKNOWN;
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or initializes the JSON-facing severity label used by the audit model response.
|
||||||
|
/// </summary>
|
||||||
[JsonPropertyName("severity")]
|
[JsonPropertyName("severity")]
|
||||||
public string SeverityText
|
public string SeverityText
|
||||||
{
|
{
|
||||||
@ -19,7 +29,7 @@ public sealed class AssistantAuditFinding
|
|||||||
AssistantAuditLevel.SAFE => "low",
|
AssistantAuditLevel.SAFE => "low",
|
||||||
_ => "unknown",
|
_ => "unknown",
|
||||||
};
|
};
|
||||||
init => this.severity = value?.Trim().ToLowerInvariant() switch
|
init => this.Severity = value?.Trim().ToLowerInvariant() switch
|
||||||
{
|
{
|
||||||
"critical" => AssistantAuditLevel.DANGEROUS,
|
"critical" => AssistantAuditLevel.DANGEROUS,
|
||||||
"medium" => AssistantAuditLevel.CAUTION,
|
"medium" => AssistantAuditLevel.CAUTION,
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
namespace AIStudio.Agents.AssistantAudit;
|
namespace AIStudio.Agents.AssistantAudit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the normalized outcome levels used for assistant plugin security audits.
|
||||||
|
/// </summary>
|
||||||
public enum AssistantAuditLevel
|
public enum AssistantAuditLevel
|
||||||
{
|
{
|
||||||
UNKNOWN = 0,
|
UNKNOWN = 0,
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
namespace AIStudio.Agents.AssistantAudit;
|
namespace AIStudio.Agents.AssistantAudit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the normalized result returned by the assistant plugin security audit flow.
|
||||||
|
/// </summary>
|
||||||
public sealed class AssistantAuditResult
|
public sealed class 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 Level { get; init; } = string.Empty;
|
||||||
public string Summary { get; init; } = string.Empty;
|
public string Summary { get; init; } = string.Empty;
|
||||||
public float Confidence { get; init; }
|
public float Confidence { get; init; }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user