mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-27 22:59:47 +00:00
Improve provider dialogs by conditionally rendering input fields based on relevance
This commit is contained in:
parent
1209e1724c
commit
22f998de9a
@ -20,44 +20,49 @@
|
|||||||
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton())" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">Create account</MudButton>
|
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton())" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">Create account</MudButton>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
@if (this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost))
|
||||||
<MudTextField
|
{
|
||||||
T="string"
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
||||||
@bind-Text="@this.dataAPIKey"
|
<MudTextField
|
||||||
Label="@this.APIKeyText"
|
T="string"
|
||||||
Disabled="@(!this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost))"
|
@bind-Text="@this.dataAPIKey"
|
||||||
Class="mb-3"
|
Label="@this.APIKeyText"
|
||||||
Adornment="Adornment.Start"
|
Class="mb-3"
|
||||||
AdornmentIcon="@Icons.Material.Filled.VpnKey"
|
Adornment="Adornment.Start"
|
||||||
AdornmentColor="Color.Info"
|
AdornmentIcon="@Icons.Material.Filled.VpnKey"
|
||||||
InputType="InputType.Password"
|
AdornmentColor="Color.Info"
|
||||||
Validation="@this.providerValidation.ValidatingAPIKey"
|
InputType="InputType.Password"
|
||||||
/>
|
Validation="@this.providerValidation.ValidatingAPIKey"/>
|
||||||
|
}
|
||||||
<MudTextField
|
|
||||||
T="string"
|
|
||||||
@bind-Text="@this.DataHostname"
|
|
||||||
Label="Hostname"
|
|
||||||
Disabled="@(!this.DataLLMProvider.IsHostnameNeeded())"
|
|
||||||
Class="mb-3"
|
|
||||||
Adornment="Adornment.Start"
|
|
||||||
AdornmentIcon="@Icons.Material.Filled.Dns"
|
|
||||||
AdornmentColor="Color.Info"
|
|
||||||
Validation="@this.providerValidation.ValidatingHostname"
|
|
||||||
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<MudSelect Disabled="@(!this.DataLLMProvider.IsHostNeeded())" @bind-Value="@this.DataHost" Label="Host" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
@if (this.DataLLMProvider.IsHostnameNeeded())
|
||||||
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
{
|
||||||
{
|
<MudTextField
|
||||||
if (host.AreEmbeddingsSupported())
|
T="string"
|
||||||
|
@bind-Text="@this.DataHostname"
|
||||||
|
Label="Hostname"
|
||||||
|
Class="mb-3"
|
||||||
|
Adornment="Adornment.Start"
|
||||||
|
AdornmentIcon="@Icons.Material.Filled.Dns"
|
||||||
|
AdornmentColor="Color.Info"
|
||||||
|
Validation="@this.providerValidation.ValidatingHostname"
|
||||||
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (this.DataLLMProvider.IsHostNeeded())
|
||||||
|
{
|
||||||
|
<MudSelect @bind-Value="@this.DataHost" Label="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)))
|
||||||
{
|
{
|
||||||
}
|
if (host.AreEmbeddingsSupported())
|
||||||
}
|
{
|
||||||
</MudSelect>
|
|
||||||
<MudSelectItem Value="@host">
|
<MudSelectItem Value="@host">
|
||||||
@host.Name()
|
@host.Name()
|
||||||
</MudSelectItem>
|
</MudSelectItem>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</MudSelect>
|
||||||
|
}
|
||||||
|
|
||||||
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
||||||
@if (this.DataLLMProvider.IsEmbeddingModelProvidedManually(this.DataHost))
|
@if (this.DataLLMProvider.IsEmbeddingModelProvidedManually(this.DataHost))
|
||||||
|
@ -18,19 +18,20 @@
|
|||||||
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton())" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">Create account</MudButton>
|
<MudButton Disabled="@(!this.DataLLMProvider.ShowRegisterButton())" Variant="Variant.Filled" Size="Size.Small" StartIcon="@Icons.Material.Filled.OpenInBrowser" Href="@this.DataLLMProvider.GetCreationURL()" Target="_blank">Create account</MudButton>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
@if (this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost))
|
||||||
<MudTextField
|
{
|
||||||
T="string"
|
@* ReSharper disable once CSharpWarnings::CS8974 *@
|
||||||
@bind-Text="@this.dataAPIKey"
|
<MudTextField
|
||||||
Label="@this.APIKeyText"
|
T="string"
|
||||||
Disabled="@(!this.DataLLMProvider.IsAPIKeyNeeded(this.DataHost))"
|
@bind-Text="@this.dataAPIKey"
|
||||||
Class="mb-3"
|
Label="@this.APIKeyText"
|
||||||
Adornment="Adornment.Start"
|
Class="mb-3"
|
||||||
AdornmentIcon="@Icons.Material.Filled.VpnKey"
|
Adornment="Adornment.Start"
|
||||||
AdornmentColor="Color.Info"
|
AdornmentIcon="@Icons.Material.Filled.VpnKey"
|
||||||
InputType="InputType.Password"
|
AdornmentColor="Color.Info"
|
||||||
Validation="@this.providerValidation.ValidatingAPIKey"
|
InputType="InputType.Password"
|
||||||
/>
|
Validation="@this.providerValidation.ValidatingAPIKey"/>
|
||||||
|
}
|
||||||
|
|
||||||
@if (this.DataLLMProvider.IsHostnameNeeded())
|
@if (this.DataLLMProvider.IsHostnameNeeded())
|
||||||
{
|
{
|
||||||
@ -38,7 +39,6 @@
|
|||||||
T="string"
|
T="string"
|
||||||
@bind-Text="@this.DataHostname"
|
@bind-Text="@this.DataHostname"
|
||||||
Label="Hostname"
|
Label="Hostname"
|
||||||
Disabled="@(!this.DataLLMProvider.IsHostnameNeeded())"
|
|
||||||
Class="mb-3"
|
Class="mb-3"
|
||||||
Adornment="Adornment.Start"
|
Adornment="Adornment.Start"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Dns"
|
AdornmentIcon="@Icons.Material.Filled.Dns"
|
||||||
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
@if (this.DataLLMProvider.IsHostNeeded())
|
@if (this.DataLLMProvider.IsHostNeeded())
|
||||||
{
|
{
|
||||||
<MudSelect Disabled="@(!this.DataLLMProvider.IsHostNeeded())" @bind-Value="@this.DataHost" Label="Host" Class="mb-3" OpenIcon="@Icons.Material.Filled.ExpandMore" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHost">
|
<MudSelect @bind-Value="@this.DataHost" Label="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)))
|
||||||
{
|
{
|
||||||
<MudSelectItem Value="@host">
|
<MudSelectItem Value="@host">
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
- Added support for the announced OpenAI `o4` models.
|
- Added support for the announced OpenAI `o4` models.
|
||||||
- Added Alibaba Cloud as a new provider. Thanks Peer `peerschuett` for the contribution.
|
- Added Alibaba Cloud as a new provider. Thanks Peer `peerschuett` for the contribution.
|
||||||
- Added the Hugging Face inference provider as an LLM provider to AI Studio. Thanks Peer `peerschuett` for the contribution.
|
- Added the Hugging Face inference provider as an LLM provider to AI Studio. Thanks Peer `peerschuett` for the contribution.
|
||||||
|
- Improved the LLM & embedding provider dialogs by hiding not relevant options.
|
||||||
- Improved the provider selection by showing the name of the provider in the provider selection instead of its identifier.
|
- Improved the provider selection by showing the name of the provider in the provider selection instead of its identifier.
|
||||||
- Improved the developer experience by adding a tolerant enum converter for better configuration handling.
|
- Improved the developer experience by adding a tolerant enum converter for better configuration handling.
|
||||||
- Fixed an issue where OpenAI `o3` models were not shown in the model selection.
|
- Fixed an issue where OpenAI `o3` models were not shown in the model selection.
|
||||||
|
Loading…
Reference in New Issue
Block a user