mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-02 16:47:21 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
84 lines
5.9 KiB
Plaintext
84 lines
5.9 KiB
Plaintext
@using AIStudio.Settings.DataModel
|
|
@inherits MSGComponentBase
|
|
|
|
<WorkspaceNameField WorkspaceName="@this.WorkspaceName" WorkspaceNameChanged="@this.SetWorkspaceName" SelectLabel="@T("Existing workspace (Optional)")" Label="@T("Workspace name (Optional)")" HelperText="@T("Choose an existing workspace or enter a name that should be created when the launcher is opened.")" AdornmentIcon="@(this.OpensTemporaryChat ? Icons.Material.Filled.Timer : Icons.Material.Filled.CreateNewFolder)" AdornmentIconSize="Size.Small" TextFieldClass="mb-1"/>
|
|
|
|
@* The tile behaves differently with and without a workspace, so the form says which of the two is
|
|
chosen right now instead of only explaining that both are possible. *@
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
|
@(this.OpensTemporaryChat
|
|
? T("Without a workspace, the tile opens a disappearing chat: it belongs to no workspace and is deleted according to your workspace maintenance settings.")
|
|
: T("The tile opens its chat in this workspace and creates the workspace when it does not exist yet."))
|
|
</MudText>
|
|
@if (this.OpensTemporaryChat && this.SettingsManager.GetChatTemplateWorkspaceName(this.SelectedChatTemplate) is { } templateWorkspaceName)
|
|
{
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
|
@string.Format(T("The chosen chat template keeps its chats in the workspace '{0}', so the tile opens its chat there instead. A workspace entered here wins over the one of the template."), templateWorkspaceName)
|
|
</MudText>
|
|
}
|
|
<MudSelect T="string" Value="@this.ProviderId" ValueChanged="@this.SetProviderId" Label="@T("Chat provider")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3 rounded-lg" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.SmartToy">
|
|
<MudSelectItem T="string" Value="@string.Empty">@T("Use chat default")</MudSelectItem>
|
|
@foreach (var provider in this.SettingsManager.GetConfidentProviders(Components.CHAT))
|
|
{
|
|
<MudSelectItem T="string" Value="@provider.Id">
|
|
<ProviderLabel ProviderSettings="@provider" Text="@provider.InstanceName"/>
|
|
</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
@if (this.SelectedChatTemplate.ProviderId is not null)
|
|
{
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
|
@T("The chosen chat template preselects a provider of its own, and it wins over a selection made here as long as that provider can be used for chats.")
|
|
</MudText>
|
|
}
|
|
<MudSelect T="string" Value="@this.ProfileId" ValueChanged="@this.SetProfileId" Label="@T("Chat profile")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3 rounded-lg" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person">
|
|
<MudSelectItem T="string" Value="@string.Empty">@T("Use chat default")</MudSelectItem>
|
|
<MudSelectItem T="string" Value="@Guid.Empty.ToString()">@T("Use no profile")</MudSelectItem>
|
|
@foreach (var profile in this.SettingsManager.ConfigurationData.Profiles)
|
|
{
|
|
<MudSelectItem T="string" Value="@profile.Id">@profile.GetSafeName()</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
@if (this.SelectedChatTemplate is { AllowProfileUsage: true, ProfileId: not null })
|
|
{
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
|
@T("The chosen chat template preselects a profile of its own, and it wins over a selection made here as long as that profile exists.")
|
|
</MudText>
|
|
}
|
|
<MudSelect T="string" Value="@this.ChatTemplateId" ValueChanged="@this.SetChatTemplateId" Label="@T("Chat template")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3 rounded-lg" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Article">
|
|
<MudSelectItem T="string" Value="@string.Empty">@T("Use chat default")</MudSelectItem>
|
|
<MudSelectItem T="string" Value="@Guid.Empty.ToString()">@T("Use no chat template")</MudSelectItem>
|
|
@foreach (var chatTemplate in this.SettingsManager.ConfigurationData.ChatTemplates)
|
|
{
|
|
<MudSelectItem T="string" Value="@chatTemplate.Id">@chatTemplate.GetSafeName()</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
@* Without the RAG preview, the chat uses no data sources, so there is nothing to choose here. A
|
|
selection made before stays with the launcher and counts once RAG is switched on again: *@
|
|
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
|
|
{
|
|
<MudSelect T="string" Label="@T("Data sources (Optional)")" MultiSelection="@true" SelectedValues="@this.DataSourceIds" SelectedValuesChanged="@this.SetDataSourceIds" MultiSelectionTextFunc="@this.GetSelectedDataSourceText" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3 rounded-lg" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.DATABASE">
|
|
@foreach (var dataSource in this.SettingsManager.ConfigurationData.DataSources)
|
|
{
|
|
<MudSelectItem T="string" Value="@dataSource.Id">@dataSource.Name</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
|
|
@* A chat template wins over what is chosen here, so the form says so before somebody picks
|
|
something which would never take effect: *@
|
|
@if (this.SelectedChatTemplate.DataSourceOptions is not null)
|
|
{
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
|
|
@T("The chosen chat template brings data sources of its own, and those win over a selection made here. Only a template can also leave the choice of sources to the AI, which is why it decides this on its own.")
|
|
</MudText>
|
|
}
|
|
}
|
|
|
|
<ToolSelectionField Component="Components.CHAT" SelectedToolIds="@this.ToolIds" SelectedToolIdsChanged="@this.SetToolIds" Label="@T("Tools (Optional)")" Help="@T("These tools are preselected when the chat opens. Users can change the selection in the chat, and every tool has to meet the confidence requirements of the provider in use.")"/>
|
|
|
|
@if (this.SelectedChatTemplate.ToolIds is not null)
|
|
{
|
|
<MudText Typo="Typo.body2" Class="mud-text-secondary">
|
|
@T("The chosen chat template brings tools of its own, and those win over a selection made here.")
|
|
</MudText>
|
|
} |