mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-03 03:54:24 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
namespace AIStudio.Tools.DocumentSegments;
|
|
|
|
/// <summary>
|
|
/// What became of a segment, and its new text.
|
|
/// </summary>
|
|
/// <param name="Status">What became of the segment.</param>
|
|
/// <param name="Text">The new text with tags, as the model wrote it; null unless the segment was transformed.</param>
|
|
public readonly record struct SegmentOutcome(SegmentStatus Status, string? Text)
|
|
{
|
|
/// <summary>
|
|
/// A segment a model worked on.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 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.
|
|
/// </remarks>
|
|
/// <param name="text">The new text with tags.</param>
|
|
public static SegmentOutcome Transformed(string text) => new(SegmentStatus.TRANSFORMED, text);
|
|
|
|
/// <summary>
|
|
/// A segment which the prompt injection filter kept from the model.
|
|
/// </summary>
|
|
public static readonly SegmentOutcome FILTERED = new(SegmentStatus.FILTERED, null);
|
|
|
|
/// <summary>
|
|
/// A segment for which no model delivered a result.
|
|
/// </summary>
|
|
public static readonly SegmentOutcome FAILED = new(SegmentStatus.FAILED, null);
|
|
} |