diff --git a/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor b/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor index 8056467cd..6a6200492 100644 --- a/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor +++ b/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor @@ -52,4 +52,4 @@ } - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor.cs b/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor.cs index 6f6261f1c..c6513cc2b 100644 --- a/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor.cs +++ b/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor.cs @@ -323,8 +323,8 @@ private void OnContentChanged(string content) private async Task CreateAgenda() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor b/app/MindWork AI Studio/Assistants/AssistantBase.razor index f03363deb..59c9f7a24 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor @@ -24,7 +24,7 @@ - + @this.Description @@ -41,7 +41,7 @@ @this.SubmitText - @if (this.isProcessing && this.cancellationTokenSource is not null) + @if (this.isProcessing && this.CancellationTokenSource is not null) { @@ -68,9 +68,9 @@ } - @if(this.ShowResult && this.ShowEntireChatThread && this.chatThread is not null) + @if(this.ShowResult && this.ShowEntireChatThread && this.ChatThread is not null) { - foreach (var block in this.chatThread.Blocks.OrderBy(n => n.Time)) + foreach (var block in this.ChatThread.Blocks.OrderBy(n => n.Time)) { @if (block is { HideFromUser: false, Content: not null }) { @@ -155,12 +155,12 @@ @if (this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence) { - + } @if (this.AllowProfiles && this.ShowProfileSelection) { - + } diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs index 332e25baf..d9b553dd8 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs @@ -111,14 +111,14 @@ protected virtual string? SendToChatVisibleUserPromptText protected virtual bool HasSettingsPanel => typeof(TSettings) != typeof(NoSettingsPanel); - protected AIStudio.Settings.Provider providerSettings = Settings.Provider.NONE; - protected MudForm? form; - protected bool inputIsValid; - protected Profile currentProfile = Profile.NO_PROFILE; - protected ChatTemplate currentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE; - protected ChatThread? chatThread; - protected IContent? lastUserPrompt; - protected CancellationTokenSource? cancellationTokenSource; + protected AIStudio.Settings.Provider ProviderSettings = Settings.Provider.NONE; + protected MudForm? Form; + protected bool InputIsValid; + protected Profile CurrentProfile = Profile.NO_PROFILE; + protected ChatTemplate CurrentChatTemplate = ChatTemplate.NO_CHAT_TEMPLATE; + protected ChatThread? ChatThread; + protected IContent? LastUserPrompt; + protected CancellationTokenSource? CancellationTokenSource; private readonly Timer formChangeTimer = new(TimeSpan.FromSeconds(1.6)); @@ -147,9 +147,9 @@ protected override async Task OnInitializedAsync() }; this.MightPreselectValues(); - this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component); - this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component); - this.currentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component); + this.ProviderSettings = this.SettingsManager.GetPreselectedProvider(this.Component); + this.CurrentProfile = this.SettingsManager.GetPreselectedProfile(this.Component); + this.CurrentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component); } protected override async Task OnParametersSetAsync() @@ -165,7 +165,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) // Reset the validation when not editing and on the first render. // We don't want to show validation errors when the user opens the dialog. if(firstRender) - this.form?.ResetValidation(); + this.Form?.ResetValidation(); await base.OnAfterRenderAsync(firstRender); } @@ -174,7 +174,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) private string TB(string fallbackEN) => this.T(fallbackEN, typeof(AssistantBase).Namespace, nameof(AssistantBase)); - private string SubmitButtonStyle => this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence ? this.providerSettings.UsedLLMProvider.GetConfidence(this.SettingsManager).StyleBorder(this.SettingsManager) : string.Empty; + private string SubmitButtonStyle => this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence ? this.ProviderSettings.UsedLLMProvider.GetConfidence(this.SettingsManager).StyleBorder(this.SettingsManager) : string.Empty; private IReadOnlyList VisibleSendToAssistants => Enum.GetValues() .Where(this.CanSendToAssistant) @@ -191,12 +191,12 @@ protected override async Task OnAfterRenderAsync(bool firstRender) private async Task Start() { - using (this.cancellationTokenSource = new()) + using (this.CancellationTokenSource = new()) { await this.SubmitAction(); } - this.cancellationTokenSource = null; + this.CancellationTokenSource = null; } private void TriggerFormChange(FormFieldChangedEventArgs _) @@ -223,7 +223,7 @@ protected void AddInputIssue(string issue) { Array.Resize(ref this.inputIssues, this.inputIssues.Length + 1); this.inputIssues[^1] = issue; - this.inputIsValid = false; + this.InputIsValid = false; this.StateHasChanged(); } @@ -233,17 +233,17 @@ protected void AddInputIssue(string issue) protected void ClearInputIssues() { this.inputIssues = []; - this.inputIsValid = true; + this.InputIsValid = true; this.StateHasChanged(); } protected void CreateChatThread() { - this.chatThread = new() + this.ChatThread = new() { IncludeDateTime = false, - SelectedProvider = this.providerSettings.Id, - SelectedProfile = this.AllowProfiles ? this.currentProfile.Id : Profile.NO_PROFILE.Id, + SelectedProvider = this.ProviderSettings.Id, + SelectedProfile = this.AllowProfiles ? this.CurrentProfile.Id : Profile.NO_PROFILE.Id, SystemPrompt = this.SystemPrompt, WorkspaceId = Guid.Empty, ChatId = Guid.NewGuid(), @@ -255,11 +255,11 @@ protected void CreateChatThread() protected Guid CreateChatThread(Guid workspaceId, string name) { var chatId = Guid.NewGuid(); - this.chatThread = new() + this.ChatThread = new() { IncludeDateTime = false, - SelectedProvider = this.providerSettings.Id, - SelectedProfile = this.AllowProfiles ? this.currentProfile.Id : Profile.NO_PROFILE.Id, + SelectedProvider = this.ProviderSettings.Id, + SelectedProfile = this.AllowProfiles ? this.CurrentProfile.Id : Profile.NO_PROFILE.Id, SystemPrompt = this.SystemPrompt, WorkspaceId = workspaceId, ChatId = chatId, @@ -272,27 +272,27 @@ protected Guid CreateChatThread(Guid workspaceId, string name) protected virtual void ResetProviderAndProfileSelection() { - this.providerSettings = this.SettingsManager.GetPreselectedProvider(this.Component); - this.currentProfile = this.SettingsManager.GetPreselectedProfile(this.Component); - this.currentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component); + this.ProviderSettings = this.SettingsManager.GetPreselectedProvider(this.Component); + this.CurrentProfile = this.SettingsManager.GetPreselectedProfile(this.Component); + this.CurrentChatTemplate = this.SettingsManager.GetPreselectedChatTemplate(this.Component); } protected DateTimeOffset AddUserRequest(string request, bool hideContentFromUser = false, params List attachments) { var time = DateTimeOffset.Now; - this.lastUserPrompt = new ContentText + this.LastUserPrompt = new ContentText { Text = request, FileAttachments = attachments, }; - this.chatThread!.Blocks.Add(new ContentBlock + this.ChatThread!.Blocks.Add(new ContentBlock { Time = time, ContentType = ContentType.TEXT, HideFromUser = hideContentFromUser, Role = ChatRole.USER, - Content = this.lastUserPrompt, + Content = this.LastUserPrompt, }); return time; @@ -300,8 +300,8 @@ protected DateTimeOffset AddUserRequest(string request, bool hideContentFromUser protected async Task AddAIResponseAsync(DateTimeOffset time, bool hideContentFromUser = false) { - var manageCancellationLocally = this.cancellationTokenSource is null; - this.cancellationTokenSource ??= new CancellationTokenSource(); + var manageCancellationLocally = this.CancellationTokenSource is null; + this.CancellationTokenSource ??= new CancellationTokenSource(); var aiText = new ContentText { @@ -319,10 +319,10 @@ protected async Task AddAIResponseAsync(DateTimeOffset time, bool hideCo HideFromUser = hideContentFromUser, }; - if (this.chatThread is not null) + if (this.ChatThread is not null) { - this.chatThread.Blocks.Add(this.resultingContentBlock); - this.chatThread.SelectedProvider = this.providerSettings.Id; + this.ChatThread.Blocks.Add(this.resultingContentBlock); + this.ChatThread.SelectedProvider = this.ProviderSettings.Id; } this.isProcessing = true; @@ -331,15 +331,15 @@ protected async Task AddAIResponseAsync(DateTimeOffset time, bool hideCo // Use the selected provider to get the AI response. // By awaiting this line, we wait for the entire // content to be streamed. - this.chatThread = await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(), this.providerSettings.Model, this.lastUserPrompt, this.chatThread, this.cancellationTokenSource!.Token); + this.ChatThread = await aiText.CreateFromProviderAsync(this.ProviderSettings.CreateProvider(), this.ProviderSettings.Model, this.LastUserPrompt, this.ChatThread, this.CancellationTokenSource!.Token); this.isProcessing = false; this.StateHasChanged(); if(manageCancellationLocally) { - this.cancellationTokenSource.Dispose(); - this.cancellationTokenSource = null; + this.CancellationTokenSource.Dispose(); + this.CancellationTokenSource = null; } // Return the AI response: @@ -348,9 +348,9 @@ protected async Task AddAIResponseAsync(DateTimeOffset time, bool hideCo private async Task CancelStreaming() { - if (this.cancellationTokenSource is not null) - if(!this.cancellationTokenSource.IsCancellationRequested) - await this.cancellationTokenSource.CancelAsync(); + if (this.CancellationTokenSource is not null) + if(!this.CancellationTokenSource.IsCancellationRequested) + await this.CancellationTokenSource.CancelAsync(); } protected async Task CopyToClipboard() @@ -360,7 +360,7 @@ protected async Task CopyToClipboard() private ChatThread CreateSendToChatThread() { - var originalChatThread = this.chatThread ?? new ChatThread(); + var originalChatThread = this.ChatThread ?? new ChatThread(); if (string.IsNullOrWhiteSpace(this.SendToChatVisibleUserPromptText)) return originalChatThread with { @@ -440,7 +440,7 @@ protected Task SendToAssistant(Tools.Components destination, SendToButton sendTo else { var convertedChatThread = this.ConvertToChatThread; - convertedChatThread = convertedChatThread with { SelectedProvider = this.providerSettings.Id }; + convertedChatThread = convertedChatThread with { SelectedProvider = this.ProviderSettings.Id }; MessageBus.INSTANCE.DeferMessage(this, sendToData.Event, convertedChatThread); } break; @@ -465,7 +465,7 @@ private bool CanSendToAssistant(Tools.Components component) private async Task InnerResetForm() { this.resultingContentBlock = null; - this.providerSettings = Settings.Provider.NONE; + this.ProviderSettings = Settings.Provider.NONE; await this.JsRuntime.ClearDiv(RESULT_DIV_ID); await this.JsRuntime.ClearDiv(AFTER_RESULT_DIV_ID); @@ -473,12 +473,12 @@ private async Task InnerResetForm() this.ResetForm(); this.ResetProviderAndProfileSelection(); - this.inputIsValid = false; + this.InputIsValid = false; this.inputIssues = []; - this.form?.ResetValidation(); + this.Form?.ResetValidation(); this.StateHasChanged(); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); } private string GetResetColor() => this.SettingsManager.IsDarkMode switch diff --git a/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor b/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor index c95f6f3af..8f582ebe3 100644 --- a/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor +++ b/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor @@ -11,4 +11,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor.cs b/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor.cs index bf28b7c41..d1930b8e7 100644 --- a/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/BiasDay/BiasOfTheDayAssistant.razor.cs @@ -131,8 +131,8 @@ private async Task TellBias() } } - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.biasOfTheDay = useDrawnBias ? diff --git a/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor b/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor index 416f0ed85..7c6a56bf9 100644 --- a/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor +++ b/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor @@ -24,4 +24,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor.cs b/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor.cs index b96be9503..5e8a37531 100644 --- a/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor.cs +++ b/app/MindWork AI Studio/Assistants/Coding/AssistantCoding.razor.cs @@ -108,7 +108,7 @@ private ValueTask DeleteContext(int index) return ValueTask.CompletedTask; this.codingContexts.RemoveAt(index); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); this.StateHasChanged(); return ValueTask.CompletedTask; @@ -116,8 +116,8 @@ private ValueTask DeleteContext(int index) private async Task GetSupport() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; var sbContext = new StringBuilder(); diff --git a/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor b/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor index 4e7a38eee..89f8e04ce 100644 --- a/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor +++ b/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor @@ -74,7 +74,7 @@ else @T("Documents for the analysis") - + } else @@ -164,10 +164,10 @@ else @T("Documents for the analysis") - + } - + diff --git a/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor.cs b/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor.cs index 419d4c9e6..77522cd8d 100644 --- a/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/DocumentAnalysis/DocumentAnalysisAssistant.razor.cs @@ -125,7 +125,7 @@ protected override ChatThread ConvertToChatThread { get { - if (this.chatThread is null || this.chatThread.Blocks.Count < 2) + if (this.ChatThread is null || this.ChatThread.Blocks.Count < 2) { return new ChatThread { @@ -144,7 +144,7 @@ protected override ChatThread ConvertToChatThread // that includes the loaded document paths and a standard message about the previous analysis session: new ContentBlock { - Time = this.chatThread.Blocks.First().Time, + Time = this.ChatThread.Blocks.First().Time, Role = ChatRole.USER, HideFromUser = false, ContentType = ContentType.TEXT, @@ -157,7 +157,7 @@ protected override ChatThread ConvertToChatThread // Then, append the last block of the current chat thread // (which is expected to be the AI response): - this.chatThread.Blocks.Last(), + this.ChatThread.Blocks.Last(), ] }; } @@ -289,7 +289,7 @@ private void SelectedPolicyChanged(DataDocumentAnalysisPolicy? policy) this.policyDefinitionExpanded = !this.selectedPolicy?.IsProtected ?? true; this.ApplyPolicyPreselection(preferPolicyPreselection: true); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); this.ClearInputIssues(); } @@ -345,7 +345,7 @@ private async Task RemovePolicy() this.ResetForm(); await this.SettingsManager.StoreSettings(); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); } /// @@ -408,10 +408,10 @@ private void ApplyPolicyPreselection(bool preferPolicyPreselection = false) if (!preferPolicyPreselection) { // Keep the current provider if it still satisfies the minimum confidence: - if (this.providerSettings != Settings.Provider.NONE && - this.providerSettings.UsedLLMProvider.GetConfidence(this.SettingsManager).Level >= minimumLevel) + if (this.ProviderSettings != Settings.Provider.NONE && + this.ProviderSettings.UsedLLMProvider.GetConfidence(this.SettingsManager).Level >= minimumLevel) { - this.currentProfile = this.ResolveProfileSelection(); + this.CurrentProfile = this.ResolveProfileSelection(); return; } } @@ -420,18 +420,18 @@ private void ApplyPolicyPreselection(bool preferPolicyPreselection = false) var policyProvider = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.selectedPolicy.PreselectedProvider); if (policyProvider is not null && policyProvider.UsedLLMProvider.GetConfidence(this.SettingsManager).Level >= minimumLevel) { - this.providerSettings = policyProvider; - this.currentProfile = this.ResolveProfileSelection(); + this.ProviderSettings = policyProvider; + this.CurrentProfile = this.ResolveProfileSelection(); return; } - var fallbackProvider = this.SettingsManager.GetPreselectedProvider(this.Component, this.providerSettings.Id); + var fallbackProvider = this.SettingsManager.GetPreselectedProvider(this.Component, this.ProviderSettings.Id); if (fallbackProvider != Settings.Provider.NONE && fallbackProvider.UsedLLMProvider.GetConfidence(this.SettingsManager).Level < minimumLevel) fallbackProvider = Settings.Provider.NONE; - this.providerSettings = fallbackProvider; - this.currentProfile = this.ResolveProfileSelection(); + this.ProviderSettings = fallbackProvider; + this.CurrentProfile = this.ResolveProfileSelection(); } private ConfidenceLevel GetPolicyMinimumConfidenceLevel() @@ -482,7 +482,7 @@ private void PolicyPreselectedProviderWasChanged(string providerId) this.policyPreselectedProviderId = providerId; this.selectedPolicy.PreselectedProvider = providerId; - this.providerSettings = Settings.Provider.NONE; + this.ProviderSettings = Settings.Provider.NONE; this.ApplyPolicyPreselection(); } @@ -492,7 +492,7 @@ private async Task PolicyPreselectedProfileWasChangedAsync(ProfilePreselection s if (this.selectedPolicy is not null) this.selectedPolicy.PreselectedProfile = this.policyPreselectedProfile; - this.currentProfile = this.ResolveProfileSelection(); + this.CurrentProfile = this.ResolveProfileSelection(); await this.AutoSave(); } @@ -557,7 +557,7 @@ private void HandlePluginsReloaded() this.ApplyPolicyPreselection(preferPolicyPreselection: true); // Reset validation state: - this.form?.ResetValidation(); + this.Form?.ResetValidation(); this.ClearInputIssues(); } @@ -700,12 +700,12 @@ answer accordingly. private async Task Analyze() { await this.AutoSave(); - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); - this.chatThread!.IncludeDateTime = true; + this.ChatThread!.IncludeDateTime = true; var userRequest = this.AddUserRequest( await this.PromptLoadDocumentsContent(), @@ -724,8 +724,8 @@ private async Task ExportPolicyAsConfiguration() } await this.AutoSave(); - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) { await this.MessageBus.SendError(new (Icons.Material.Filled.Policy, this.T("The selected policy contains invalid data. Please fix the issues before exporting the policy."))); return; diff --git a/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor b/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor index a4fd1bd5c..5b3066ef5 100644 --- a/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor +++ b/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor @@ -120,7 +120,7 @@ else var webState = this.assistantState.WebContent[webContent.Name];
@@ -349,7 +349,7 @@ else if (component is AssistantProviderSelection providerSelection) {
- +
} break; @@ -359,7 +359,7 @@ else { var selection = profileSelection;
- +
} break; diff --git a/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor.cs b/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor.cs index 7703ff97d..7b3b3d696 100644 --- a/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor.cs +++ b/app/MindWork AI Studio/Assistants/Dynamic/AssistantDynamic.razor.cs @@ -165,7 +165,7 @@ private async Task CollectUserPromptAsync() if (this.assistantPlugin?.HasCustomPromptBuilder != true) return this.CollectUserPromptFallback(); var input = this.BuildPromptInput(); - var prompt = await this.assistantPlugin.TryBuildPromptAsync(input, this.cancellationTokenSource?.Token ?? CancellationToken.None); + var prompt = await this.assistantPlugin.TryBuildPromptAsync(input, this.CancellationTokenSource?.Token ?? CancellationToken.None); return !string.IsNullOrWhiteSpace(prompt) ? prompt : this.CollectUserPromptFallback(); } @@ -178,10 +178,10 @@ private LuaTable BuildPromptInput() var profile = new LuaTable { - ["Name"] = this.currentProfile.Name, - ["NeedToKnow"] = this.currentProfile.NeedToKnow, - ["Actions"] = this.currentProfile.Actions, - ["Num"] = this.currentProfile.Num, + ["Name"] = this.CurrentProfile.Name, + ["NeedToKnow"] = this.CurrentProfile.NeedToKnow, + ["Actions"] = this.CurrentProfile.Actions, + ["Num"] = this.CurrentProfile.Num, }; state["profile"] = profile; @@ -233,7 +233,7 @@ private async Task ExecuteButtonActionAsync(AssistantButton button) try { var input = this.BuildPromptInput(); - var cancellationToken = this.cancellationTokenSource?.Token ?? CancellationToken.None; + var cancellationToken = this.CancellationTokenSource?.Token ?? CancellationToken.None; var result = await this.assistantPlugin.TryInvokeButtonActionAsync(button, input, cancellationToken); if (result is not null) this.ApplyActionResult(result, AssistantComponentType.BUTTON); @@ -264,7 +264,7 @@ private async Task ExecuteSwitchChangedAsync(AssistantSwitch switchComponent, bo try { var input = this.BuildPromptInput(); - var cancellationToken = this.cancellationTokenSource?.Token ?? CancellationToken.None; + var cancellationToken = this.CancellationTokenSource?.Token ?? CancellationToken.None; var result = await this.assistantPlugin.TryInvokeSwitchChangedAsync(switchComponent, input, cancellationToken); if (result is not null) this.ApplyActionResult(result, AssistantComponentType.SWITCH); diff --git a/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor b/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor index 2f8783b35..620b7c95f 100644 --- a/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor +++ b/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor @@ -22,4 +22,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor.cs b/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor.cs index a2ec29de1..4c1e11589 100644 --- a/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor.cs +++ b/app/MindWork AI Studio/Assistants/EMail/AssistantEMail.razor.cs @@ -224,8 +224,8 @@ private string PromptHistory() private async Task CreateMail() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor index a533f568d..9f19942d7 100644 --- a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor +++ b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor @@ -330,7 +330,7 @@ else @T("Important:") @T("The LLM may need to generate many files. This reaches the request limit of most providers. Typically, only a certain number of requests can be made per minute, and only a maximum number of tokens can be generated per minute. AI Studio automatically considers this.") @T("However, generating all the files takes a certain amount of time.") @T("Local or self-hosted models may work without these limitations and can generate responses faster. AI Studio dynamically adapts its behavior and always tries to achieve the fastest possible data processing.") - + @T("Write code to file system") diff --git a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs index d8866cfea..a4c204c9d 100644 --- a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs +++ b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs @@ -303,7 +303,7 @@ create a separate code block with its file path and name as chapter title. protected override bool SubmitDisabled => this.IsNoneERIServerSelected; - protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with + protected override ChatThread ConvertToChatThread => (this.ChatThread ?? new()) with { SystemPrompt = this.SystemPrompt, }; @@ -400,7 +400,7 @@ private async Task AutoSave() if(this.selectedERIServer is null) return; - this.SettingsManager.ConfigurationData.ERI.PreselectedProvider = this.providerSettings.Id; + this.SettingsManager.ConfigurationData.ERI.PreselectedProvider = this.ProviderSettings.Id; this.selectedERIServer.ServerName = this.serverName; this.selectedERIServer.ServerDescription = this.serverDescription; this.selectedERIServer.ERIVersion = this.selectedERIVersion; @@ -488,7 +488,7 @@ private async Task RemoveERIServer() this.ResetForm(); await this.SettingsManager.StoreSettings(); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); } private bool IsNoneERIServerSelected => this.selectedERIServer is null; @@ -940,8 +940,8 @@ private async Task GenerateServer() return; await this.AutoSave(); - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; if(this.retrievalProcesses.Count == 0) diff --git a/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor b/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor index f783f657f..5d1167975 100644 --- a/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor +++ b/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor @@ -3,4 +3,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor.cs b/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor.cs index b8dbbe120..9f90a0fab 100644 --- a/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor.cs +++ b/app/MindWork AI Studio/Assistants/GrammarSpelling/AssistantGrammarSpelling.razor.cs @@ -119,8 +119,8 @@ private string SystemPromptLanguage() private async Task ProofreadText() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor index 58cff2f66..2aa1e5479 100644 --- a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor +++ b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor @@ -85,7 +85,7 @@ else if (!this.isLoading && string.IsNullOrWhiteSpace(this.loadingIssue)) } else { - + } @if (this.localizedContent.Count > 0) diff --git a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs index d229eb9b6..cc69e7964 100644 --- a/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs +++ b/app/MindWork AI Studio/Assistants/I18N/AssistantI18N.razor.cs @@ -269,8 +269,8 @@ private bool FilterFunc(KeyValuePair element) private async Task LocalizeTextContent() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; if(this.selectedLanguagePlugin is null) @@ -291,7 +291,7 @@ private async Task LocalizeTextContent() this.localizedContent = this.addedContent.ToDictionary(); } - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) return; // @@ -302,7 +302,7 @@ private async Task LocalizeTextContent() // foreach (var keyValuePair in this.selectedLanguagePlugin.Content) { - if (this.cancellationTokenSource!.IsCancellationRequested) + if (this.CancellationTokenSource!.IsCancellationRequested) break; if (this.localizedContent.ContainsKey(keyValuePair.Key)) @@ -314,7 +314,7 @@ private async Task LocalizeTextContent() this.localizedContent.Add(keyValuePair.Key, keyValuePair.Value); } - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) return; // @@ -324,7 +324,7 @@ private async Task LocalizeTextContent() var commentContent = new Dictionary(this.addedContent); foreach (var keyValuePair in PluginFactory.BaseLanguage.Content) { - if (this.cancellationTokenSource!.IsCancellationRequested) + if (this.CancellationTokenSource!.IsCancellationRequested) break; if (this.removedContent.ContainsKey(keyValuePair.Key)) @@ -342,7 +342,7 @@ private async Task Phase1TranslateAddedContent() var minimumTime = TimeSpan.FromMilliseconds(500); foreach (var keyValuePair in this.addedContent) { - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) break; // @@ -360,7 +360,7 @@ private async Task Phase1TranslateAddedContent() var time = this.AddUserRequest(keyValuePair.Value); this.localizedContent.Add(keyValuePair.Key, await this.AddAIResponseAsync(time)); - if (this.cancellationTokenSource!.IsCancellationRequested) + if (this.CancellationTokenSource!.IsCancellationRequested) break; // @@ -375,7 +375,7 @@ private async Task Phase1TranslateAddedContent() private void Phase2CreateLuaCode(IReadOnlyDictionary commentContent) { this.finalLuaCode.Clear(); - LuaTable.Create(ref this.finalLuaCode, "UI_TEXT_CONTENT", this.localizedContent, commentContent, this.cancellationTokenSource!.Token); + LuaTable.Create(ref this.finalLuaCode, "UI_TEXT_CONTENT", this.localizedContent, commentContent, this.CancellationTokenSource!.Token); // Next, we must remove the `root::` prefix from the keys: this.finalLuaCode.Replace("""UI_TEXT_CONTENT["root::""", """ diff --git a/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor b/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor index 278c8bb8f..84dbf735e 100644 --- a/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor +++ b/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor @@ -19,4 +19,4 @@ } - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor.cs b/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor.cs index ca86cb694..b6a3e5ad9 100644 --- a/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor.cs +++ b/app/MindWork AI Studio/Assistants/IconFinder/AssistantIconFinder.razor.cs @@ -80,8 +80,8 @@ protected override async Task OnInitializedAsync() private async Task FindIcon() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor b/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor index d3589b2df..d3499d3a0 100644 --- a/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor +++ b/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor @@ -12,4 +12,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor.cs b/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor.cs index c13d05e68..9d44eae78 100644 --- a/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor.cs +++ b/app/MindWork AI Studio/Assistants/JobPosting/AssistantJobPostings.razor.cs @@ -287,8 +287,8 @@ private string UserPromptCountryLegalFramework() private async Task CreateJobPosting() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor b/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor index 5c27a42ac..b6f978a4c 100644 --- a/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor +++ b/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor @@ -3,10 +3,10 @@ @if (!this.SettingsManager.ConfigurationData.LegalCheck.HideWebContentReader) { - + } - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor.cs b/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor.cs index e2120e6b1..a7c01bca5 100644 --- a/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor.cs +++ b/app/MindWork AI Studio/Assistants/LegalCheck/AssistantLegalCheck.razor.cs @@ -91,8 +91,8 @@ protected override async Task OnInitializedAsync() private async Task AksQuestions() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor b/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor index 92d08de9e..18b2d5c21 100644 --- a/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor +++ b/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor @@ -1,7 +1,7 @@ @attribute [Route(Routes.ASSISTANT_MY_TASKS)] @inherits AssistantBaseCore - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor.cs b/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor.cs index c7c121113..ff5ab87fc 100644 --- a/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor.cs +++ b/app/MindWork AI Studio/Assistants/MyTasks/AssistantMyTasks.razor.cs @@ -110,8 +110,8 @@ private string SystemPromptLanguage() private async Task AnalyzeText() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor b/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor index a1ad067c8..b2c1d3b19 100644 --- a/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor +++ b/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor @@ -101,7 +101,7 @@ CatchAllDocuments="false" UseSmallForm="true" ValidateMediaFileTypes="false" - Provider="@this.providerSettings"/> + Provider="@this.ProviderSettings"/> } - + diff --git a/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor.cs b/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor.cs index fed13be27..b1df89444 100644 --- a/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor.cs +++ b/app/MindWork AI Studio/Assistants/PromptOptimizer/AssistantPromptOptimizer.razor.cs @@ -111,7 +111,7 @@ Verify each recommendation states how to improve a future prompt version. protected override bool SubmitDisabled => this.useCustomPromptGuide && this.customPromptGuideFiles.Count == 0; - protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with + protected override ChatThread ConvertToChatThread => (this.ChatThread ?? new()) with { SystemPrompt = SystemPrompts.DEFAULT, }; @@ -218,8 +218,8 @@ private string SystemPromptLanguage() private async Task OptimizePromptAsync() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.ClearInputIssues(); @@ -341,7 +341,6 @@ private static bool TryDeserialize(string json, out PromptOptimizationResult par if (probe is null || string.IsNullOrWhiteSpace(probe.OptimizedPrompt)) return false; - probe.Recommendations ??= new PromptOptimizationRecommendations(); parsedResult = probe; return true; } @@ -414,7 +413,7 @@ private void AddVisibleOptimizedPromptBlock() if (string.IsNullOrWhiteSpace(this.optimizedPrompt)) return; - if (this.chatThread is null) + if (this.ChatThread is null) return; var visibleResponseContent = new ContentText @@ -422,7 +421,7 @@ private void AddVisibleOptimizedPromptBlock() Text = this.optimizedPrompt, }; - this.chatThread.Blocks.Add(new ContentBlock + this.ChatThread.Blocks.Add(new ContentBlock { Time = DateTimeOffset.Now, ContentType = ContentType.TEXT, @@ -548,7 +547,7 @@ private async Task OpenPromptingGuidelineDialog() { x => x.GuidelineMarkdown, promptingGuideline } }; - var dialogReference = await this.DialogService.ShowAsync(T("Prompting Guideline"), dialogParameters, AIStudio.Dialogs.DialogOptions.FULLSCREEN); + var dialogReference = await this.DialogService.ShowAsync(T("Prompting Guideline"), dialogParameters, Dialogs.DialogOptions.FULLSCREEN); await dialogReference.Result; } @@ -567,6 +566,6 @@ private async Task OpenCustomPromptGuideDialog() { x => x.FileContent, this.customPromptingGuidelineContent }, }; - await this.DialogService.ShowAsync(T("Custom Prompt Guide Preview"), dialogParameters, AIStudio.Dialogs.DialogOptions.FULLSCREEN); + await this.DialogService.ShowAsync(T("Custom Prompt Guide Preview"), dialogParameters, Dialogs.DialogOptions.FULLSCREEN); } } diff --git a/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor b/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor index 952ff9979..75393fabf 100644 --- a/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor +++ b/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor @@ -5,4 +5,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor.cs b/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor.cs index 2fe654085..81eaa6b31 100644 --- a/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor.cs +++ b/app/MindWork AI Studio/Assistants/RewriteImprove/AssistantRewriteImprove.razor.cs @@ -1,4 +1,3 @@ -using AIStudio.Chat; using AIStudio.Dialogs.Settings; namespace AIStudio.Assistants.RewriteImprove; @@ -127,8 +126,8 @@ private string SystemPromptLanguage() private async Task RewriteText() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index 55b6a781c..513b335d7 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -8,7 +8,7 @@ @T("Attach documents") - + @T("Details about the desired presentation") @@ -66,4 +66,4 @@ - + diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index 1faf2bde0..33a07a5c6 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -82,7 +82,7 @@ protected override ChatThread ConvertToChatThread { get { - if (this.chatThread is null || this.chatThread.Blocks.Count < 2) + if (this.ChatThread is null || this.ChatThread.Blocks.Count < 2) { return new ChatThread { @@ -100,7 +100,7 @@ protected override ChatThread ConvertToChatThread // Visible user block: new ContentBlock { - Time = this.chatThread.Blocks.First().Time, + Time = this.ChatThread.Blocks.First().Time, Role = ChatRole.USER, HideFromUser = false, ContentType = ContentType.TEXT, @@ -114,7 +114,7 @@ protected override ChatThread ConvertToChatThread // Hidden user block with inputContent data: new ContentBlock { - Time = this.chatThread.Blocks.First().Time, + Time = this.ChatThread.Blocks.First().Time, Role = ChatRole.USER, HideFromUser = true, ContentType = ContentType.TEXT, @@ -144,7 +144,7 @@ protected override ChatThread ConvertToChatThread // Then, append the last block of the current chat thread // (which is expected to be the AI response): - this.chatThread.Blocks.Last(), + this.ChatThread.Blocks.Last(), ] }; } @@ -230,8 +230,8 @@ protected override async Task OnInitializedAsync() private async Task OnDocumentsChanged(HashSet _) { - if(this.form is not null) - await this.form.Validate(); + if(this.Form is not null) + await this.Form.Validate(); } private string? ValidateCustomLanguage(string language) @@ -375,8 +375,8 @@ answer accordingly. private async Task CreateSlideBuilder() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.calculatedNumberOfSlides = this.timeSpecification > 0 ? this.CalculateNumberOfSlides() : 0; diff --git a/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor b/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor index 3da56b958..b385e0f05 100644 --- a/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor +++ b/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor @@ -5,4 +5,4 @@ - + diff --git a/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor.cs b/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor.cs index f837e842e..d778d9a18 100644 --- a/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor.cs +++ b/app/MindWork AI Studio/Assistants/Synonym/AssistantSynonyms.razor.cs @@ -1,4 +1,3 @@ -using AIStudio.Chat; using AIStudio.Dialogs.Settings; namespace AIStudio.Assistants.Synonym; @@ -167,8 +166,8 @@ private string UserPromptContext() private async Task FindSynonyms() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor index f235e95ac..b249d37ef 100644 --- a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor +++ b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor @@ -3,7 +3,7 @@ @if (!this.SettingsManager.ConfigurationData.TextSummarizer.HideWebContentReader) { - + } @@ -11,4 +11,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs index 26af22687..0c2097b11 100644 --- a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs +++ b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs @@ -123,8 +123,8 @@ private string PromptImportantAspects() private async Task SummarizeText() { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; this.CreateChatThread(); diff --git a/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor b/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor index 005c95f2d..96424b5c0 100644 --- a/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor +++ b/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor @@ -3,7 +3,7 @@ @if (!this.SettingsManager.ConfigurationData.Translation.HideWebContentReader) { - + } @@ -19,4 +19,4 @@ else } - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs b/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs index 84e183402..690f8d21b 100644 --- a/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs +++ b/app/MindWork AI Studio/Assistants/Translation/AssistantTranslation.razor.cs @@ -1,4 +1,3 @@ -using AIStudio.Chat; using AIStudio.Dialogs.Settings; namespace AIStudio.Assistants.Translation; @@ -120,8 +119,8 @@ protected override async Task OnInitializedAsync() private async Task TranslateText(bool force) { - await this.form!.Validate(); - if (!this.inputIsValid) + await this.Form!.Validate(); + if (!this.InputIsValid) return; if(!force && this.inputText == this.inputTextLastTranslation) diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgenda.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgenda.razor index dcaf18ff7..c59579756 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgenda.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAgenda.razor @@ -33,7 +33,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAssistantBias.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAssistantBias.razor index 40f3331f0..04ae16fbd 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAssistantBias.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogAssistantBias.razor @@ -29,7 +29,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogBase.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogBase.cs index 0dd1af1b1..b31794145 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogBase.cs +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogBase.cs @@ -19,8 +19,8 @@ public abstract class SettingsDialogBase : MSGComponentBase [Inject] protected RustService RustService { get; init; } = null!; - protected readonly List> availableLLMProviders = new(); - protected readonly List> availableEmbeddingProviders = new(); + protected readonly List> AvailableLLMProviders = new(); + protected readonly List> AvailableEmbeddingProviders = new(); #region Overrides of ComponentBase @@ -43,16 +43,16 @@ protected override async Task OnInitializedAsync() [SuppressMessage("Usage", "MWAIS0001:Direct access to `Providers` is not allowed")] private void UpdateProviders() { - this.availableLLMProviders.Clear(); + this.AvailableLLMProviders.Clear(); foreach (var provider in this.SettingsManager.ConfigurationData.Providers) - this.availableLLMProviders.Add(new (provider.InstanceName, provider.Id)); + this.AvailableLLMProviders.Add(new (provider.InstanceName, provider.Id)); } private void UpdateEmbeddingProviders() { - this.availableEmbeddingProviders.Clear(); + this.AvailableEmbeddingProviders.Clear(); foreach (var provider in this.SettingsManager.ConfigurationData.EmbeddingProviders) - this.availableEmbeddingProviders.Add(new (provider.Name, provider.Id)); + this.AvailableEmbeddingProviders.Add(new (provider.Name, provider.Id)); } #region Overrides of MSGComponentBase diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor index d9ed5a90a..1dd6b9d72 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogChat.razor @@ -17,7 +17,7 @@ - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogCoding.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogCoding.razor index 6cfed1ac7..323cbd8ef 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogCoding.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogCoding.razor @@ -19,7 +19,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs index 1170de67f..c22bed943 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogDataSources.razor.cs @@ -32,7 +32,7 @@ private async Task AddDataSource(DataSourceType type) var localFileDialogParameters = new DialogParameters { { x => x.IsEditing, false }, - { x => x.AvailableEmbeddings, this.availableEmbeddingProviders } + { x => x.AvailableEmbeddings, this.AvailableEmbeddingProviders } }; var localFileDialogReference = await this.DialogService.ShowAsync(T("Add Local File as Data Source"), localFileDialogParameters, DialogOptions.FULLSCREEN); @@ -49,7 +49,7 @@ private async Task AddDataSource(DataSourceType type) var localDirectoryDialogParameters = new DialogParameters { { x => x.IsEditing, false }, - { x => x.AvailableEmbeddings, this.availableEmbeddingProviders } + { x => x.AvailableEmbeddings, this.AvailableEmbeddingProviders } }; var localDirectoryDialogReference = await this.DialogService.ShowAsync(T("Add Local Directory as Data Source"), localDirectoryDialogParameters, DialogOptions.FULLSCREEN); @@ -97,7 +97,7 @@ private async Task EditDataSource(IDataSource dataSource) { { x => x.IsEditing, true }, { x => x.DataSource, localFile }, - { x => x.AvailableEmbeddings, this.availableEmbeddingProviders } + { x => x.AvailableEmbeddings, this.AvailableEmbeddingProviders } }; var localFileDialogReference = await this.DialogService.ShowAsync(T("Edit Local File Data Source"), localFileDialogParameters, DialogOptions.FULLSCREEN); @@ -113,7 +113,7 @@ private async Task EditDataSource(IDataSource dataSource) { { x => x.IsEditing, true }, { x => x.DataSource, localDirectory }, - { x => x.AvailableEmbeddings, this.availableEmbeddingProviders } + { x => x.AvailableEmbeddings, this.AvailableEmbeddingProviders } }; var localDirectoryDialogReference = await this.DialogService.ShowAsync(T("Edit Local Directory Data Source"), localDirectoryDialogParameters, DialogOptions.FULLSCREEN); diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogGrammarSpelling.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogGrammarSpelling.razor index 7130f3cf0..6d88504fe 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogGrammarSpelling.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogGrammarSpelling.razor @@ -17,7 +17,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogI18N.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogI18N.razor index a64528d09..68ec9a187 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogI18N.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogI18N.razor @@ -17,7 +17,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogIconFinder.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogIconFinder.razor index 187e0523e..906a07429 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogIconFinder.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogIconFinder.razor @@ -13,7 +13,7 @@ - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogJobPostings.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogJobPostings.razor index 9d2c47bcd..a9e0bcc1f 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogJobPostings.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogJobPostings.razor @@ -24,7 +24,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogLegalCheck.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogLegalCheck.razor index 71947b14f..e5c836d6b 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogLegalCheck.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogLegalCheck.razor @@ -14,7 +14,7 @@ - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogMyTasks.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogMyTasks.razor index 1fed1f083..4ba4f587d 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogMyTasks.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogMyTasks.razor @@ -18,7 +18,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPromptOptimizer.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPromptOptimizer.razor index e34028f59..72bed756c 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPromptOptimizer.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPromptOptimizer.razor @@ -18,7 +18,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogRewrite.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogRewrite.razor index 6cdfc96f6..827e67470 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogRewrite.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogRewrite.razor @@ -19,7 +19,7 @@ - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor index 18d512803..ebc678d8c 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor @@ -22,7 +22,7 @@ - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSynonyms.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSynonyms.razor index 0a78e616f..bca6ee22e 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSynonyms.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSynonyms.razor @@ -17,7 +17,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTextSummarizer.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTextSummarizer.razor index 9e1e183b2..0ebded9a0 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTextSummarizer.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTextSummarizer.razor @@ -27,7 +27,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTranslation.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTranslation.razor index f3db4a3c0..cf3a520e1 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTranslation.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogTranslation.razor @@ -21,7 +21,7 @@ } - + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWritingEMails.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWritingEMails.razor index ff96ced6b..ce39131bc 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWritingEMails.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogWritingEMails.razor @@ -20,7 +20,7 @@ } - + diff --git a/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs b/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs index 5458bedc1..338401e3c 100644 --- a/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs +++ b/app/MindWork AI Studio/Tools/ERIClient/ERIClientBase.cs @@ -7,7 +7,7 @@ namespace AIStudio.Tools.ERIClient; public abstract class ERIClientBase(IERIDataSource dataSource) : IDisposable { - protected readonly IERIDataSource dataSource = dataSource; + protected readonly IERIDataSource DataSource = dataSource; protected static readonly JsonSerializerOptions JSON_OPTIONS = new() { @@ -23,18 +23,18 @@ public abstract class ERIClientBase(IERIDataSource dataSource) : IDisposable } }; - protected readonly HttpClient httpClient = new() + protected readonly HttpClient HttpClient = new() { BaseAddress = new Uri($"{dataSource.Hostname}:{dataSource.Port}"), }; - protected string securityToken = string.Empty; + protected string SecurityToken = string.Empty; #region Implementation of IDisposable public void Dispose() { - this.httpClient.Dispose(); + this.HttpClient.Dispose(); } #endregion diff --git a/app/MindWork AI Studio/Tools/ERIClient/ERIClientV1.cs b/app/MindWork AI Studio/Tools/ERIClient/ERIClientV1.cs index 3769fcbfe..2653ca2a7 100644 --- a/app/MindWork AI Studio/Tools/ERIClient/ERIClientV1.cs +++ b/app/MindWork AI Studio/Tools/ERIClient/ERIClientV1.cs @@ -18,7 +18,7 @@ public async Task>> GetAuthMethodsAsync(Cancellatio { try { - using var response = await this.httpClient.GetAsync("/auth/methods", cancellationToken); + using var response = await this.HttpClient.GetAsync("/auth/methods", cancellationToken); if (!response.IsSuccessStatusCode) { return new() @@ -66,14 +66,14 @@ public async Task> AuthenticateAsync(RustService rustS { try { - var authMethod = this.dataSource.AuthMethod; - var username = this.dataSource.Username; - switch (this.dataSource.AuthMethod) + var authMethod = this.DataSource.AuthMethod; + var username = this.DataSource.Username; + switch (this.DataSource.AuthMethod) { case AuthMethod.NONE: using (var request = new HttpRequestMessage(HttpMethod.Post, $"auth?authMethod={authMethod}")) { - using var noneAuthResponse = await this.httpClient.SendAsync(request, cancellationToken); + using var noneAuthResponse = await this.HttpClient.SendAsync(request, cancellationToken); if(!noneAuthResponse.IsSuccessStatusCode) { return new() @@ -93,7 +93,7 @@ public async Task> AuthenticateAsync(RustService rustS }; } - this.securityToken = noneAuthResult.Token ?? string.Empty; + this.SecurityToken = noneAuthResult.Token ?? string.Empty; return new() { Successful = true, @@ -105,7 +105,7 @@ public async Task> AuthenticateAsync(RustService rustS string password; if (string.IsNullOrWhiteSpace(temporarySecret)) { - var passwordResponse = await rustService.GetSecret(this.dataSource); + var passwordResponse = await rustService.GetSecret(this.DataSource); if (!passwordResponse.Success) { return new() @@ -127,7 +127,7 @@ public async Task> AuthenticateAsync(RustService rustS request.Headers.Add("user", username); request.Headers.Add("password", password); - using var usernamePasswordAuthResponse = await this.httpClient.SendAsync(request, cancellationToken); + using var usernamePasswordAuthResponse = await this.HttpClient.SendAsync(request, cancellationToken); if(!usernamePasswordAuthResponse.IsSuccessStatusCode) { return new() @@ -147,7 +147,7 @@ public async Task> AuthenticateAsync(RustService rustS }; } - this.securityToken = usernamePasswordAuthResult.Token ?? string.Empty; + this.SecurityToken = usernamePasswordAuthResult.Token ?? string.Empty; return new() { Successful = true, @@ -159,7 +159,7 @@ public async Task> AuthenticateAsync(RustService rustS string token; if (string.IsNullOrWhiteSpace(temporarySecret)) { - var tokenResponse = await rustService.GetSecret(this.dataSource); + var tokenResponse = await rustService.GetSecret(this.DataSource); if (!tokenResponse.Success) { return new() @@ -178,7 +178,7 @@ public async Task> AuthenticateAsync(RustService rustS { request.Headers.Add("Authorization", $"Bearer {token}"); - using var tokenAuthResponse = await this.httpClient.SendAsync(request, cancellationToken); + using var tokenAuthResponse = await this.HttpClient.SendAsync(request, cancellationToken); if(!tokenAuthResponse.IsSuccessStatusCode) { return new() @@ -198,7 +198,7 @@ public async Task> AuthenticateAsync(RustService rustS }; } - this.securityToken = tokenAuthResult.Token ?? string.Empty; + this.SecurityToken = tokenAuthResult.Token ?? string.Empty; return new() { Successful = true, @@ -207,7 +207,7 @@ public async Task> AuthenticateAsync(RustService rustS } default: - this.securityToken = string.Empty; + this.SecurityToken = string.Empty; return new() { Successful = false, @@ -238,9 +238,9 @@ public async Task> GetDataSourceInfoAsync(Cancellati try { using var request = new HttpRequestMessage(HttpMethod.Get, "/dataSource"); - request.Headers.Add("token", this.securityToken); + request.Headers.Add("token", this.SecurityToken); - using var response = await this.httpClient.SendAsync(request, cancellationToken); + using var response = await this.HttpClient.SendAsync(request, cancellationToken); if(!response.IsSuccessStatusCode) { return new() @@ -289,9 +289,9 @@ public async Task>> GetEmbeddingInfoAsync(Cancel try { using var request = new HttpRequestMessage(HttpMethod.Get, "/embedding/info"); - request.Headers.Add("token", this.securityToken); + request.Headers.Add("token", this.SecurityToken); - using var response = await this.httpClient.SendAsync(request, cancellationToken); + using var response = await this.HttpClient.SendAsync(request, cancellationToken); if(!response.IsSuccessStatusCode) { return new() @@ -340,9 +340,9 @@ public async Task>> GetRetrievalInfoAsync(Cancel try { using var request = new HttpRequestMessage(HttpMethod.Get, "/retrieval/info"); - request.Headers.Add("token", this.securityToken); + request.Headers.Add("token", this.SecurityToken); - using var response = await this.httpClient.SendAsync(request, cancellationToken); + using var response = await this.HttpClient.SendAsync(request, cancellationToken); if(!response.IsSuccessStatusCode) { return new() @@ -391,12 +391,12 @@ public async Task>> ExecuteRetrievalAsync(RetrievalReq try { using var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/retrieval"); - requestMessage.Headers.Add("token", this.securityToken); + requestMessage.Headers.Add("token", this.SecurityToken); using var content = new StringContent(JsonSerializer.Serialize(request, JSON_OPTIONS), Encoding.UTF8, "application/json"); requestMessage.Content = content; - using var response = await this.httpClient.SendAsync(requestMessage, cancellationToken); + using var response = await this.HttpClient.SendAsync(requestMessage, cancellationToken); if(!response.IsSuccessStatusCode) { return new() @@ -445,9 +445,9 @@ public async Task> GetSecurityRequirementsAsyn try { using var request = new HttpRequestMessage(HttpMethod.Get, "/security/requirements"); - request.Headers.Add("token", this.securityToken); + request.Headers.Add("token", this.SecurityToken); - using var response = await this.httpClient.SendAsync(request, cancellationToken); + using var response = await this.HttpClient.SendAsync(request, cancellationToken); if(!response.IsSuccessStatusCode) { return new()