From 084ad7b6951cfa4b0623b4cd860b339c5d772b81 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 12 Aug 2024 20:05:07 +0200 Subject: [PATCH] Show progress --- app/MindWork AI Studio/Components/AssistantBase.razor.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/MindWork AI Studio/Components/AssistantBase.razor.cs b/app/MindWork AI Studio/Components/AssistantBase.razor.cs index b843efa2..2046009b 100644 --- a/app/MindWork AI Studio/Components/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Components/AssistantBase.razor.cs @@ -37,6 +37,7 @@ public abstract partial class AssistantBase : ComponentBase private ChatThread? chatThread; private ContentBlock? resultingContentBlock; private string[] inputIssues = []; + private bool isProcessing; #region Overrides of ComponentBase @@ -116,10 +117,15 @@ public abstract partial class AssistantBase : ComponentBase }; this.chatThread?.Blocks.Add(this.resultingContentBlock); + this.isProcessing = true; + this.StateHasChanged(); // Use the selected provider to get the AI response. // By awaiting this line, we wait for the entire // content to be streamed. await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(), this.JsRuntime, this.SettingsManager, this.providerSettings.Model, this.chatThread); + + this.isProcessing = false; + this.StateHasChanged(); } } \ No newline at end of file