diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor b/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor deleted file mode 100644 index 94778e2e..00000000 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor +++ /dev/null @@ -1,19 +0,0 @@ -@using AIStudio.Settings -@inherits SettingsPanelBase - - - - - - - - - Most ERI server options can be customized and saved directly in the ERI server assistant. - For this, the ERI server assistant has an auto-save function. - - - - Switch to ERI server assistant - - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor.cs b/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor.cs deleted file mode 100644 index 74232e54..00000000 --- a/app/MindWork AI Studio/Components/Settings/SettingsPanelERIServer.razor.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AIStudio.Components.Settings; - -public partial class SettingsPanelERIServer : SettingsPanelBase -{ - protected override SettingsPanel Type => SettingsPanel.ASSISTANT_ERI_SERVER_PANEL; -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor deleted file mode 100644 index 3c12b1c3..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor +++ /dev/null @@ -1,20 +0,0 @@ -@inherits SettingsDialogBase - - - - Agent: Text Content Cleaner Options - - - - - Use Case: this agent is used to clean up text content. It extracts the main content, removes advertisements and other irrelevant things, - and attempts to convert relative links into absolute links so that they can be used. - - - - - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor.cs deleted file mode 100644 index e2d11084..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentContentCleaner.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogAgentContentCleaner : SettingsDialogBase -{ -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor deleted file mode 100644 index 9d62a33f..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor +++ /dev/null @@ -1,19 +0,0 @@ -@inherits SettingsDialogBase - - - - Assistant: Agent: Data Source Selection Options - - - - - Use Case: this agent is used to select the appropriate data sources for the current prompt. - - - - - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor.cs deleted file mode 100644 index 00c5c269..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentDataSourceSelection.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogAgentDataSourceSelection : SettingsDialogBase -{ -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor deleted file mode 100644 index 408b6523..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor +++ /dev/null @@ -1,28 +0,0 @@ -@inherits SettingsDialogBase - - - - - Agent: Retrieval Context Validation Options - - - - - 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 - job. When using a local or self-hosted LLM, look for a small (e.g. 3B) and fast model. - - - @if (this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation) - { - - - - - - } - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor.cs deleted file mode 100644 index c5aebc7f..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgentRetrievalContextValidation.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogAgentRetrievalContextValidation : SettingsDialogBase -{ -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor deleted file mode 100644 index 33b9f358..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor +++ /dev/null @@ -1,33 +0,0 @@ -@using AIStudio.Settings -@using AIStudio.Settings.DataModel -@inherits SettingsDialogBase - - - - App Options - - - - - - - - - - @if (this.SettingsManager.ConfigurationData.App.PreviewVisibility > PreviewVisibility.NONE) - { - var availablePreviewFeatures = ConfigurationSelectDataFactory.GetPreviewFeaturesData(this.SettingsManager).ToList(); - if (availablePreviewFeatures.Count > 0) - { - - } - } - - - - - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor.cs deleted file mode 100644 index 4b396e04..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogApp.razor.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AIStudio.Settings.DataModel; - -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogApp : SettingsDialogBase -{ - private void UpdatePreviewFeatures(PreviewVisibility previewVisibility) - { - this.SettingsManager.ConfigurationData.App.PreviewVisibility = previewVisibility; - this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures = previewVisibility.FilterPreviewFeatures(this.SettingsManager.ConfigurationData.App.EnabledPreviewFeatures); - } - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor deleted file mode 100644 index a619b38f..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor +++ /dev/null @@ -1,30 +0,0 @@ -@using AIStudio.Settings -@using AIStudio.Settings.DataModel -@inherits SettingsDialogBase - - - - Chat Options - - - - - - - - - - - - - - @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) - { - - - } - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor.cs deleted file mode 100644 index 5e0cc64a..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogChat : SettingsDialogBase -{ -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor deleted file mode 100644 index 13532844..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor +++ /dev/null @@ -1,69 +0,0 @@ -@using AIStudio.Settings.DataModel -@inherits SettingsDialogBase - -@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) -{ - - - Configure Data Sources - - - - - Configured Data Sources - - - You might configure different data sources. A data source can include one file, all files - in a directory, or data from your company. Later, you can incorporate these data sources - as needed when the AI requires this data to complete a certain task. - - - - - - - - - - - - # - Name - Type - Embedding - Actions - - - @context.Num - @context.Name - @context.Type.GetDisplayName() - @this.GetEmbeddingName(context) - - - - - Edit - - - Delete - - - - - - @if (this.SettingsManager.ConfigurationData.DataSources.Count == 0) - { - No data sources configured yet. - } - - - External Data (ERI-Server v1) - Local Directory - Local File - - - - Close - - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs deleted file mode 100644 index 12615766..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs +++ /dev/null @@ -1,260 +0,0 @@ -using AIStudio.Dialogs; -using AIStudio.Settings; -using AIStudio.Settings.DataModel; -using AIStudio.Tools.ERIClient.DataModel; - -using Microsoft.AspNetCore.Components; - -using DialogOptions = AIStudio.Dialogs.DialogOptions; - -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogDataSources : SettingsDialogBase -{ - [Parameter] - public List> AvailableDataSources { get; set; } = new(); - - [Parameter] - public EventCallback>> AvailableDataSourcesChanged { get; set; } - - [Parameter] - public Func>> AvailableEmbeddingsFunc { get; set; } = () => []; - - #region Overrides of ComponentBase - - protected override async Task OnInitializedAsync() - { - await this.UpdateDataSources(); - await base.OnInitializedAsync(); - } - - #endregion - - private string GetEmbeddingName(IDataSource dataSource) - { - if(dataSource is IInternalDataSource internalDataSource) - { - var matchedEmbedding = this.SettingsManager.ConfigurationData.EmbeddingProviders.FirstOrDefault(x => x.Id == internalDataSource.EmbeddingId); - if(matchedEmbedding == default) - return "No valid embedding"; - - return matchedEmbedding.Name; - } - - if(dataSource is IExternalDataSource) - return "External (ERI)"; - - return "Unknown"; - } - - private async Task AddDataSource(DataSourceType type) - { - IDataSource? addedDataSource = null; - switch (type) - { - case DataSourceType.LOCAL_FILE: - var localFileDialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - { x => x.AvailableEmbeddings, this.AvailableEmbeddingsFunc() } - }; - - var localFileDialogReference = await this.DialogService.ShowAsync("Add Local File as Data Source", localFileDialogParameters, DialogOptions.FULLSCREEN); - var localFileDialogResult = await localFileDialogReference.Result; - if (localFileDialogResult is null || localFileDialogResult.Canceled) - return; - - var localFile = (DataSourceLocalFile)localFileDialogResult.Data!; - localFile = localFile with { Num = this.SettingsManager.ConfigurationData.NextDataSourceNum++ }; - addedDataSource = localFile; - break; - - case DataSourceType.LOCAL_DIRECTORY: - var localDirectoryDialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - { x => x.AvailableEmbeddings, this.AvailableEmbeddingsFunc() } - }; - - var localDirectoryDialogReference = await this.DialogService.ShowAsync("Add Local Directory as Data Source", localDirectoryDialogParameters, DialogOptions.FULLSCREEN); - var localDirectoryDialogResult = await localDirectoryDialogReference.Result; - if (localDirectoryDialogResult is null || localDirectoryDialogResult.Canceled) - return; - - var localDirectory = (DataSourceLocalDirectory)localDirectoryDialogResult.Data!; - localDirectory = localDirectory with { Num = this.SettingsManager.ConfigurationData.NextDataSourceNum++ }; - addedDataSource = localDirectory; - break; - - case DataSourceType.ERI_V1: - var eriDialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - }; - - var eriDialogReference = await this.DialogService.ShowAsync("Add ERI v1 Data Source", eriDialogParameters, DialogOptions.FULLSCREEN); - var eriDialogResult = await eriDialogReference.Result; - if (eriDialogResult is null || eriDialogResult.Canceled) - return; - - var eriDataSource = (DataSourceERI_V1)eriDialogResult.Data!; - eriDataSource = eriDataSource with { Num = this.SettingsManager.ConfigurationData.NextDataSourceNum++ }; - addedDataSource = eriDataSource; - break; - } - - if(addedDataSource is null) - return; - - this.SettingsManager.ConfigurationData.DataSources.Add(addedDataSource); - await this.UpdateDataSources(); - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task EditDataSource(IDataSource dataSource) - { - IDataSource? editedDataSource = null; - switch (dataSource) - { - case DataSourceLocalFile localFile: - var localFileDialogParameters = new DialogParameters - { - { x => x.IsEditing, true }, - { x => x.DataSource, localFile }, - { x => x.AvailableEmbeddings, this.AvailableEmbeddingsFunc() } - }; - - var localFileDialogReference = await this.DialogService.ShowAsync("Edit Local File Data Source", localFileDialogParameters, DialogOptions.FULLSCREEN); - var localFileDialogResult = await localFileDialogReference.Result; - if (localFileDialogResult is null || localFileDialogResult.Canceled) - return; - - editedDataSource = (DataSourceLocalFile)localFileDialogResult.Data!; - break; - - case DataSourceLocalDirectory localDirectory: - var localDirectoryDialogParameters = new DialogParameters - { - { x => x.IsEditing, true }, - { x => x.DataSource, localDirectory }, - { x => x.AvailableEmbeddings, this.AvailableEmbeddingsFunc() } - }; - - var localDirectoryDialogReference = await this.DialogService.ShowAsync("Edit Local Directory Data Source", localDirectoryDialogParameters, DialogOptions.FULLSCREEN); - var localDirectoryDialogResult = await localDirectoryDialogReference.Result; - if (localDirectoryDialogResult is null || localDirectoryDialogResult.Canceled) - return; - - editedDataSource = (DataSourceLocalDirectory)localDirectoryDialogResult.Data!; - break; - - case DataSourceERI_V1 eriDataSource: - var eriDialogParameters = new DialogParameters - { - { x => x.IsEditing, true }, - { x => x.DataSource, eriDataSource }, - }; - - var eriDialogReference = await this.DialogService.ShowAsync("Edit ERI v1 Data Source", eriDialogParameters, DialogOptions.FULLSCREEN); - var eriDialogResult = await eriDialogReference.Result; - if (eriDialogResult is null || eriDialogResult.Canceled) - return; - - editedDataSource = (DataSourceERI_V1)eriDialogResult.Data!; - break; - } - - if(editedDataSource is null) - return; - - this.SettingsManager.ConfigurationData.DataSources[this.SettingsManager.ConfigurationData.DataSources.IndexOf(dataSource)] = editedDataSource; - - await this.UpdateDataSources(); - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task DeleteDataSource(IDataSource dataSource) - { - var dialogParameters = new DialogParameters - { - { "Message", $"Are you sure you want to delete the data source '{dataSource.Name}' of type {dataSource.Type.GetDisplayName()}?" }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Delete Data Source", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var applyChanges = dataSource is IInternalDataSource; - - // External data sources may need a secret for authentication: - if (dataSource is IExternalDataSource externalDataSource) - { - // When the auth method is NONE or KERBEROS, we don't need to delete a secret. - // In the case of KERBEROS, we don't store the Kerberos ticket in the secret store. - if(dataSource is IERIDataSource { AuthMethod: AuthMethod.NONE or AuthMethod.KERBEROS }) - applyChanges = true; - - // All other auth methods require a secret, which we need to delete now: - else - { - var deleteSecretResponse = await this.RustService.DeleteSecret(externalDataSource); - if (deleteSecretResponse.Success) - applyChanges = true; - } - } - - if(applyChanges) - { - this.SettingsManager.ConfigurationData.DataSources.Remove(dataSource); - await this.SettingsManager.StoreSettings(); - await this.UpdateDataSources(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - } - - private async Task ShowInformation(IDataSource dataSource) - { - switch (dataSource) - { - case DataSourceLocalFile localFile: - var localFileDialogParameters = new DialogParameters - { - { x => x.DataSource, localFile }, - }; - - await this.DialogService.ShowAsync("Local File Data Source Information", localFileDialogParameters, DialogOptions.FULLSCREEN); - break; - - case DataSourceLocalDirectory localDirectory: - var localDirectoryDialogParameters = new DialogParameters - { - { x => x.DataSource, localDirectory }, - }; - - await this.DialogService.ShowAsync("Local Directory Data Source Information", localDirectoryDialogParameters, DialogOptions.FULLSCREEN); - break; - - case DataSourceERI_V1 eriV1DataSource: - var eriV1DialogParameters = new DialogParameters - { - { x => x.DataSource, eriV1DataSource }, - }; - - await this.DialogService.ShowAsync("ERI v1 Data Source Information", eriV1DialogParameters, DialogOptions.FULLSCREEN); - break; - } - } - - private async Task UpdateDataSources() - { - this.AvailableDataSources.Clear(); - foreach (var dataSource in this.SettingsManager.ConfigurationData.DataSources) - this.AvailableDataSources.Add(new (dataSource.Name, dataSource.Id)); - - await this.AvailableDataSourcesChanged.InvokeAsync(this.AvailableDataSources); - } - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor deleted file mode 100644 index 51a41c6d..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor +++ /dev/null @@ -1,78 +0,0 @@ -@using AIStudio.Provider -@using AIStudio.Settings.DataModel -@inherits SettingsDialogBase - -@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager)) -{ - - - Configure Embeddings - - - - - Configured Embeddings - - - Embeddings are a way to represent words, sentences, entire documents, or even images and videos as digital - fingerprints. Just like each person has a unique fingerprint, embedding models create unique digital patterns - that capture the meaning and characteristics of the content they analyze. When two things are similar in meaning - or content, their digital fingerprints will look very similar. For example, the fingerprints for 'happy' and - 'joyful' would be more alike than those for 'happy' and 'sad'. - - - - This helps AI Studio understand and compare things in a way that's similar to how humans do. When you're working on - something, AI Studio can automatically identify related documents and data by comparing their digital fingerprints. - For instance, if you're writing about customer service, AI Studio can instantly find other documents in your data that - discuss similar topics or experiences, even if they use different words. - - - - - - - - - - - # - Name - Provider - Model - Actions - - - @context.Num - @context.Name - @context.UsedLLMProvider - @this.GetEmbeddingProviderModelName(context) - - - - Open Dashboard - - - Edit - - - Delete - - - - - - @if (this.SettingsManager.ConfigurationData.EmbeddingProviders.Count == 0) - { - No embeddings configured yet. - } - - - Add Embedding - - - - Close - - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor.cs deleted file mode 100644 index 05753559..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogEmbeddings.razor.cs +++ /dev/null @@ -1,122 +0,0 @@ -using AIStudio.Dialogs; -using AIStudio.Settings; - -using Microsoft.AspNetCore.Components; - -using DialogOptions = AIStudio.Dialogs.DialogOptions; - -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogEmbeddings : SettingsDialogBase -{ - [Parameter] - public List> AvailableEmbeddingProviders { get; set; } = new(); - - [Parameter] - public EventCallback>> AvailableEmbeddingProvidersChanged { get; set; } - - private string GetEmbeddingProviderModelName(EmbeddingProvider provider) - { - const int MAX_LENGTH = 36; - var modelName = provider.Model.ToString(); - return modelName.Length > MAX_LENGTH ? "[...] " + modelName[^Math.Min(MAX_LENGTH, modelName.Length)..] : modelName; - } - - #region Overrides of ComponentBase - - protected override async Task OnInitializedAsync() - { - await this.UpdateEmbeddingProviders(); - await base.OnInitializedAsync(); - } - - #endregion - - private async Task AddEmbeddingProvider() - { - var dialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Add Embedding Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var addedEmbedding = (EmbeddingProvider)dialogResult.Data!; - addedEmbedding = addedEmbedding with { Num = this.SettingsManager.ConfigurationData.NextEmbeddingNum++ }; - - this.SettingsManager.ConfigurationData.EmbeddingProviders.Add(addedEmbedding); - await this.UpdateEmbeddingProviders(); - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task EditEmbeddingProvider(EmbeddingProvider embeddingProvider) - { - var dialogParameters = new DialogParameters - { - { x => x.DataNum, embeddingProvider.Num }, - { x => x.DataId, embeddingProvider.Id }, - { x => x.DataName, embeddingProvider.Name }, - { x => x.DataLLMProvider, embeddingProvider.UsedLLMProvider }, - { x => x.DataModel, embeddingProvider.Model }, - { x => x.DataHostname, embeddingProvider.Hostname }, - { x => x.IsSelfHosted, embeddingProvider.IsSelfHosted }, - { x => x.IsEditing, true }, - { x => x.DataHost, embeddingProvider.Host }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Edit Embedding Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var editedEmbeddingProvider = (EmbeddingProvider)dialogResult.Data!; - - // Set the provider number if it's not set. This is important for providers - // added before we started saving the provider number. - if(editedEmbeddingProvider.Num == 0) - editedEmbeddingProvider = editedEmbeddingProvider with { Num = this.SettingsManager.ConfigurationData.NextEmbeddingNum++ }; - - this.SettingsManager.ConfigurationData.EmbeddingProviders[this.SettingsManager.ConfigurationData.EmbeddingProviders.IndexOf(embeddingProvider)] = editedEmbeddingProvider; - await this.UpdateEmbeddingProviders(); - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task DeleteEmbeddingProvider(EmbeddingProvider provider) - { - var dialogParameters = new DialogParameters - { - { "Message", $"Are you sure you want to delete the embedding provider '{provider.Name}'?" }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Delete Embedding Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var deleteSecretResponse = await this.RustService.DeleteAPIKey(provider); - if(deleteSecretResponse.Success) - { - this.SettingsManager.ConfigurationData.EmbeddingProviders.Remove(provider); - await this.SettingsManager.StoreSettings(); - } - - await this.UpdateEmbeddingProviders(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task UpdateEmbeddingProviders() - { - this.AvailableEmbeddingProviders.Clear(); - foreach (var provider in this.SettingsManager.ConfigurationData.EmbeddingProviders) - this.AvailableEmbeddingProviders.Add(new (provider.Name, provider.Id)); - - await this.AvailableEmbeddingProvidersChanged.InvokeAsync(this.AvailableEmbeddingProviders); - } -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor deleted file mode 100644 index 69543c92..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor +++ /dev/null @@ -1,59 +0,0 @@ -@inherits SettingsDialogBase - - - - - Configure Profiles - - - Your Profiles - - Store personal data about yourself in various profiles so that the AIs know your personal context. - This saves you from having to explain your context each time, for example, in every chat. When you - have different roles, you can create a profile for each role. - - - - Are you a project manager in a research facility? You might want to create a profile for your project - management activities, one for your scientific work, and a profile for when you need to write program - code. In these profiles, you can record how much experience you have or which methods you like or - dislike using. Later, you can choose when and where you want to use each profile. - - - - - - - - - # - Profile Name - Actions - - - @context.Num - @context.Name - - - Edit - - - Delete - - - - - - @if(this.SettingsManager.ConfigurationData.Profiles.Count == 0) - { - No profiles configured yet. - } - - - Add Profile - - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor.cs deleted file mode 100644 index f9116758..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProfiles.razor.cs +++ /dev/null @@ -1,73 +0,0 @@ -using AIStudio.Dialogs; -using AIStudio.Settings; - -using DialogOptions = AIStudio.Dialogs.DialogOptions; - -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogProfiles : SettingsDialogBase -{ - private async Task AddProfile() - { - var dialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Add Profile", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var addedProfile = (Profile)dialogResult.Data!; - addedProfile = addedProfile with { Num = this.SettingsManager.ConfigurationData.NextProfileNum++ }; - - this.SettingsManager.ConfigurationData.Profiles.Add(addedProfile); - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task EditProfile(Profile profile) - { - var dialogParameters = new DialogParameters - { - { x => x.DataNum, profile.Num }, - { x => x.DataId, profile.Id }, - { x => x.DataName, profile.Name }, - { x => x.DataNeedToKnow, profile.NeedToKnow }, - { x => x.DataActions, profile.Actions }, - { x => x.IsEditing, true }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Edit Profile", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var editedProfile = (Profile)dialogResult.Data!; - this.SettingsManager.ConfigurationData.Profiles[this.SettingsManager.ConfigurationData.Profiles.IndexOf(profile)] = editedProfile; - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private async Task DeleteProfile(Profile profile) - { - var dialogParameters = new DialogParameters - { - { "Message", $"Are you sure you want to delete the profile '{profile.Name}'?" }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Delete Profile", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - this.SettingsManager.ConfigurationData.Profiles.Remove(profile); - await this.SettingsManager.StoreSettings(); - - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor deleted file mode 100644 index aa414072..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor +++ /dev/null @@ -1,132 +0,0 @@ -@using AIStudio.Provider -@using AIStudio.Settings -@using AIStudio.Provider.SelfHosted -@inherits SettingsDialogBase - - - - Configure Providers - - - Configured Providers - - What we call a provider is the combination of an LLM provider such as OpenAI and a model like GPT-4o. - You can configure as many providers as you want. This way, you can use the appropriate model for each - task. As an LLM provider, you can also choose local providers. However, to use this app, you must - configure at least one provider. - - - - - - - - - - - # - Instance Name - Provider - Model - Actions - - - @context.Num - @context.InstanceName - @context.UsedLLMProvider - - @if (context.UsedLLMProvider is not LLMProviders.SELF_HOSTED) - { - @this.GetLLMProviderModelName(context) - } - else if (context.UsedLLMProvider is LLMProviders.SELF_HOSTED && context.Host is not Host.LLAMACPP) - { - @this.GetLLMProviderModelName(context) - } - else - { - @("as selected by provider") - } - - - - Open Dashboard - - - Edit - - - Delete - - - - - - @if(this.SettingsManager.ConfigurationData.Providers.Count == 0) - { - No providers configured yet. - } - - - Add Provider - - - LLM Provider Confidence - - Do you want to always be able to recognize how trustworthy your LLM providers are? This way, - you keep control over which provider you send your data to. You have two options for this: - Either you choose a common schema, or you configure the trust levels for each LLM provider yourself. - - - - @if(this.SettingsManager.ConfigurationData.LLMProviders.EnforceGlobalMinimumConfidence) - { - - } - - - @if (this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence) - { - - @if (this.SettingsManager.ConfigurationData.LLMProviders.ConfidenceScheme is ConfidenceSchemes.CUSTOM) - { - - - - - - - - LLM Provider - Description - Confidence Level - - - - @context.ToName() - - - - - - - @foreach (var confidenceLevel in Enum.GetValues().OrderBy(n => n)) - { - if(confidenceLevel is ConfidenceLevel.NONE or ConfidenceLevel.UNKNOWN) - continue; - - - @confidenceLevel.GetName() - - } - - - - - } - } - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor.cs deleted file mode 100644 index b000f571..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogProviders.razor.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -using AIStudio.Dialogs; -using AIStudio.Provider; -using AIStudio.Settings; - -using Microsoft.AspNetCore.Components; - -using DialogOptions = AIStudio.Dialogs.DialogOptions; - -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogProviders : SettingsDialogBase -{ - [Parameter] - public List> AvailableLLMProviders { get; set; } = new(); - - [Parameter] - public EventCallback>> AvailableLLMProvidersChanged { get; set; } - - #region Overrides of ComponentBase - - protected override async Task OnInitializedAsync() - { - await this.UpdateProviders(); - await base.OnInitializedAsync(); - } - - #endregion - - [SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")] - private async Task AddLLMProvider() - { - var dialogParameters = new DialogParameters - { - { x => x.IsEditing, false }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Add LLM Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var addedProvider = (AIStudio.Settings.Provider)dialogResult.Data!; - addedProvider = addedProvider with { Num = this.SettingsManager.ConfigurationData.NextProviderNum++ }; - - this.SettingsManager.ConfigurationData.Providers.Add(addedProvider); - await this.UpdateProviders(); - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - [SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")] - private async Task EditLLMProvider(AIStudio.Settings.Provider provider) - { - var dialogParameters = new DialogParameters - { - { x => x.DataNum, provider.Num }, - { x => x.DataId, provider.Id }, - { x => x.DataInstanceName, provider.InstanceName }, - { x => x.DataLLMProvider, provider.UsedLLMProvider }, - { x => x.DataModel, provider.Model }, - { x => x.DataHostname, provider.Hostname }, - { x => x.IsSelfHosted, provider.IsSelfHosted }, - { x => x.IsEditing, true }, - { x => x.DataHost, provider.Host }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Edit LLM Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var editedProvider = (AIStudio.Settings.Provider)dialogResult.Data!; - - // Set the provider number if it's not set. This is important for providers - // added before we started saving the provider number. - if(editedProvider.Num == 0) - editedProvider = editedProvider with { Num = this.SettingsManager.ConfigurationData.NextProviderNum++ }; - - this.SettingsManager.ConfigurationData.Providers[this.SettingsManager.ConfigurationData.Providers.IndexOf(provider)] = editedProvider; - await this.UpdateProviders(); - - await this.SettingsManager.StoreSettings(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - [SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")] - private async Task DeleteLLMProvider(AIStudio.Settings.Provider provider) - { - var dialogParameters = new DialogParameters - { - { "Message", $"Are you sure you want to delete the provider '{provider.InstanceName}'?" }, - }; - - var dialogReference = await this.DialogService.ShowAsync("Delete LLM Provider", dialogParameters, DialogOptions.FULLSCREEN); - var dialogResult = await dialogReference.Result; - if (dialogResult is null || dialogResult.Canceled) - return; - - var deleteSecretResponse = await this.RustService.DeleteAPIKey(provider); - if(deleteSecretResponse.Success) - { - this.SettingsManager.ConfigurationData.Providers.Remove(provider); - await this.SettingsManager.StoreSettings(); - } - - await this.UpdateProviders(); - await this.MessageBus.SendMessage(this, Event.CONFIGURATION_CHANGED); - } - - private string GetLLMProviderModelName(AIStudio.Settings.Provider provider) - { - const int MAX_LENGTH = 36; - var modelName = provider.Model.ToString(); - return modelName.Length > MAX_LENGTH ? "[...] " + modelName[^Math.Min(MAX_LENGTH, modelName.Length)..] : modelName; - } - - [SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")] - private async Task UpdateProviders() - { - this.AvailableLLMProviders.Clear(); - foreach (var provider in this.SettingsManager.ConfigurationData.Providers) - this.AvailableLLMProviders.Add(new (provider.InstanceName, provider.Id)); - - await this.AvailableLLMProvidersChanged.InvokeAsync(this.AvailableLLMProviders); - } - - private string GetCurrentConfidenceLevelName(LLMProviders llmProvider) - { - if (this.SettingsManager.ConfigurationData.LLMProviders.CustomConfidenceScheme.TryGetValue(llmProvider, out var level)) - return level.GetName(); - - return "Not yet configured"; - } - - private string SetCurrentConfidenceLevelColorStyle(LLMProviders llmProvider) - { - if (this.SettingsManager.ConfigurationData.LLMProviders.CustomConfidenceScheme.TryGetValue(llmProvider, out var level)) - return $"background-color: {level.GetColor(this.SettingsManager)};"; - - return $"background-color: {ConfidenceLevel.UNKNOWN.GetColor(this.SettingsManager)};"; - } - - private async Task ChangeCustomConfidenceLevel(LLMProviders llmProvider, ConfidenceLevel level) - { - this.SettingsManager.ConfigurationData.LLMProviders.CustomConfidenceScheme[llmProvider] = level; - await this.SettingsManager.StoreSettings(); - } - -} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor deleted file mode 100644 index c6f4e8ab..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor +++ /dev/null @@ -1,21 +0,0 @@ -@using AIStudio.Settings -@using AIStudio.Settings.DataModel -@inherits SettingsDialogBase - - - - Workspace Options - - - - - @if (this.SettingsManager.ConfigurationData.Workspace.StorageBehavior is not WorkspaceStorageBehavior.DISABLE_WORKSPACES) - { - - - } - - - Close - - \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor.cs deleted file mode 100644 index 7954d8cf..00000000 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWorkspaces.razor.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace AIStudio.Dialogs.Settings; - -public partial class SettingsDialogWorkspaces : SettingsDialogBase -{ -} \ No newline at end of file