mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 08:19:47 +00:00
Provider dialog shows the relevant fields dynamically
This commit is contained in:
parent
74fa1d14a6
commit
ca7d82a220
@ -29,7 +29,7 @@
|
|||||||
<RowTemplate>
|
<RowTemplate>
|
||||||
<MudTd>@context.Num</MudTd>
|
<MudTd>@context.Num</MudTd>
|
||||||
<MudTd>@context.InstanceName</MudTd>
|
<MudTd>@context.InstanceName</MudTd>
|
||||||
<MudTd>@context.UsedLLMProvider</MudTd>
|
<MudTd>@context.UsedLLMProvider.ToName()</MudTd>
|
||||||
<MudTd>
|
<MudTd>
|
||||||
@if (context.UsedLLMProvider is not LLMProviders.SELF_HOSTED)
|
@if (context.UsedLLMProvider is not LLMProviders.SELF_HOSTED)
|
||||||
{
|
{
|
||||||
|
@ -29,34 +29,44 @@
|
|||||||
InputType="InputType.Password"
|
InputType="InputType.Password"
|
||||||
Validation="@this.providerValidation.ValidatingAPIKey"
|
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
|
||||||
<MudSelectItem Value="@host">@host.Name()</MudSelectItem>
|
T="string"
|
||||||
}
|
@bind-Text="@this.DataHostname"
|
||||||
</MudSelect>
|
Label="Hostname"
|
||||||
|
Disabled="@(!this.DataLLMProvider.IsHostnameNeeded())"
|
||||||
<MudSelect Disabled="@(!this.DataLLMProvider.IsHFInstanceProviderNeeded())" @bind-Value="@this.HfInstanceProviderId" Label="HF Instance Provider" Class="mb-3" OpenIcon="@Icons.Material.Filled.Dns" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHFInstanceProvider">
|
Class="mb-3"
|
||||||
@foreach (HFInstanceProvider instanceProvider in Enum.GetValues(typeof(HFInstanceProvider)))
|
Adornment="Adornment.Start"
|
||||||
{
|
AdornmentIcon="@Icons.Material.Filled.Dns"
|
||||||
<MudSelectItem Value="@instanceProvider">@instanceProvider.ToName()</MudSelectItem>
|
AdornmentColor="Color.Info"
|
||||||
}
|
Validation="@this.providerValidation.ValidatingHostname"
|
||||||
</MudSelect>
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
|
||||||
|
}
|
||||||
|
|
||||||
|
@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">
|
||||||
|
@foreach (Host host in Enum.GetValues(typeof(Host)))
|
||||||
|
{
|
||||||
|
<MudSelectItem Value="@host">@host.Name()</MudSelectItem>
|
||||||
|
}
|
||||||
|
</MudSelect>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (this.DataLLMProvider.IsHFInstanceProviderNeeded())
|
||||||
|
{
|
||||||
|
<MudSelect Disabled="@(!this.DataLLMProvider.IsHFInstanceProviderNeeded())" @bind-Value="@this.HfInstanceProviderId" Label="HF Instance Provider" Class="mb-3" OpenIcon="@Icons.Material.Filled.Dns" AdornmentColor="Color.Info" Adornment="Adornment.Start" Validation="@this.providerValidation.ValidatingHFInstanceProvider">
|
||||||
|
@foreach (HFInstanceProvider instanceProvider in Enum.GetValues(typeof(HFInstanceProvider)))
|
||||||
|
{
|
||||||
|
<MudSelectItem Value="@instanceProvider">@instanceProvider.ToName()</MudSelectItem>
|
||||||
|
}
|
||||||
|
</MudSelect>
|
||||||
|
|
||||||
|
<MudJustifiedText Class="mb-3"> Please double-check if your model name matches the curl specifications provided by the instance provider. If it doesn't, you might get a <b>Not Found</b> error when trying to use the model. Here's a <MudLink Href="https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct?inference_api=true&inference_provider=novita&language=sh" Target="_blank">curl example</MudLink>.</MudJustifiedText>
|
||||||
|
}
|
||||||
|
|
||||||
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
||||||
@if (this.DataLLMProvider.IsLLMModelProvidedManually())
|
@if (this.DataLLMProvider.IsLLMModelProvidedManually())
|
||||||
{
|
{
|
||||||
@ -67,7 +77,7 @@
|
|||||||
Label="Model"
|
Label="Model"
|
||||||
Class="mb-3"
|
Class="mb-3"
|
||||||
Adornment="Adornment.Start"
|
Adornment="Adornment.Start"
|
||||||
AdornmentIcon="@Icons.Material.Filled.Dns"
|
AdornmentIcon="@Icons.Material.Filled.FaceRetouchingNatural"
|
||||||
AdornmentColor="Color.Info"
|
AdornmentColor="Color.Info"
|
||||||
Validation="@this.ValidateManuallyModel"
|
Validation="@this.ValidateManuallyModel"
|
||||||
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
||||||
|
Loading…
Reference in New Issue
Block a user