From 71169c76cfd1bcd3f5185d7e3dcc0a6aa49b108e Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 29 Jan 2026 08:05:31 +0100 Subject: [PATCH] Allow settings explicit minimum confidence level --- .../ConfigurationProviderSelection.razor.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs b/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs index 39ae76be..8267219c 100644 --- a/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs +++ b/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs @@ -25,6 +25,9 @@ public partial class ConfigurationProviderSelection : MSGComponentBase [Parameter] public Tools.Components Component { get; set; } = Tools.Components.NONE; + + [Parameter] + public ConfidenceLevel ExplicitMinimumConfidence { get; set; } = ConfidenceLevel.UNKNOWN; [Parameter] public Func Disabled { get; set; } = () => false; @@ -38,7 +41,14 @@ public partial class ConfigurationProviderSelection : MSGComponentBase if(this.Component is not Tools.Components.NONE and not Tools.Components.APP_SETTINGS) yield return new(T("Use app default"), string.Empty); + // Get the minimum confidence level for this component, and/or the enforced global minimum confidence level: var minimumLevel = this.SettingsManager.GetMinimumConfidenceLevel(this.Component); + + // Apply the explicit minimum confidence level if set and higher than the current minimum level: + if (this.ExplicitMinimumConfidence is not ConfidenceLevel.UNKNOWN && this.ExplicitMinimumConfidence > minimumLevel) + minimumLevel = this.ExplicitMinimumConfidence; + + // Filter the providers based on the minimum confidence level: foreach (var providerId in this.Data) { var provider = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == providerId.Value); @@ -75,4 +85,4 @@ public partial class ConfigurationProviderSelection : MSGComponentBase } #endregion -} \ No newline at end of file +}