Moved the background agents to AI operations (#1215)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-21 19:47:10 +01:00
1 parent 8a4a26503b
commit c50a93cd17
139 files changed
+4069 -2340

No files matched your search

@@ -464,13 +464,16 @@ public sealed class SettingsManager
public void InjectSpellchecking(Dictionary<string, object?> attributes) => attributes["spellcheck"] = this.ConfigurationData.App.EnableSpellchecking ? "true" : "false";
/// <summary>
/// The global minimum confidence level; NONE when neither the user nor the organization enforces one.
/// </summary>
public ConfidenceLevel GlobalMinimumConfidenceLevel => this.ConfigurationData.Confidence is { EnforceGlobalMinimumConfidence: true, GlobalMinimumConfidence: not ConfidenceLevel.NONE and not ConfidenceLevel.UNKNOWN }
? this.ConfigurationData.Confidence.GlobalMinimumConfidence
: ConfidenceLevel.NONE;
public ConfidenceLevel GetMinimumConfidenceLevel(Tools.Components component)
{
var minimumLevel = ConfidenceLevel.NONE;
var enforceGlobalMinimumConfidence = this.ConfigurationData.Confidence is { EnforceGlobalMinimumConfidence: true, GlobalMinimumConfidence: not ConfidenceLevel.NONE and not ConfidenceLevel.UNKNOWN };
if (enforceGlobalMinimumConfidence)
minimumLevel = this.ConfigurationData.Confidence.GlobalMinimumConfidence;
var minimumLevel = this.GlobalMinimumConfidenceLevel;
var componentMinimumLevel = component.MinimumConfidence(this);
if (componentMinimumLevel > minimumLevel)
minimumLevel = componentMinimumLevel;
@@ -612,6 +615,18 @@ public sealed class SettingsManager
return this.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.ConfigurationData.App.PreselectedProvider && this.IsProviderUsable(x.UsedLLMProvider, minimumLevel)) ?? Provider.NONE;
}
/// <summary>
/// The ID of the provider which serves as the app-wide default.
/// </summary>
/// <remarks>
/// With exactly one configured provider, that one is the default, whatever the settings name, as in
/// GetPreselectedProvider. Neither a prohibition nor the confidence level is checked here: whoever uses
/// the provider checks them, e.g., AIOperationProviderChoice. The ID is empty when no default is set.
/// </remarks>
public string AppDefaultProviderId => this.ConfigurationData.Providers.Count == 1
? this.ConfigurationData.Providers[0].Id
: this.ConfigurationData.App.PreselectedProvider;
public Provider GetChatProviderForLoadedChat(string? chatProviderId = null)
{
var minimumLevel = this.GetMinimumConfidenceLevel(Tools.Components.CHAT);