mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-07-07 08:46:26 +00:00
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
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:
parent
5ea2d35dcd
commit
0476595f2d
@ -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">
|
||||||
|
|||||||
@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,7 +21,12 @@ 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)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(model.Id))
|
||||||
|
return [];
|
||||||
|
|
||||||
|
return provider switch
|
||||||
{
|
{
|
||||||
LLMProviders.OPEN_AI => GetModelCapabilitiesOpenAI(model),
|
LLMProviders.OPEN_AI => GetModelCapabilitiesOpenAI(model),
|
||||||
LLMProviders.MISTRAL => GetModelCapabilitiesMistral(model),
|
LLMProviders.MISTRAL => GetModelCapabilitiesMistral(model),
|
||||||
@ -44,4 +49,5 @@ public static partial class ProviderExtensions
|
|||||||
|
|
||||||
_ => []
|
_ => []
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -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.
|
||||||
Loading…
Reference in New Issue
Block a user