diff --git a/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor b/app/MindWork AI Studio/Assistants/Agenda/AssistantAgenda.razor index 8056467c..6a620049 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 6f6261f1..c6513cc2 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 @@ public partial class AssistantAgenda : AssistantBaseCore 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 f03363de..59c9f7a2 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 332e25ba..d9b553dd 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs @@ -111,14 +111,14 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher }; 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher // 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher { 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher // 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 @@ public abstract partial class AssistantBase : AssistantLowerBase wher 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 c95f6f3a..8f582ebe 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 bf28b7c4..d1930b8e 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 @@ public partial class BiasOfTheDayAssistant : AssistantBaseCore - \ 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 b96be950..5e8a3753 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 @@ public partial class AssistantCoding : AssistantBaseCore return ValueTask.CompletedTask; this.codingContexts.RemoveAt(index); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); this.StateHasChanged(); return ValueTask.CompletedTask; @@ -116,8 +116,8 @@ public partial class AssistantCoding : AssistantBaseCore 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 4e7a38ee..89f8e04c 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 419d4c9e..77522cd8 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 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore @@ -408,10 +408,10 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore= 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 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore 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 @@ public partial class DocumentAnalysisAssistant : AssistantBaseCore @@ -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 7703ff97..7b3b3d69 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 @@ public partial class AssistantDynamic : AssistantBaseCore 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 @@ public partial class AssistantDynamic : AssistantBaseCore 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 @@ public partial class AssistantDynamic : AssistantBaseCore 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 @@ public partial class AssistantDynamic : AssistantBaseCore 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 2f8783b3..620b7c95 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 a2ec29de..4c1e1158 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 @@ public partial class AssistantEMail : AssistantBaseCore@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 d8866cfe..a4c204c9 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 @@ public partial class AssistantERI : AssistantBaseCore 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 @@ public partial class AssistantERI : AssistantBaseCore 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 @@ public partial class AssistantERI : AssistantBaseCore this.ResetForm(); await this.SettingsManager.StoreSettings(); - this.form?.ResetValidation(); + this.Form?.ResetValidation(); } private bool IsNoneERIServerSelected => this.selectedERIServer is null; @@ -940,8 +940,8 @@ public partial class AssistantERI : AssistantBaseCore 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 f783f657..5d116797 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 b8dbbe12..9f90a0fa 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 @@ public partial class AssistantGrammarSpelling : AssistantBaseCore + } @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 d229eb9b..cc69e796 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 @@ public partial class AssistantI18N : AssistantBaseCore 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 @@ public partial class AssistantI18N : AssistantBaseCore this.localizedContent = this.addedContent.ToDictionary(); } - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) return; // @@ -302,7 +302,7 @@ public partial class AssistantI18N : AssistantBaseCore // 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 @@ public partial class AssistantI18N : AssistantBaseCore this.localizedContent.Add(keyValuePair.Key, keyValuePair.Value); } - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) return; // @@ -324,7 +324,7 @@ public partial class AssistantI18N : AssistantBaseCore 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 @@ public partial class AssistantI18N : AssistantBaseCore var minimumTime = TimeSpan.FromMilliseconds(500); foreach (var keyValuePair in this.addedContent) { - if(this.cancellationTokenSource!.IsCancellationRequested) + if(this.CancellationTokenSource!.IsCancellationRequested) break; // @@ -360,7 +360,7 @@ public partial class AssistantI18N : AssistantBaseCore 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 @@ public partial class AssistantI18N : AssistantBaseCore 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 278c8bb8..84dbf735 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 ca86cb69..b6a3e5ad 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 @@ public partial class AssistantIconFinder : AssistantBaseCore - \ 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 c13d05e6..9d44eae7 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 @@ public partial class AssistantJobPostings : AssistantBaseCore + } - \ 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 e2120e6b..a7c01bca 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 @@ public partial class AssistantLegalCheck : 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 c7c12111..ff5ab87f 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 @@ public partial class AssistantMyTasks : AssistantBaseCore 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 a1ad067c..b2c1d3b1 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 fed13be2..b1df8944 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 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore 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 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore 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 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore 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 952ff997..75393fab 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 2fe65408..81eaa6b3 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 @@ public partial class AssistantRewriteImprove : AssistantBaseCore @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 1faf2bde..33a07a5c 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 @@ public partial class SlideAssistant : AssistantBaseCore