diff --git a/app/MindWork AI Studio/Chat/ContentBlockComponent.razor b/app/MindWork AI Studio/Chat/ContentBlockComponent.razor index 826cfdc0..f1c93b65 100644 --- a/app/MindWork AI Studio/Chat/ContentBlockComponent.razor +++ b/app/MindWork AI Studio/Chat/ContentBlockComponent.razor @@ -27,7 +27,7 @@ @if (this.IsLastContentBlock && this.Role is ChatRole.AI && this.RegenerateFunc is not null) { - + } @if (this.RemoveBlockFunc is not null) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor b/app/MindWork AI Studio/Components/ChatComponent.razor index 0d19d20a..703d9175 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor +++ b/app/MindWork AI Studio/Components/ChatComponent.razor @@ -24,7 +24,7 @@ IsLastContentBlock="@isLastBlock" IsSecondToLastBlock="@isSecondLastBlock" RegenerateFunc="@this.RegenerateBlock" - RegenerateEnabled="@(() => this.IsProviderSelected)" + RegenerateEnabled="@(() => this.IsProviderSelected && this.ChatThread.IsLLMProviderAllowed(this.Provider))" EditLastBlockFunc="@this.EditLastBlock" EditLastUserBlockFunc="@this.EditLastUserBlock"/> } diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 99024579..f3b6b742 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -793,6 +793,9 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable if(this.ChatThread is null) return; + if(!this.ChatThread.IsLLMProviderAllowed(this.Provider)) + return; + this.ChatThread.Remove(aiBlock, removeForRegenerate: true); this.hasUnsavedChanges = true; this.StateHasChanged(); diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md index 118700cb..fa8328e3 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.32.md @@ -10,4 +10,5 @@ - Fixed the chat thread we use for the data retrieval by removing the last block, which is meant to be for the final AI answer. - Fixed the data source name for ERI data sources when performing data retrieval. - Fixed the default data source selection when replacing the current chat with a new one. +- Fixed the state of the re-generate button in the chat thread, when no provider is selected or the data security is preventing the use of cloud LLMs. - Upgraded code dependencies. \ No newline at end of file