From bafd62429d10de32afc48ed7807e6c5d6897c415 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 24 Apr 2025 11:43:16 +0200 Subject: [PATCH] Improve the provider dialog (#420) --- .../Dialogs/ProviderDialog.razor | 69 ++++++++++++------- .../Dialogs/ProviderDialog.razor.cs | 2 - .../wwwroot/changelog/v0.9.41.md | 1 + 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/app/MindWork AI Studio/Dialogs/ProviderDialog.razor b/app/MindWork AI Studio/Dialogs/ProviderDialog.razor index 3664062a..439a2dea 100644 --- a/app/MindWork AI Studio/Dialogs/ProviderDialog.razor +++ b/app/MindWork AI Studio/Dialogs/ProviderDialog.razor @@ -30,6 +30,7 @@ AdornmentIcon="@Icons.Material.Filled.VpnKey" AdornmentColor="Color.Info" InputType="InputType.Password" + Immediate="true" Validation="@this.providerValidation.ValidatingAPIKey"/> } @@ -61,7 +62,7 @@ @if (this.DataLLMProvider.IsHFInstanceProviderNeeded()) { - + @foreach (HFInferenceProvider inferenceProvider in Enum.GetValues(typeof(HFInferenceProvider))) { @@ -73,33 +74,49 @@ Please double-check if your model name matches the curl specifications provided by the inference provider. If it doesn't, you might get a Not Found error when trying to use the model. Here's a curl example. } - - @if (this.DataLLMProvider.IsLLMModelProvidedManually()) - { - Show available models - - } - else - { - Load - - @foreach (var model in this.availableModels) + + + @if (this.DataLLMProvider.IsLLMModelProvidedManually()) + { + + Show available models + + + } + else + { + + Load models + + @if(this.availableModels.Count is 0) { - @model + + No models loaded or available. + } - - } - + else + { + + @foreach (var model in this.availableModels) + { + @model + } + + } + } + + @* ReSharper disable once CSharpWarnings::CS8974 *@ "(Optional) API Key", _ => "API Key", }; - - private bool IsNoneProvider => this.DataLLMProvider is LLMProviders.NONE; } \ No newline at end of file diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.41.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.41.md index c25d55f0..83a0358e 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.41.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.41.md @@ -3,4 +3,5 @@ - Changed the terminology from "temporary chats" to "disappearing chats" in the UI. This makes it clearer to understand the purpose of these chats. - Improved the hot reloading of the plugin system to prevent overlapping reloads. - Improved the app behavior when the user system was waked up from sleep mode. +- Improved the provider dialog with better input handling for API keys and an optimized model selection. - Fixed the color for the update notification button to match the color theme. \ No newline at end of file