Added a settings dialog with organization-managed defaults to the Assistant Builder (#908)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
nilskruthoffandThorsten Sommer authored and GitHub committed 2026-10-22 15:26:04 +02:00
1 parent 4695fb3fef
commit 052868b24e
14 files changed
+224 -8

No files matched your search

@@ -0,0 +1,26 @@
@using AIStudio.Settings
@inherits SettingsDialogBase
<MudDialog>
<TitleContent>
<MudText Typo="Typo.h6" Class="d-flex align-center">
<MudIcon Icon="@Icons.Material.Filled.AutoMode" Class="mr-2"/>
@T("Assistant: Assistant Builder defaults")
</MudText>
</TitleContent>
<DialogContent>
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect Assistant Builder options?")" LabelOn="@T("Assistant Builder options are preselected")" LabelOff="@T("No Assistant Builder options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectOptions)" StateUpdate="@(value => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectOptions = value)" OptionHelp="@T("When enabled, the Assistant Builder starts with the defaults configured below. When disabled, it uses the app-wide default provider and preselects no output language.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantBuilder, x => x.PreselectOptions, out var meta) && meta.IsLocked"/>
<ConfigurationSelect OptionDescription="@T("Default output language")" Disabled="@this.DefaultsDisabled" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedOutputLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesOptionalData()" SelectionUpdate="@(value => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedOutputLanguage = value)" OptionHelp="@T("The language in which the assistants you build answer.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantBuilder, x => x.PreselectedOutputLanguage, out var meta) && meta.IsLocked"/>
@if (this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedOutputLanguage is CommonLanguages.OTHER)
{
<ConfigurationText OptionDescription="@T("Default custom output language")" Disabled="@this.DefaultsDisabled" Icon="@Icons.Material.Filled.Translate" Text="@(() => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedOtherOutputLanguage)" TextUpdate="@(value => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedOtherOutputLanguage = value)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantBuilder, x => x.PreselectedOtherOutputLanguage, out var meta) && meta.IsLocked"/>
}
<ConfigurationMinConfidenceSelection Disabled="@this.DefaultsDisabled" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantBuilder.MinimumProviderConfidence)" SelectionUpdate="@(value => this.SettingsManager.ConfigurationData.AssistantBuilder.MinimumProviderConfidence = value)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantBuilder, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.META_ASSISTANT" Data="@this.AvailableLLMProviders" Disabled="@this.DefaultsDisabled" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedProvider)" SelectionUpdate="@(value => this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectedProvider = value)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantBuilder, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
</DialogContent>
<DialogActions>
<MudButton OnClick="@this.Close" Variant="Variant.Filled">@T("Close")</MudButton>
</DialogActions>
</MudDialog>
@@ -0,0 +1,6 @@
namespace AIStudio.Dialogs.Settings;
public partial class SettingsDialogAssistantBuilder : SettingsDialogBase
{
private bool DefaultsDisabled() => !this.SettingsManager.ConfigurationData.AssistantBuilder.PreselectOptions;
}