< Summary

Information
Class: UIBlazor.Models.VisualChatMessage
Assembly: UIBlazor
File(s): /home/runner/work/InvAit/InvAit/UIBlazor/Models/VisualChatMessage.cs
Tag: 71_26091983037
Line coverage
100%
Covered lines: 20
Uncovered lines: 0
Coverable lines: 20
Total lines: 104
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_Content()100%11100%
get_Segments()100%11100%
get_DisplayContent()100%11100%
get_ReasoningContent()100%11100%
get_Timings()100%11100%
get_Timestamp()100%11100%
get_IsStreaming()100%11100%
get_IsEditing()100%11100%
get_TempContent()100%11100%
get_Model()100%11100%
get_Role()100%11100%
get_ToolResults()100%11100%
get_IsExpanded()100%11100%
get_PlanContent()100%11100%
get_HasPlan()100%11100%
get_RetryCountdown()100%11100%
get_RetryAttempt()100%11100%
get_MaxRetryAttempts()100%11100%
get_IsRetrying()100%11100%

File(s)

/home/runner/work/InvAit/InvAit/UIBlazor/Models/VisualChatMessage.cs

#LineLine coverage
 1namespace UIBlazor.Models;
 2
 3/// <summary>
 4/// Represents a chat message.
 5/// Saved in session history
 6/// </summary>
 7public class VisualChatMessage
 8{
 9    /// <summary>
 10    /// Gets or sets the unique identifier for the message.
 11    /// </summary>
 12    [JsonIgnore]
 13513    public string Id { get; } = DateTime.Now.ToString("s") + Guid.NewGuid();
 14
 15    /// <summary>
 16    /// Gets or sets the content of the message. Without thinking block.
 17    /// </summary>
 23918    public string Content { get; set; } = string.Empty;
 19
 20    [JsonIgnore]
 16921    public List<ContentSegment> Segments { get; } = [];
 22
 23    /// <summary>
 24    /// Gets or sets the content of the message for display in the UI.
 25    /// If null, Content is used.
 26    /// </summary>
 27    [JsonIgnore]
 128    public string? DisplayContent { get; set; }
 29
 30    /// <summary>
 31    /// Gets or sets the content of the Reasoning message. Aka Think block.
 32    /// </summary>
 33    [JsonIgnore]
 6634    public string ReasoningContent { get; set; } = string.Empty;
 35
 36    [JsonIgnore]
 937    public MessageTimings? Timings { get; set; }
 38
 39    /// <summary>
 40    /// Gets or sets the timestamp when the message was created.
 41    /// </summary>
 16342    public DateTime Timestamp { get; set; } = DateTime.Now;
 43
 44    /// <summary>
 45    /// Gets or sets whether this message is currently streaming.
 46    /// </summary>
 47    [JsonIgnore]
 20248    public bool IsStreaming { get; set; }
 49
 50    /// <summary>
 51    /// Gets or sets whether this message is currently being edited.
 52    /// </summary>
 53    [JsonIgnore]
 36154    public bool IsEditing { get; set; }
 55
 56    /// <summary>
 57    /// Temporary storage for content during editing.
 58    /// </summary>
 59    [JsonIgnore]
 8460    public string TempContent { get; set; } = string.Empty;
 61
 62    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
 5363    public string? Model { get; set; }
 64
 65    /// <summary>
 66    /// Gets or sets the role associated with the message (e.g., "user", "assistant").
 67    /// </summary>
 35868    public string Role { get; set; } = ChatMessageRole.User;
 69
 70    /// <summary>
 71    /// Nested tool messages for assistant messages.
 72    /// </summary>
 6673    public List<ToolResult> ToolResults { get; set; } = [];
 74
 75    /// <summary>
 76    /// Whether the message block is expanded or collapsed.
 77    /// </summary>
 78    [JsonIgnore]
 15779    public bool IsExpanded { get; set; }
 80
 81    /// <summary>
 82    /// Extracted plan content if any.
 83    /// </summary>
 84    [JsonIgnore]
 5985    public string? PlanContent { get; set; }
 86
 87    /// <summary>
 88    /// Whether this message contains a plan.
 89    /// </summary>
 90    [JsonIgnore]
 5091    public bool HasPlan => !string.IsNullOrEmpty(PlanContent);
 92
 93    [JsonIgnore]
 11594    public int RetryCountdown { get; set; }
 95
 96    [JsonIgnore]
 297    public int RetryAttempt { get; set; }
 98
 99    [JsonIgnore]
 2100    public int MaxRetryAttempts { get; set; }
 101
 102    [JsonIgnore]
 56103    public bool IsRetrying => RetryCountdown > 0;
 104}