2025-01-05 14:11:15 +00:00
@using AIStudio.Provider
2026-06-21 13:16:37 +00:00
@using AIStudio.Settings
2026-02-07 21:59:41 +00:00
@inherits SettingsPanelProviderBase
2025-01-05 14:11:15 +00:00
2026-01-09 11:45:21 +00:00
<ExpansionPanel HeaderIcon="@Icons.Material.Filled.Layers" HeaderText="@T("Configure LLM Providers")">
2025-04-27 07:06:05 +00:00
<MudText Typo="Typo.h4" Class="mb-3">
2026-01-09 11:45:21 +00:00
@T("Configured LLM Providers")
2025-04-27 07:06:05 +00:00
</MudText>
2025-01-05 14:11:15 +00:00
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
2025-04-27 07:06:05 +00:00
@T("What we call a provider is the combination of an LLM provider such as OpenAI and a model like GPT-4o. You can configure as many providers as you want. This way, you can use the appropriate model for each task. As an LLM provider, you can also choose local providers. However, to use this app, you must configure at least one provider.")
2025-01-05 14:11:15 +00:00
</MudJustifiedText>
<MudTable Items="@this.SettingsManager.ConfigurationData.Providers" Hover="@true" Class="border-dashed border rounded-lg">
<ColGroup>
<col style="width: 3em;"/>
<col style="width: 12em;"/>
<col style="width: 12em;"/>
<col/>
2026-02-07 21:59:41 +00:00
<col style="width: 22em;"/>
2025-01-05 14:11:15 +00:00
</ColGroup>
<HeaderContent>
<MudTh>#</MudTh>
2025-04-27 07:06:05 +00:00
<MudTh>@T("Instance Name")</MudTh>
<MudTh>@T("Provider")</MudTh>
<MudTh>@T("Model")</MudTh>
<MudTh>@T("Actions")</MudTh>
2025-01-05 14:11:15 +00:00
</HeaderContent>
<RowTemplate>
<MudTd>@context.Num</MudTd>
<MudTd>@context.InstanceName</MudTd>
2025-04-11 12:31:10 +00:00
<MudTd>@context.UsedLLMProvider.ToName()</MudTd>
2026-01-18 16:15:18 +00:00
<MudTd>@this.GetLLMProviderModelName(context)</MudTd>
2025-03-29 17:40:17 +00:00
<MudTd>
2025-05-17 18:54:51 +00:00
<MudStack Row="true" Class="mb-2 mt-2" Spacing="1" Wrap="Wrap.Wrap">
2026-06-21 13:16:37 +00:00
@if (context.IsTrustedByConfiguration(this.SettingsManager))
{
<MudTooltip Text="@T("This provider is trusted by your organization for data source security checks.")">
<MudIconButton Color="Color.Success" Icon="@Icons.Material.Filled.VerifiedUser" Disabled="true"/>
</MudTooltip>
}
2025-06-01 19:14:21 +00:00
@if (context.IsEnterpriseConfiguration)
{
<MudTooltip Text="@T("This provider is managed by your organization.")">
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.Business" Disabled="true"/>
</MudTooltip>
}
else
{
<MudTooltip Text="@T("Open Dashboard")">
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.OpenInBrowser" Href="@context.UsedLLMProvider.GetDashboardURL()" Target="_blank" Disabled="@(!context.UsedLLMProvider.HasDashboard())"/>
</MudTooltip>
<MudTooltip Text="@T("Edit")">
2026-01-09 11:45:21 +00:00
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.Edit" OnClick="@(() => this.EditLLMProvider(context))"/>
2025-06-01 19:14:21 +00:00
</MudTooltip>
2026-02-19 20:31:59 +00:00
@if (this.SettingsManager.ConfigurationData.App.ShowAdminSettings)
{
<MudTooltip Text="@T("Export configuration")">
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.Dataset" OnClick="@(() => this.ExportLLMProvider(context))"/>
</MudTooltip>
}
2025-06-01 19:14:21 +00:00
<MudTooltip Text="@T("Delete")">
2026-01-09 11:45:21 +00:00
<MudIconButton Color="Color.Error" Icon="@Icons.Material.Filled.Delete" OnClick="@(() => this.DeleteLLMProvider(context))"/>
2025-06-01 19:14:21 +00:00
</MudTooltip>
}
2025-03-29 17:40:17 +00:00
</MudStack>
2025-01-05 14:11:15 +00:00
</MudTd>
</RowTemplate>
</MudTable>
@if(this.SettingsManager.ConfigurationData.Providers.Count == 0)
{
2025-04-27 07:06:05 +00:00
<MudText Typo="Typo.h6" Class="mt-3">
@T("No providers configured yet.")
</MudText>
2025-01-05 14:11:15 +00:00
}
2025-08-09 17:29:43 +00:00
<LockableButton Text="@T("Add Provider")" IsLocked="@(() => !this.SettingsManager.ConfigurationData.App.AllowUserToAddProvider)" Icon="@Icons.Material.Filled.AddRoad" OnClickAsync="@this.AddLLMProvider" Class="mt-3" />
2026-02-07 21:59:41 +00:00
</ExpansionPanel>