Skip to content

Commit e1af0b2

Browse files
committed
Disable init of LLM Service if LLM Features are not enabled
1 parent 737542f commit e1af0b2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Bellatrix.LLM/SemanticKernelService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private static void EnsureInitialized()
5454
return;
5555

5656
var llmSettings = ConfigurationService.GetSection<LargeLanguageModelsSettings>();
57-
if (llmSettings == null)
57+
if (llmSettings is null or { EnableSelfHealing: false, EnableSmartFailureAnalysis: false })
5858
return;
5959

6060
var genSettings = llmSettings.ModelSettings[0];

src/Bellatrix.Web/WebPluginsConfiguration.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@ public static void ConfigureLLM()
243243
try
244244
{
245245
var settings = ConfigurationService.GetSection<LargeLanguageModelsSettings>();
246-
246+
if (!settings.EnableSelfHealing && !settings.EnableSmartFailureAnalysis)
247+
{
248+
Logger.LogError("LLM Features are disabled.");
249+
return;
250+
}
251+
247252
SemanticKernelService.Kernel.ImportPluginFromObject(new LocatorSkill(), nameof(LocatorSkill));
248253
SemanticKernelService.Kernel.ImportPluginFromObject(new AssertionSkill(), nameof(AssertionSkill));
249254
SemanticKernelService.Kernel.ImportPluginFromObject(new PageObjectSummarizerSkill(), nameof(PageObjectSummarizerSkill));

0 commit comments

Comments
 (0)