Renamed the settings of AI tasks (#1239)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-27 12:08:00 +01:00
1 parent d19d3d431b
commit a117074972
109 files changed
+3929 -538

No files matched your search

@@ -155,7 +155,7 @@
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
{
<DataSourceSelection @ref="@this.dataSourceSelectionComponent" LLMProvider="@this.Provider" DataSourceOptions="@this.GetCurrentDataSourceOptions()" DataSourceOptionsChanged="@this.DataSourceOptionsWereChanged" DataSourcesAISelected="@this.GetAgentSelectedDataSources()" ReadOnly="@this.IsCurrentChatStreaming" ReadOnlyMessage="@TA("Data source changes are locked while a response is running. Your current selection is shown below and applies again from the next message once the run is finished.")"/>
<DataSourceSelection @ref="@this.dataSourceSelectionComponent" LLMProvider="@this.Provider" DataSourceOptions="@this.GetCurrentDataSourceOptions()" DataSourceOptionsChanged="@this.DataSourceOptionsWereChanged" DataSourcesAISelected="@this.GetAISelectedDataSources()" ReadOnly="@this.IsCurrentChatStreaming" ReadOnlyMessage="@TA("Data source changes are locked while a response is running. Your current selection is shown below and applies again from the next message once the run is finished.")"/>
}
@if (this.SettingsManager.ConfigurationData.Confidence.ShowProviderConfidence)
@@ -1247,7 +1247,7 @@ public partial class ChatComponent : MSGComponentBase
await this.ApplyUpdatedAutomaticDataSourceOptionsAfterConfigurationChange();
}
private IReadOnlyList<DataSourceAgentSelected> GetAgentSelectedDataSources()
private IReadOnlyList<DataSourceAISelected> GetAISelectedDataSources()
{
if (this.ChatThread is null)
return [];
@@ -6,7 +6,7 @@ namespace AIStudio.Components;
/// <summary>
/// A data structure to combine the data source and the underlying AI decision.
/// </summary>
public sealed class DataSourceAgentSelected
public sealed class DataSourceAISelected
{
/// <summary>
/// The data source.
@@ -76,7 +76,7 @@
}
@* With Semantic Search, no AI operation takes part: nothing would validate the retrieved data. *@
@if (this.AllowsAutomaticSelection && this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation && !this.IsSemanticSearchEffective)
@if (this.AllowsAutomaticSelection && this.SettingsManager.ConfigurationData.RetrievalContextValidation.EnableRetrievalContextValidation && !this.IsSemanticSearchEffective)
{
<MudTextSwitch Label="@T("AI-based data validation")" Value="@this.aiBasedValidation" LabelOn="@T("Yes, let the AI validate & filter the retrieved data.")" LabelOff="@T("No, use all data retrieved from the data sources.")" ValueChanged="@this.ValidationModeChanged" Dense="@true" Disabled="@this.ReadOnly"/>
}
@@ -137,7 +137,7 @@
@if (!this.IsSemanticSearchEffective && this.DataSourcesAISelected.Count > 0)
{
<ExpansionPanel HeaderIcon="@AppIcons.AI_SELECTED_DATA_SOURCES" IconSize="Size.Small" HeaderTypo="Typo.subtitle1" HeaderClass="expansion-panel-header-compact" HeaderText="@T("AI-Selected Data Sources")">
<MudList T="DataSourceAgentSelected" Dense="@true" Class="data-source-rows" SelectionMode="MudBlazor.SelectionMode.MultiSelection" ReadOnly="@true" SelectedValues="@this.GetSelectedDataSourcesWithAI()" Style="max-height: 14em;">
<MudList T="DataSourceAISelected" Dense="@true" Class="data-source-rows" SelectionMode="MudBlazor.SelectionMode.MultiSelection" ReadOnly="@true" SelectedValues="@this.GetSelectedDataSourcesWithAI()" Style="max-height: 14em;">
@foreach (var source in this.DataSourcesAISelected)
{
<MudListItem Value="@source">
@@ -29,7 +29,7 @@ public partial class DataSourceSelection : MSGComponentBase
public EventCallback<DataSourceOptions> DataSourceOptionsChanged { get; set; }
[Parameter]
public IReadOnlyList<DataSourceAgentSelected> DataSourcesAISelected { get; set; } = [];
public IReadOnlyList<DataSourceAISelected> DataSourcesAISelected { get; set; } = [];
[Parameter]
public string ConfigurationHeaderMessage { get; set; } = string.Empty;
@@ -230,13 +230,13 @@ public partial class DataSourceSelection : MSGComponentBase
private SelectionMode GetListSelectionMode() => this.aiBasedSourceSelection ? MudBlazor.SelectionMode.SingleSelection : MudBlazor.SelectionMode.MultiSelection;
private IReadOnlyCollection<DataSourceAgentSelected> GetSelectedDataSourcesWithAI() => this.DataSourcesAISelected.Where(n => n.Selected).ToList();
private IReadOnlyCollection<DataSourceAISelected> GetSelectedDataSourcesWithAI() => this.DataSourcesAISelected.Where(n => n.Selected).ToList();
private string GetAIReasoning(DataSourceAgentSelected source) => $"AI reasoning (confidence {source.AIDecision.Confidence:P0}): {source.AIDecision.Reason}";
private string GetAIReasoning(DataSourceAISelected source) => $"AI reasoning (confidence {source.AIDecision.Confidence:P0}): {source.AIDecision.Reason}";
private string GetConfidenceIconStyle(IInternalDataSource source) => $"{source.ConfidenceLevel.SetColorStyle(this.SettingsManager)} flex-shrink: 0;";
public void ChangeOptionWithoutSaving(DataSourceOptions options, IReadOnlyList<DataSourceAgentSelected>? aiSelectedDataSources = null)
public void ChangeOptionWithoutSaving(DataSourceOptions options, IReadOnlyList<DataSourceAISelected>? aiSelectedDataSources = null)
{
this.DataSourceOptions = options;
this.DataSourcesAISelected = aiSelectedDataSources ?? [];
@@ -561,7 +561,7 @@ public partial class DataSourceSelection : MSGComponentBase
switch (triggeredEvent)
{
case Event.RAG_AUTO_DATA_SOURCES_SELECTED:
if(data is IReadOnlyList<DataSourceAgentSelected> aiSelectedDataSources)
if(data is IReadOnlyList<DataSourceAISelected> aiSelectedDataSources)
this.DataSourcesAISelected = aiSelectedDataSources;
this.StateHasChanged();
@@ -1,9 +1,9 @@
@inherits MSGComponentBase
<MudPaper Class="pa-3 mb-3 border-dashed border rounded-lg">
<MudTextSwitch Label="@T("Read content from web?")" Disabled="@this.AgentIsRunning" Value="@this.Preselect" ValueChanged="@this.ShowWebContentReaderChanged" LabelOn="@T("Show web content options")" LabelOff="@T("Hide web content options")" />
<MudTextSwitch Label="@T("Read content from web?")" Disabled="@this.CleanerIsRunning" Value="@this.Preselect" ValueChanged="@this.ShowWebContentReaderChanged" LabelOn="@T("Show web content options")" LabelOff="@T("Hide web content options")" />
@if (this.Preselect)
{
<MudTextSwitch Label="@T("Clean up the content with AI?")" Value="@this.PreselectContentCleanerAgent" ValueChanged="@this.UseContentCleanerAgentChanged" Disabled="@this.AgentIsRunning" LabelOn="@T("The text content cleaner, an AI task, extracts the main content, tries to remove advertisements and other clutter, and tries to turn relative links into absolute ones, so that they work.")" LabelOff="@T("No content cleaning")" />
<MudTextSwitch Label="@T("Clean up the content with AI?")" Value="@this.PreselectContentCleaner" ValueChanged="@this.UseContentCleanerChanged" Disabled="@this.CleanerIsRunning" LabelOn="@T("The text content cleaner, an AI task, extracts the main content, tries to remove advertisements and other clutter, and tries to turn relative links into absolute ones, so that they work.")" LabelOff="@T("No content cleaning")" />
@if (this.ContentCleanerHint is { } contentCleanerHint)
{
<MudText Typo="Typo.body2" Color="Color.Error" Class="mb-3">
@@ -11,12 +11,12 @@
</MudText>
}
<MudStack Row="@true" AlignItems="@AlignItems.Baseline" Class="mb-3">
<MudTextField T="string" Label="@T("URL from which to load the content")" Value="@this.URL" ValueChanged="@this.URLValueChanged" Validation="@this.ValidateURL" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LINK" Placeholder="https://..." HelperText="@TA("Loads the content from your URL. Does not work when the content is hidden behind a paywall.")" Variant="Variant.Outlined" Immediate="@true" Disabled="@this.AgentIsRunning"/>
<MudButton Disabled="@(!this.IsReady || this.AgentIsRunning)" Variant="Variant.Filled" Size="Size.Large" Color="Color.Primary" StartIcon="@AppIcons.DOWNLOAD" OnClick="@this.LoadFromWeb">
<MudTextField T="string" Label="@T("URL from which to load the content")" Value="@this.URL" ValueChanged="@this.URLValueChanged" Validation="@this.ValidateURL" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LINK" Placeholder="https://..." HelperText="@TA("Loads the content from your URL. Does not work when the content is hidden behind a paywall.")" Variant="Variant.Outlined" Immediate="@true" Disabled="@this.CleanerIsRunning"/>
<MudButton Disabled="@(!this.IsReady || this.CleanerIsRunning)" Variant="Variant.Filled" Size="Size.Large" Color="Color.Primary" StartIcon="@AppIcons.DOWNLOAD" OnClick="@this.LoadFromWeb">
@T("Fetch")
</MudButton>
</MudStack>
@if (this.AgentIsRunning)
@if (this.CleanerIsRunning)
{
<ProcessComponent T="ReadWebContentSteps" StepValue="@this.processStep" ShowProgressAnimation="@true"/>
}
@@ -58,10 +58,10 @@ public partial class ReadWebContent : MSGComponentBase
public AIStudio.Settings.Provider ProviderSettings { get; set; } = AIStudio.Settings.Provider.NONE;
[Parameter]
public bool AgentIsRunning { get; set; }
public bool CleanerIsRunning { get; set; }
[Parameter]
public EventCallback<bool> AgentIsRunningChanged { get; set; }
public EventCallback<bool> CleanerIsRunningChanged { get; set; }
[Parameter]
public bool Preselect { get; set; }
@@ -70,10 +70,10 @@ public partial class ReadWebContent : MSGComponentBase
public EventCallback<bool> PreselectChanged { get; set; }
[Parameter]
public bool PreselectContentCleanerAgent { get; set; }
public bool PreselectContentCleaner { get; set; }
[Parameter]
public EventCallback<bool> PreselectContentCleanerAgentChanged { get; set; }
public EventCallback<bool> PreselectContentCleanerChanged { get; set; }
private readonly Process<ReadWebContentSteps> process = Process<ReadWebContentSteps>.INSTANCE;
private ProcessStepValue processStep;
@@ -183,7 +183,7 @@ public partial class ReadWebContent : MSGComponentBase
markdown = retrievedPage.ExtractedPage.Markdown;
markdown = await this.PromptInjectionGuardService.SanitizeAsync(markdown, PromptInjectionSource.WebContent(this.URL));
if (this.PreselectContentCleanerAgent)
if (this.PreselectContentCleaner)
{
var request = new TextContentCleaningRequest(markdown, this.URL);
var choice = this.ProviderResolver.Resolve(this.TextContentCleaning, request, TextContentCleaningOperation.GetProviderSettings(this.SettingsManager), GetCleanerProviderOptions(this.SettingsManager, this.ProviderSettings));
@@ -199,8 +199,8 @@ public partial class ReadWebContent : MSGComponentBase
else
{
this.processStep = this.process[ReadWebContentSteps.CLEANING];
this.AgentIsRunning = true;
await this.AgentIsRunningChanged.InvokeAsync(this.AgentIsRunning);
this.CleanerIsRunning = true;
await this.CleanerIsRunningChanged.InvokeAsync(this.CleanerIsRunning);
this.StateHasChanged();
var result = await this.TextContentCleaning.RunAsync(request, new(choice.Provider));
@@ -209,19 +209,19 @@ public partial class ReadWebContent : MSGComponentBase
await this.MessageBus.SendWarning(new(AppIcons.AI_OPERATION, T("The content was loaded, but not cleaned: the model of the content cleaner gave no answer.")));
this.processStep = this.process[ReadWebContentSteps.DONE];
this.AgentIsRunning = false;
await this.AgentIsRunningChanged.InvokeAsync(this.AgentIsRunning);
this.CleanerIsRunning = false;
await this.CleanerIsRunningChanged.InvokeAsync(this.CleanerIsRunning);
this.StateHasChanged();
}
}
}
catch (Exception exception)
{
if (this.AgentIsRunning)
if (this.CleanerIsRunning)
{
this.processStep = this.process[ReadWebContentSteps.START];
this.AgentIsRunning = false;
await this.AgentIsRunningChanged.InvokeAsync(this.AgentIsRunning);
this.CleanerIsRunning = false;
await this.CleanerIsRunningChanged.InvokeAsync(this.CleanerIsRunning);
this.StateHasChanged();
}
@@ -269,9 +269,9 @@ public partial class ReadWebContent : MSGComponentBase
await this.PreselectChanged.InvokeAsync(state);
}
private async Task UseContentCleanerAgentChanged(bool state)
private async Task UseContentCleanerChanged(bool state)
{
await this.PreselectContentCleanerAgentChanged.InvokeAsync(state);
await this.PreselectContentCleanerChanged.InvokeAsync(state);
}
/// <summary>
@@ -290,7 +290,7 @@ public partial class ReadWebContent : MSGComponentBase
{
get
{
if(!this.PreselectContentCleanerAgent || this.cleanerChoice.HasProvider)
if(!this.PreselectContentCleaner || this.cleanerChoice.HasProvider)
return null;
return this.cleanerChoice.FallbackIssue switch
@@ -8,7 +8,7 @@
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Require a security audit before activating external Assistants?")" LabelOn="@T("External Assistants must be audited before activation")" LabelOff="@T("External Assistant can be activated without an audit")" State="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.RequireAuditBeforeActivation)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.AssistantPluginAudit.RequireAuditBeforeActivation = updatedState)" ConfirmChange="@this.ConfirmRequireAuditBeforeActivationChange" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.RequireAuditBeforeActivation, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AGENT_ASSISTANT_PLUGIN_AUDIT" EmptySelectionText="@T("Use the app default, otherwise the model chosen when auditing")" Data="@this.AvailableLLMProvidersFunc()" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AssistantPluginAudit.PreselectedAgentProvider = selectedValue)" HelpText="@(() => TA("Optionally choose a dedicated provider for assistant plugin audits. When left empty, AI Studio uses the app-wide default provider, or else the model you choose when auditing."))" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.PreselectedAgentProvider, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AI_TASK_ASSISTANT_PLUGIN_AUDIT" EmptySelectionText="@T("Use the app default, otherwise the model chosen when auditing")" Data="@this.AvailableLLMProvidersFunc()" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AssistantPluginAudit.PreselectedProvider = selectedValue)" HelpText="@(() => TA("Optionally choose a dedicated provider for assistant plugin audits. When left empty, AI Studio uses the app-wide default provider, or else the model you choose when auditing."))" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
<ConfigurationSelect OptionDescription="@T("Minimum required audit level")" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumLevel)" Data="@ConfigurationSelectDataFactory.GetAssistantAuditLevelsData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AssistantPluginAudit.MinimumLevel = selectedValue)" OptionHelp="@T("External Assistants rated below this audit level are treated as insufficiently reviewed.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.MinimumLevel, out var meta) && meta.IsLocked"/>
<ConfigurationOption OptionDescription="@T("Block activation below the minimum Audit-Level?")" LabelOn="@T("Activation is blocked below the minimum Audit-Level")" LabelOff="@T("Users may still activate plugins below the minimum Audit-Level")" State="@(() => this.SettingsManager.ConfigurationData.AssistantPluginAudit.BlockActivationBelowMinimum)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.AssistantPluginAudit.BlockActivationBelowMinimum = updatedState)"
OptionHelp="@TA("The audit shows you all security risks and information. If you consider this rating false at your own discretion, you can decide to install it anyway (not recommended).")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AssistantPluginAudit, x => x.BlockActivationBelowMinimum, out var meta) && meta.IsLocked"/>
@@ -7,7 +7,7 @@ using DialogOptions = AIStudio.Dialogs.DialogOptions;
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAgentAssistantAudit : SettingsPanelBase
public partial class SettingsPanelAITaskAssistantAudit : SettingsPanelBase
{
[Inject]
private AssistantPluginAuditService AssistantPluginAuditService { get; init; } = null!;
@@ -0,0 +1,13 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.TEXT_CONTENT_CLEANER" HeaderText="@T("AI Task: Text Content Cleaner")">
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("When an assistant loads content from the web, a model can clean it up: it extracts the main content, removes advertisements and other irrelevant things, and attempts to convert relative links into absolute links so that they can be used.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Preselect text content cleaner options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task and the confidence it needs. Without a preselected model, AI Studio uses the model of the assistant.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.PreselectOptions, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AI_TASK_TEXT_CONTENT_CLEANER" EmptySelectionText="@T("Use the model of the assistant")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
</ExpansionPanel>
@@ -0,0 +1,3 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAITaskContentCleaner : SettingsPanelBase;
@@ -0,0 +1,13 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.DATA_SOURCE_SELECTION" HeaderText="@T("AI Task: Data Source Selection")">
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("In classic RAG, which searches the data sources with every message, a model first selects the data sources which fit the current prompt.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Preselect data source selection options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task and the confidence it needs. Without a preselected model, AI Studio uses the model of the chat.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.DataSourceSelection, x => x.PreselectOptions, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.DataSourceSelection.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.DataSourceSelection.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.DataSourceSelection, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AI_TASK_DATA_SOURCE_SELECTION" EmptySelectionText="@T("Use the model of the chat")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.DataSourceSelection.PreselectedProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.DataSourceSelection, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
</ExpansionPanel>
@@ -0,0 +1,3 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAITaskDataSourceSelection : SettingsPanelBase;
@@ -0,0 +1,18 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.RETRIEVAL_CONTEXT_VALIDATION" HeaderText="@T("AI Task: Retrieval Context Validation")">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@TA("In classic RAG, a model checks each retrieval context, i.e., each passage found in the data sources, whether it fits the current prompt. There can be many of them, so you might want to use a cheap and fast model for this job. When using a local or self-hosted model, look for a small (e.g., 3B) and fast one.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Validate the retrieval contexts?")" LabelOn="@T("Each retrieval context is validated")" LabelOff="@T("No validation is performed")" State="@(() => this.SettingsManager.ConfigurationData.RetrievalContextValidation.EnableRetrievalContextValidation)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.RetrievalContextValidation.EnableRetrievalContextValidation = updatedState)" OptionHelp="@T("When enabled, a model checks each retrieval context of classic RAG, whether it makes sense for the given prompt.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.RetrievalContextValidation, x => x.EnableRetrievalContextValidation, out var meta) && meta.IsLocked"/>
@if (this.SettingsManager.ConfigurationData.RetrievalContextValidation.EnableRetrievalContextValidation)
{
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect retrieval context validation options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task, the confidence it needs, and how many validations run simultaneously. Without a preselected model, AI Studio uses the model of the chat.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.RetrievalContextValidation, x => x.PreselectOptions, out var meta) && meta.IsLocked"/>
<ConfigurationSlider T="int" OptionDescription="@T("How many validations should run simultaneously?")" Min="1" Max="100" Step="1" Unit="@T("validations")" Disabled="@(() => !this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions)" Value="@(() => this.SettingsManager.ConfigurationData.RetrievalContextValidation.NumParallelValidations)" ValueUpdate="@(updatedValue => this.SettingsManager.ConfigurationData.RetrievalContextValidation.NumParallelValidations = updatedValue)" OptionHelp="@TA("Each validation is a request of its own, so more simultaneous validations mean as many simultaneous requests. Some providers limit the number of requests per minute. When you are unsure, choose a low setting between 1 and 6 validations.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.RetrievalContextValidation, x => x.NumParallelValidations, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.RetrievalContextValidation.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.RetrievalContextValidation.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.RetrievalContextValidation, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AI_TASK_RETRIEVAL_CONTEXT_VALIDATION" EmptySelectionText="@T("Use the model of the chat")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.RetrievalContextValidation.PreselectedProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.RetrievalContextValidation, x => x.PreselectedProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
}
</ExpansionPanel>
@@ -0,0 +1,3 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAITaskRetrievalContextValidation : SettingsPanelBase;
@@ -1,13 +0,0 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.TEXT_CONTENT_CLEANER" HeaderText="@T("AI Task: Text Content Cleaner")">
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("When an assistant loads content from the web, a model can clean it up: it extracts the main content, removes advertisements and other irrelevant things, and attempts to convert relative links into absolute links so that they can be used.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Preselect text content cleaner options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task and the confidence it needs. Without a preselected model, AI Studio uses the model of the assistant.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.PreselectAgentOptions, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AGENT_TEXT_CONTENT_CLEANER" EmptySelectionText="@T("Use the model of the assistant")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectAgentOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.TextContentCleaner.PreselectedAgentProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.TextContentCleaner, x => x.PreselectedAgentProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
</ExpansionPanel>
@@ -1,3 +0,0 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAgentContentCleaner : SettingsPanelBase;
@@ -1,13 +0,0 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.DATA_SOURCE_SELECTION" HeaderText="@T("AI Task: Data Source Selection")">
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@T("In classic RAG, which searches the data sources with every message, a model first selects the data sources which fit the current prompt.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Preselect data source selection options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectAgentOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectAgentOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task and the confidence it needs. Without a preselected model, AI Studio uses the model of the chat.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentDataSourceSelection, x => x.PreselectAgentOptions, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectAgentOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentDataSourceSelection, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AGENT_DATA_SOURCE_SELECTION" EmptySelectionText="@T("Use the model of the chat")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectAgentOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AgentDataSourceSelection.PreselectedAgentProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentDataSourceSelection, x => x.PreselectedAgentProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
</ExpansionPanel>
@@ -1,3 +0,0 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAgentDataSourceSelection : SettingsPanelBase;
@@ -1,18 +0,0 @@
@using AIStudio.Settings
@inherits SettingsPanelBase
<ExpansionPanel HeaderIcon="@AppIcons.RETRIEVAL_CONTEXT_VALIDATION" HeaderText="@T("AI Task: Retrieval Context Validation")">
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
@TA("In classic RAG, a model checks each retrieval context, i.e., each passage found in the data sources, whether it fits the current prompt. There can be many of them, so you might want to use a cheap and fast model for this job. When using a local or self-hosted model, look for a small (e.g., 3B) and fast one.")
</MudJustifiedText>
<ConfigurationOption OptionDescription="@T("Validate the retrieval contexts?")" LabelOn="@T("Each retrieval context is validated")" LabelOff="@T("No validation is performed")" State="@(() => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation = updatedState)" OptionHelp="@T("When enabled, a model checks each retrieval context of classic RAG, whether it makes sense for the given prompt.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentRetrievalContextValidation, x => x.EnableRetrievalContextValidation, out var meta) && meta.IsLocked"/>
@if (this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation)
{
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect retrieval context validation options?")" LabelOn="@T("Options are preselected")" LabelOff="@T("No options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions = updatedState)" OptionHelp="@TA("When enabled, you can preselect the model for this task, the confidence it needs, and how many validations run simultaneously. Without a preselected model, AI Studio uses the model of the chat.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentRetrievalContextValidation, x => x.PreselectAgentOptions, out var meta) && meta.IsLocked"/>
<ConfigurationSlider T="int" OptionDescription="@T("How many validations should run simultaneously?")" Min="1" Max="100" Step="1" Unit="@T("validations")" Disabled="@(() => !this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions)" Value="@(() => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.NumParallelValidations)" ValueUpdate="@(updatedValue => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.NumParallelValidations = updatedValue)" OptionHelp="@TA("Each validation is a request of its own, so more simultaneous validations mean as many simultaneous requests. Some providers limit the number of requests per minute. When you are unsure, choose a low setting between 1 and 6 validations.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentRetrievalContextValidation, x => x.NumParallelValidations, out var meta) && meta.IsLocked"/>
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.MinimumProviderConfidence = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentRetrievalContextValidation, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
<ConfigurationProviderSelection Component="Components.AGENT_RETRIEVAL_CONTEXT_VALIDATION" EmptySelectionText="@T("Use the model of the chat")" Data="@this.AvailableLLMProvidersFunc()" Disabled="@(() => !this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectAgentOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectedAgentProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.PreselectedAgentProvider = selectedValue)" IsLocked="() => ManagedConfiguration.TryGet(x => x.AgentRetrievalContextValidation, x => x.PreselectedAgentProvider, out var meta) && meta.IsLocked"/>
</MudPaper>
}
</ExpansionPanel>
@@ -1,3 +0,0 @@
namespace AIStudio.Components.Settings;
public partial class SettingsPanelAgentRetrievalContextValidation : SettingsPanelBase;