AI-Studio/app/MindWork AI Studio/Models/Matching/ModelResolution.cs
Thorsten Sommer d85b4e71b6
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Rebuilt how AI Studio knows what a model can do (#960)
2026-09-13 14:17:25 +02:00

37 lines
1.8 KiB
C#

namespace AIStudio.Models.Matching;
/// <summary>
/// What the index made of one model name, and how it got there.
/// </summary>
/// <remarks>
/// The profile alone is what the app asks for. The rest is for the people maintaining the rules:
/// which rule answered, what adjusted the answer afterwards, and whether two rules claimed the name
/// with the same right. The verification run reads all of it; a test that wants to know why a model
/// came out the way it did reads it too.
/// </remarks>
/// <param name="Profile">Everything known about the model.</param>
/// <param name="Selector">The rule which chose the model, or null when no rule knows the name.</param>
/// <param name="Modifiers">The rules which adjusted the answer, in the order they were applied.</param>
/// <param name="TiedSelectors">Rules which claimed the name just as strongly as the selector did.</param>
public sealed record ModelResolution(ModelProfile Profile, ModelRule? Selector, IReadOnlyList<ModelRule> Modifiers, IReadOnlyList<ModelRule> TiedSelectors)
{
/// <summary>
/// The answer for a name no rule was even asked about.
/// </summary>
public static readonly ModelResolution NOTHING = new(ModelProfile.UNKNOWN, null, [], []);
/// <summary>
/// Whether more than one rule claimed this name with the same specificity.
/// </summary>
/// <remarks>
/// Always a mistake in the rules. The answer is still the same one every time, so a build never
/// depends on the order the rules were registered in, but which of the two was meant is
/// something only a person can say.
/// </remarks>
public bool IsAmbiguous => this.TiedSelectors.Count > 0;
/// <summary>
/// Whether any rule at all knew this name.
/// </summary>
public bool IsKnown => this.Selector is not null;
}