mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 08:29:40 +00:00
Added options to enforce minimum confidence levels for each assistant (#147)
This commit is contained in:
1 parent
4175387a93
commit
0ad7b8d4dd
36 files changed
+321
-144
No files matched your search
@@ -144,19 +144,26 @@ public static class ConfigurationSelectDataFactory
|
||||
yield return new(scheme.GetListDescription(), scheme);
|
||||
}
|
||||
|
||||
public static IEnumerable<ConfigurationSelectData<ConfidenceLevel>> GetConfidenceLevelsData()
|
||||
public static IEnumerable<ConfigurationSelectData<ConfidenceLevel>> GetConfidenceLevelsData(SettingsManager settingsManager, bool restrictToGlobalMinimum = false)
|
||||
{
|
||||
var minimumLevel = ConfidenceLevel.NONE;
|
||||
if(restrictToGlobalMinimum && settingsManager.ConfigurationData.LLMProviders is { EnforceGlobalMinimumConfidence: true, GlobalMinimumConfidence: not ConfidenceLevel.NONE and not ConfidenceLevel.UNKNOWN })
|
||||
minimumLevel = settingsManager.ConfigurationData.LLMProviders.GlobalMinimumConfidence;
|
||||
|
||||
foreach (var level in Enum.GetValues<ConfidenceLevel>())
|
||||
{
|
||||
if(level is ConfidenceLevel.NONE)
|
||||
yield return new("No minimum confidence level chosen", level);
|
||||
|
||||
if(level < minimumLevel)
|
||||
continue;
|
||||
|
||||
switch (level)
|
||||
{
|
||||
case ConfidenceLevel.NONE:
|
||||
case ConfidenceLevel.UNKNOWN:
|
||||
continue;
|
||||
|
||||
case ConfidenceLevel.NONE:
|
||||
yield return new("No minimum confidence level chosen", level);
|
||||
break;
|
||||
|
||||
default:
|
||||
yield return new(level.GetName(), level);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user