Files
AI-Studio/app/MindWork AI Studio/Assistants/AssistantTextDiff.cs
T

19 lines
768 B
C#

namespace AIStudio.Assistants;
/// <summary>
/// The text of the last run of an assistant and its result, which the assistant shows as a diff.
/// </summary>
/// <param name="Original">The text the assistant worked on.</param>
/// <param name="Changed">The result of the run.</param>
public readonly record struct AssistantTextDiff(string Original, string Changed)
{
/// <summary>
/// No diff, e.g., before the first run.
/// </summary>
public static readonly AssistantTextDiff NONE = new(string.Empty, string.Empty);
/// <summary>
/// Whether there is a diff to show: both texts hold more than white space.
/// </summary>
public bool IsShown => !string.IsNullOrWhiteSpace(this.Original) && !string.IsNullOrWhiteSpace(this.Changed);
}