From 9f52c2ae673e78d387babcb1476a3045c3c0c50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peer=20Sch=C3=BCtt?= <20603780+peerschuett@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:58:52 +0100 Subject: [PATCH] SettingsPanel Enum removed, because it is no longer needed --- .../Components/Settings/SettingsPanel.cs | 20 ---------- .../SettingsPanelAgentContentCleaner.razor | 2 +- .../SettingsPanelAgentContentCleaner.razor.cs | 5 +-- ...ettingsPanelAgentDataSourceSelection.razor | 2 +- ...ingsPanelAgentDataSourceSelection.razor.cs | 5 +-- ...PanelAgentRetrievalContextValidation.razor | 2 +- ...elAgentRetrievalContextValidation.razor.cs | 5 +-- .../Settings/SettingsPanelApp.razor | 2 +- .../Settings/SettingsPanelApp.razor.cs | 2 - .../Components/Settings/SettingsPanelBase.cs | 7 ---- .../Settings/SettingsPanelChat.razor | 2 +- .../Settings/SettingsPanelChat.razor.cs | 5 +-- .../Settings/SettingsPanelDataSources.razor | 2 +- .../SettingsPanelDataSources.razor.cs | 2 - .../Settings/SettingsPanelEmbeddings.razor | 2 +- .../Settings/SettingsPanelEmbeddings.razor.cs | 2 - .../Settings/SettingsPanelProfiles.razor | 2 +- .../Settings/SettingsPanelProfiles.razor.cs | 2 - .../Settings/SettingsPanelProviders.razor | 2 +- .../Settings/SettingsPanelProviders.razor.cs | 2 - .../Settings/SettingsPanelWorkspaces.razor | 2 +- .../Settings/SettingsPanelWorkspaces.razor.cs | 5 +-- app/MindWork AI Studio/Pages/Settings.razor | 38 +++++++++---------- .../Pages/Settings.razor.cs | 13 ------- 24 files changed, 33 insertions(+), 100 deletions(-) delete mode 100644 app/MindWork AI Studio/Components/Settings/SettingsPanel.cs diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanel.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanel.cs deleted file mode 100644 index 61a80678..00000000 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanel.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace AIStudio.Components.Settings; - -public enum SettingsPanel -{ - NONE, - - // Pages - PROVIDER_PANEL, - EMBEDDINGS_PANEL, - DATA_SOURCES_PANEL, - PROFILES_PANEL, - APP_PANEL, - CHAT_PANEL, - WORKSPACE_PANEL, - - // Agents - AGENT_DATA_SOURCE_SELECTION_PANEL, - AGENT_RETRIEVAL_CONTEXT_VALIDATION_PANEL, - AGENT_CONTENT_CLEANER_PANEL, -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor index 1d18d307..8da6ff3e 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor @@ -1,6 +1,6 @@ @inherits SettingsPanelBase - + Use Case: this agent is used to clean up text content. It extracts the main content, removes advertisements and other irrelevant things, diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor.cs index 0b4837cc..e588f061 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentContentCleaner.razor.cs @@ -1,6 +1,3 @@ namespace AIStudio.Components.Settings; -public partial class SettingsPanelAgentContentCleaner : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.AGENT_CONTENT_CLEANER_PANEL; -} \ No newline at end of file +public partial class SettingsPanelAgentContentCleaner : SettingsPanelBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor index 7de3bad4..f3c1df20 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor @@ -1,6 +1,6 @@ @inherits SettingsPanelBase - + Use Case: this agent is used to select the appropriate data sources for the current prompt. diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor.cs index b7c0a04c..1c191a55 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentDataSourceSelection.razor.cs @@ -1,6 +1,3 @@ namespace AIStudio.Components.Settings; -public partial class SettingsPanelAgentDataSourceSelection : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.AGENT_DATA_SOURCE_SELECTION_PANEL; -} \ No newline at end of file +public partial class SettingsPanelAgentDataSourceSelection : SettingsPanelBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor index 00eb4311..7de4ea81 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor @@ -1,6 +1,6 @@ @inherits SettingsPanelBase - + Use Case: this agent is used to validate any retrieval context of any retrieval process. Perhaps there are many of these retrieval contexts and you want to validate them all. Therefore, you might want to use a cheap and fast LLM for this diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor.cs index f4cbee64..aaf0d938 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelAgentRetrievalContextValidation.razor.cs @@ -1,6 +1,3 @@ namespace AIStudio.Components.Settings; -public partial class SettingsPanelAgentRetrievalContextValidation : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.AGENT_RETRIEVAL_CONTEXT_VALIDATION_PANEL; -} \ No newline at end of file +public partial class SettingsPanelAgentRetrievalContextValidation : SettingsPanelBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor index 973520db..e67aaf5f 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor @@ -2,7 +2,7 @@ @using AIStudio.Settings.DataModel @inherits SettingsPanelBase - + diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs index b675bf24..f4b75bfe 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelApp.razor.cs @@ -9,6 +9,4 @@ public partial class SettingsPanelApp : SettingsPanelBase this.SettingsManager.ConfigurationData.App.PreviewVisibility = previewVisibility; this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = previewVisibility.FilterPreviewFeatures(this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures); } - - protected override SettingsPanel Type => SettingsPanel.APP_PANEL; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs index 117bd554..e8685314 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelBase.cs @@ -8,14 +8,9 @@ namespace AIStudio.Components.Settings; public abstract class SettingsPanelBase : ComponentBase { - [CascadingParameter] - public Pages.Settings Settings { get; set; } = null!; - [Parameter] public Func>> AvailableLLMProvidersFunc { get; set; } = () => []; - protected abstract SettingsPanel Type { get; } - [Inject] protected SettingsManager SettingsManager { get; init; } = null!; @@ -27,6 +22,4 @@ public abstract class SettingsPanelBase : ComponentBase [Inject] protected RustService RustService { get; init; } = null!; - - protected bool IsExtended() => this.Type == this.Settings.ChosenSettingsPanel; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor index 859e8549..8b274405 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor @@ -2,7 +2,7 @@ @using AIStudio.Settings.DataModel @inherits SettingsPanelBase - + diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor.cs index 0267b499..2650923e 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelChat.razor.cs @@ -1,6 +1,3 @@ namespace AIStudio.Components.Settings; -public partial class SettingsPanelChat : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.CHAT_PANEL; -} \ No newline at end of file +public partial class SettingsPanelChat : SettingsPanelBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor index df91a31c..506c63b9 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor @@ -3,7 +3,7 @@ @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) { - + Configured Data Sources diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs index aeed6a07..6f7e74b8 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelDataSources.razor.cs @@ -256,6 +256,4 @@ public partial class SettingsPanelDataSources : SettingsPanelBase await this.AvailableDataSourcesChanged.InvokeAsync(this.AvailableDataSources); } - - protected override SettingsPanel Type => SettingsPanel.DATA_SOURCES_PANEL; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor index e9fd3621..ea82ce7a 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor @@ -4,7 +4,7 @@ @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) { - + Configured Embeddings diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor.cs index c9a83aaf..7520e596 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelEmbeddings.razor.cs @@ -119,6 +119,4 @@ public partial class SettingsPanelEmbeddings : SettingsPanelBase await this.AvailableEmbeddingProvidersChanged.InvokeAsync(this.AvailableEmbeddingProviders); } - - protected override SettingsPanel Type => SettingsPanel.EMBEDDINGS_PANEL; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor index 21a27de2..924eb773 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor @@ -1,6 +1,6 @@ @inherits SettingsPanelBase - + Your Profiles Store personal data about yourself in various profiles so that the AIs know your personal context. diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor.cs index 8bb7ebab..15b3214d 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelProfiles.razor.cs @@ -69,6 +69,4 @@ public partial class SettingsPanelProfiles : SettingsPanelBase await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); } - - protected override SettingsPanel Type => SettingsPanel.PROFILES_PANEL; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor index 37793c96..cd1b4ffb 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor @@ -3,7 +3,7 @@ @using AIStudio.Provider.SelfHosted @inherits SettingsPanelBase - + Configured Providers What we call a provider is the combination of an LLM provider such as OpenAI and a model like GPT-4o. diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor.cs index a640fe73..0aa3afd0 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelProviders.razor.cs @@ -148,6 +148,4 @@ public partial class SettingsPanelProviders : SettingsPanelBase this.SettingsManager.ConfigurationData.LLMProviders.CustomConfidenceScheme[llmProvider] = level; await this.SettingsManager.StoreSettings(); } - - protected override SettingsPanel Type => SettingsPanel.PROVIDER_PANEL; } \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor index 84891ce8..b3042982 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor @@ -2,7 +2,7 @@ @using AIStudio.Settings.DataModel @inherits SettingsPanelBase - + @if (this.SettingsManager.ConfigurationData.Workspace.StorageBehavior is not WorkspaceStorageBehavior.DISABLE_WORKSPACES) diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor.cs index 9cb17d2d..881a7381 100644 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor.cs +++ b/app/MindWork AI Studio/Components/Settings/SettingsPanelWorkspaces.razor.cs @@ -1,6 +1,3 @@ namespace AIStudio.Components.Settings; -public partial class SettingsPanelWorkspaces : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.WORKSPACE_PANEL; -} \ No newline at end of file +public partial class SettingsPanelWorkspaces : SettingsPanelBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Settings.razor b/app/MindWork AI Studio/Pages/Settings.razor index 8cbc725d..3516096b 100644 --- a/app/MindWork AI Studio/Pages/Settings.razor +++ b/app/MindWork AI Studio/Pages/Settings.razor @@ -6,28 +6,26 @@ Settings - - - + + - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - - } - - - - + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) + { + + + } + + + + - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - - } + @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) + { + + + } - - - + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Settings.razor.cs b/app/MindWork AI Studio/Pages/Settings.razor.cs index 45bc4d2c..a23e3312 100644 --- a/app/MindWork AI Studio/Pages/Settings.razor.cs +++ b/app/MindWork AI Studio/Pages/Settings.razor.cs @@ -16,7 +16,6 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable private List> availableLLMProviders = new(); private List> availableEmbeddingProviders = new(); private List> availableDataSources = new(); - public SettingsPanel ChosenSettingsPanel { get; private set; } #region Overrides of ComponentBase @@ -26,18 +25,6 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable this.MessageBus.RegisterComponent(this); this.MessageBus.ApplyFilters(this, [], [ Event.CONFIGURATION_CHANGED ]); - this.ChosenSettingsPanel = MessageBus.INSTANCE.CheckDeferredMessages(Event.SWITCH_TO_SETTINGS_PANEL).FirstOrDefault(); - // var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SWITCH_TO_SETTINGS_PANEL).FirstOrDefault(); - //if (deferredContent != default) - //{ - //switch (deferredContent) - //{ - // case SettingsPanel -am besten nicht alle individuell - //} - - //} - //chosenSettingsPanel = deferredContent; - await base.OnInitializedAsync(); }