mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-13 19:41:37 +00:00
Fix model state after switching the host
This commit is contained in:
parent
8605bf12ab
commit
eb34b9bd34
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
@if (this.DataLLMProvider.IsHostNeeded())
|
@if (this.DataLLMProvider.IsHostNeeded())
|
||||||
{
|
{
|
||||||
<MudSelect @bind-Value="@this.DataHost" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
||||||
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
||||||
{
|
{
|
||||||
if (host.IsEmbeddingSupported())
|
if (host.IsEmbeddingSupported())
|
||||||
|
|||||||
@ -265,6 +265,16 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnHostChanged(Host selectedHost)
|
||||||
|
{
|
||||||
|
// When the host changes, reset the model selection state:
|
||||||
|
this.DataHost = selectedHost;
|
||||||
|
this.DataModel = default;
|
||||||
|
this.dataManuallyModel = string.Empty;
|
||||||
|
this.availableModels.Clear();
|
||||||
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task ReloadModels()
|
private async Task ReloadModels()
|
||||||
{
|
{
|
||||||
this.dataLoadingModelsIssue = string.Empty;
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
@if (this.DataLLMProvider.IsHostNeeded())
|
@if (this.DataLLMProvider.IsHostNeeded())
|
||||||
{
|
{
|
||||||
<MudSelect @bind-Value="@this.DataHost" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
||||||
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
||||||
{
|
{
|
||||||
@if (host.IsChatSupported())
|
@if (host.IsChatSupported())
|
||||||
|
|||||||
@ -289,6 +289,16 @@ public partial class ProviderDialog : MSGComponentBase, ISecretId
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnHostChanged(Host selectedHost)
|
||||||
|
{
|
||||||
|
// When the host changes, reset the model selection state:
|
||||||
|
this.DataHost = selectedHost;
|
||||||
|
this.DataModel = default;
|
||||||
|
this.dataManuallyModel = string.Empty;
|
||||||
|
this.availableModels.Clear();
|
||||||
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task ReloadModels()
|
private async Task ReloadModels()
|
||||||
{
|
{
|
||||||
this.dataLoadingModelsIssue = string.Empty;
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
@if (this.DataLLMProvider.IsHostNeeded())
|
@if (this.DataLLMProvider.IsHostNeeded())
|
||||||
{
|
{
|
||||||
<MudSelect @bind-Value="@this.DataHost" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
<MudSelect T="Host" Value="@this.DataHost" ValueChanged="@this.OnHostChanged" Label="@T("Host")" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
||||||
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
||||||
{
|
{
|
||||||
if (host.IsTranscriptionSupported())
|
if (host.IsTranscriptionSupported())
|
||||||
|
|||||||
@ -280,6 +280,16 @@ public partial class TranscriptionProviderDialog : MSGComponentBase, ISecretId
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnHostChanged(Host selectedHost)
|
||||||
|
{
|
||||||
|
// When the host changes, reset the model selection state:
|
||||||
|
this.DataHost = selectedHost;
|
||||||
|
this.DataModel = default;
|
||||||
|
this.dataManuallyModel = string.Empty;
|
||||||
|
this.availableModels.Clear();
|
||||||
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task ReloadModels()
|
private async Task ReloadModels()
|
||||||
{
|
{
|
||||||
this.dataLoadingModelsIssue = string.Empty;
|
this.dataLoadingModelsIssue = string.Empty;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user