Fixed the dialog for adding providers (#837)
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions

This commit is contained in:
Thorsten Sommer 2026-07-06 15:19:10 +02:00 committed by GitHub
parent 5ea2d35dcd
commit 0476595f2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 58 additions and 36 deletions

View File

@ -7,7 +7,15 @@
<MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues"> <MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
<MudStack Row="@true" AlignItems="AlignItems.Center"> <MudStack Row="@true" AlignItems="AlignItems.Center">
@* ReSharper disable once CSharpWarnings::CS8974 *@ @* ReSharper disable once CSharpWarnings::CS8974 *@
<MudSelect @bind-Value="@this.DataLLMProvider" Label="@T("Provider")" Class="mb-3" OpenIcon="@Icons.Material.Filled.AccountBalance" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingProvider"> <MudSelect T="LLMProviders"
Value="@this.DataLLMProvider"
ValueChanged="@this.OnProviderChanged"
Label="@T("Provider")"
Class="mb-3"
OpenIcon="@Icons.Material.Filled.AccountBalance"
AdornmentColor="Color.Info"
Adornment="Adornment.Start"
Validation="@this.providerValidation.ValidatingProvider">
@foreach (LLMProviders provider in Enum.GetValues(typeof(LLMProviders))) @foreach (LLMProviders provider in Enum.GetValues(typeof(LLMProviders)))
{ {
<MudSelectItem Value="@provider"> <MudSelectItem Value="@provider">

View File

@ -162,28 +162,13 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
{ {
var cleanedHostname = this.DataHostname.Trim(); var cleanedHostname = this.DataHostname.Trim();
// Determine the model based on the provider and host configuration:
Model model;
if (this.IsLLMModelSelectionHidden)
{
// Use system model placeholder for legacy hosts that don't support model selection:
model = Model.SYSTEM_MODEL;
}
else if (this.DataLLMProvider is LLMProviders.FIREWORKS or LLMProviders.HUGGINGFACE)
{
// These providers require manual model entry:
model = new Model(this.dataManuallyModel, null);
}
else
model = this.DataModel;
return new() return new()
{ {
Num = this.DataNum, Num = this.DataNum,
Id = this.DataId, Id = this.DataId,
InstanceName = this.DataInstanceName, InstanceName = this.DataInstanceName,
UsedLLMProvider = this.DataLLMProvider, UsedLLMProvider = this.DataLLMProvider,
Model = model, Model = this.GetSelectedModel(),
IsSelfHosted = this.DataLLMProvider is LLMProviders.SELF_HOSTED, IsSelfHosted = this.DataLLMProvider is LLMProviders.SELF_HOSTED,
IsEnterpriseConfiguration = false, IsEnterpriseConfiguration = false,
Hostname = cleanedHostname.EndsWith('/') ? cleanedHostname[..^1] : cleanedHostname, Hostname = cleanedHostname.EndsWith('/') ? cleanedHostname[..^1] : cleanedHostname,
@ -194,6 +179,17 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
}; };
} }
private Model GetSelectedModel()
{
if (this.IsLLMModelSelectionHidden)
return Model.SYSTEM_MODEL;
if (this.DataLLMProvider.IsLLMModelProvidedManually())
return new Model(this.dataManuallyModel, null);
return this.DataModel;
}
#region Overrides of ComponentBase #region Overrides of ComponentBase
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
@ -326,6 +322,17 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
} }
} }
private void OnProviderChanged(LLMProviders selectedProvider)
{
this.DataLLMProvider = selectedProvider;
this.DataModel = default;
this.dataManuallyModel = string.Empty;
this.capabilityOverrides = new();
this.availableModels.Clear();
this.dataLoadingModelsIssue = string.Empty;
this.usesLegacySystemModelFallback = false;
}
private void OnHostChanged(Host selectedHost) private void OnHostChanged(Host selectedHost)
{ {
// When the host changes, reset the model selection state: // When the host changes, reset the model selection state:
@ -535,7 +542,7 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
return currentProviderSettings.GetModelCapabilities(); return currentProviderSettings.GetModelCapabilities();
} }
private List<Capability> GetAutomaticModelCapabilities() => this.DataLLMProvider.GetModelCapabilities(this.DataModel); private List<Capability> GetAutomaticModelCapabilities() => this.DataLLMProvider.GetModelCapabilities(this.GetSelectedModel());
private string GetCurrentModelApiLabel() private string GetCurrentModelApiLabel()
{ {

View File

@ -21,27 +21,33 @@ public static partial class ProviderExtensions
/// <param name="provider">The LLM provider.</param> /// <param name="provider">The LLM provider.</param>
/// <param name="model">The model to get the capabilities for.</param> /// <param name="model">The model to get the capabilities for.</param>
/// <returns>>The capabilities of the model.</returns> /// <returns>>The capabilities of the model.</returns>
public static List<Capability> GetModelCapabilities(this LLMProviders provider, Model model) => provider switch public static List<Capability> GetModelCapabilities(this LLMProviders provider, Model model)
{ {
LLMProviders.OPEN_AI => GetModelCapabilitiesOpenAI(model), if (string.IsNullOrWhiteSpace(model.Id))
LLMProviders.MISTRAL => GetModelCapabilitiesMistral(model), return [];
LLMProviders.ANTHROPIC => GetModelCapabilitiesAnthropic(model),
LLMProviders.GOOGLE => GetModelCapabilitiesGoogle(model),
LLMProviders.X => GetModelCapabilitiesOpenSource(model),
LLMProviders.DEEP_SEEK => GetModelCapabilitiesDeepSeek(model),
LLMProviders.ALIBABA_CLOUD => GetModelCapabilitiesAlibaba(model),
LLMProviders.PERPLEXITY => GetModelCapabilitiesPerplexity(model),
LLMProviders.OPEN_ROUTER => GetModelCapabilitiesOpenRouter(model),
LLMProviders.GROQ => GetModelCapabilitiesOpenSource(model), return provider switch
LLMProviders.FIREWORKS => GetModelCapabilitiesOpenSource(model), {
LLMProviders.HUGGINGFACE => GetModelCapabilitiesOpenSource(model), LLMProviders.OPEN_AI => GetModelCapabilitiesOpenAI(model),
LLMProviders.MISTRAL => GetModelCapabilitiesMistral(model),
LLMProviders.ANTHROPIC => GetModelCapabilitiesAnthropic(model),
LLMProviders.GOOGLE => GetModelCapabilitiesGoogle(model),
LLMProviders.X => GetModelCapabilitiesOpenSource(model),
LLMProviders.DEEP_SEEK => GetModelCapabilitiesDeepSeek(model),
LLMProviders.ALIBABA_CLOUD => GetModelCapabilitiesAlibaba(model),
LLMProviders.PERPLEXITY => GetModelCapabilitiesPerplexity(model),
LLMProviders.OPEN_ROUTER => GetModelCapabilitiesOpenRouter(model),
LLMProviders.HELMHOLTZ => GetModelCapabilitiesOpenSource(model), LLMProviders.GROQ => GetModelCapabilitiesOpenSource(model),
LLMProviders.GWDG => GetModelCapabilitiesOpenSource(model), LLMProviders.FIREWORKS => GetModelCapabilitiesOpenSource(model),
LLMProviders.HUGGINGFACE => GetModelCapabilitiesOpenSource(model),
LLMProviders.SELF_HOSTED => GetModelCapabilitiesOpenSource(model), LLMProviders.HELMHOLTZ => GetModelCapabilitiesOpenSource(model),
LLMProviders.GWDG => GetModelCapabilitiesOpenSource(model),
_ => [] LLMProviders.SELF_HOSTED => GetModelCapabilitiesOpenSource(model),
};
_ => []
};
}
} }

View File

@ -1 +1,2 @@
# v26.7.2, build 244 (2026-07-xx xx:xx UTC) # v26.7.2, build 244 (2026-07-xx xx:xx UTC)
- Fixed the dialog for adding providers. Selecting an option could previously prevent the setup from continuing. Thanks, Dominic Neuburg (`donework`), for reporting this issue.