AI-Studio/app/MindWork AI Studio/Models/Matching/ModelRule.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

43 lines
1.6 KiB
C#

namespace AIStudio.Models.Matching;
/// <summary>
/// One statement about a set of model names: which names, and what holds for them.
/// </summary>
/// <param name="pattern">Which names this rule answers for.</param>
/// <param name="kind">Whether the rule chooses the model or adjusts the choice.</param>
/// <param name="change">What the rule states.</param>
/// <param name="origin">Who wrote the rule, so that a conflict can name both sides.</param>
public sealed class ModelRule(MatchPattern pattern, ModelRuleKind kind, ModelProfileChange change, string origin)
{
/// <summary>
/// Which names this rule answers for.
/// </summary>
public MatchPattern Pattern { get; } = pattern;
/// <summary>
/// Whether the rule chooses the model or adjusts the choice.
/// </summary>
public ModelRuleKind Kind { get; } = kind;
/// <summary>
/// What the rule states.
/// </summary>
public ModelProfileChange Change { get; } = change;
/// <summary>
/// Who wrote the rule: a family, a host, or a plugin.
/// </summary>
public string Origin { get; } = origin;
/// <summary>
/// How much this rule claims to know, worked out once when the rule is built.
/// </summary>
public RuleSpecificity Specificity { get; } = RuleSpecificity.Of(pattern);
/// <summary>
/// Names the rule in one line, for conflict reports and for breaking ties the same way twice.
/// </summary>
public string Description { get; } = $"{origin}: {kind} {pattern.Kind} \"{pattern.Text}\"";
public override string ToString() => this.Description;
}