namespace AIStudio.Tools.DocumentSegments; /// /// What became of a segment, and its new text. /// /// What became of the segment. /// The new text with tags, as the model wrote it; null unless the segment was transformed. public readonly record struct SegmentOutcome(SegmentStatus Status, string? Text) { /// /// A segment a model worked on. /// /// /// The tags of the text may still differ from those of the source, when the model missed them twice: /// the format then writes the words with as much of the inline structure as fits rather than nothing. /// /// The new text with tags. public static SegmentOutcome Transformed(string text) => new(SegmentStatus.TRANSFORMED, text); /// /// A segment which the prompt injection filter kept from the model. /// public static readonly SegmentOutcome FILTERED = new(SegmentStatus.FILTERED, null); /// /// A segment for which no model delivered a result. /// public static readonly SegmentOutcome FAILED = new(SegmentStatus.FAILED, null); }