mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 19:19:47 +00:00
Implemented preselection of text summarizer assistant settings
This commit is contained in:
parent
49088984ce
commit
50beb9e35b
@ -1,5 +1,6 @@
|
|||||||
@page "/settings"
|
@page "/settings"
|
||||||
@using AIStudio.Components.Pages.Coding
|
@using AIStudio.Components.Pages.Coding
|
||||||
|
@using AIStudio.Components.Pages.TextSummarizer
|
||||||
@using AIStudio.Provider
|
@using AIStudio.Provider
|
||||||
@using AIStudio.Settings
|
@using AIStudio.Settings
|
||||||
@using AIStudio.Tools
|
@using AIStudio.Tools
|
||||||
@ -112,5 +113,21 @@
|
|||||||
}
|
}
|
||||||
<ConfigurationProviderSelection Data="@this.availableProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectCodingOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedCodingProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedCodingProvider = selectedValue)"/>
|
<ConfigurationProviderSelection Data="@this.availableProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectCodingOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedCodingProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedCodingProvider = selectedValue)"/>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
|
|
||||||
|
<MudText Typo="Typo.h5" Class="mb-3">Text Summarizer Options</MudText>
|
||||||
|
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
|
||||||
|
<ConfigurationOption OptionDescription="Preselect summarizer options?" LabelOn="Summarizer options are preselected" LabelOff="No summarizer options are preselected" State="@(() => this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions = updatedState)" OptionHelp="When enabled, you can preselect the text summarizer options. This is might be useful when you prefer a specific language, complexity, or LLM."/>
|
||||||
|
<ConfigurationSelect OptionDescription="Preselect the target language" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerTargetLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerTargetLanguage = selectedValue)" OptionHelp="Which target language should be preselected?"/>
|
||||||
|
@if (this.SettingsManager.ConfigurationData.PreselectedTextSummarizerTargetLanguage is CommonLanguages.OTHER)
|
||||||
|
{
|
||||||
|
<ConfigurationText OptionDescription="Preselect another target language" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" Icon="@Icons.Material.Filled.Translate" Text="@(() => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerOtherLanguage)" TextUpdate="@(updatedText => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerOtherLanguage = updatedText)"/>
|
||||||
|
}
|
||||||
|
<ConfigurationSelect OptionDescription="Preselect the summarizer complexity" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerComplexity)" Data="@ConfigurationSelectDataFactory.GetComplexityData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerComplexity = selectedValue)" OptionHelp="Which summarizer complexity should be preselected?"/>
|
||||||
|
@if(this.SettingsManager.ConfigurationData.PreselectedTextSummarizerComplexity is Complexity.SCIENTIFIC_LANGUAGE_OTHER_EXPERTS)
|
||||||
|
{
|
||||||
|
<ConfigurationText OptionDescription="Preselect your expertise" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" Icon="@Icons.Material.Filled.Person" Text="@(() => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerExpertInField)" TextUpdate="@(updatedText => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerExpertInField = updatedText)"/>
|
||||||
|
}
|
||||||
|
<ConfigurationProviderSelection Data="@this.availableProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.PreselectedTextSummarizerProvider = selectedValue)"/>
|
||||||
|
</MudPaper>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
</InnerScrolling>
|
</InnerScrolling>
|
@ -29,6 +29,24 @@ public partial class AssistantTextSummarizer : AssistantBaseCore
|
|||||||
private Complexity selectedComplexity;
|
private Complexity selectedComplexity;
|
||||||
private string expertInField = string.Empty;
|
private string expertInField = string.Empty;
|
||||||
|
|
||||||
|
#region Overrides of ComponentBase
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
if(this.SettingsManager.ConfigurationData.PreselectTextSummarizerOptions)
|
||||||
|
{
|
||||||
|
this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.PreselectedTextSummarizerTargetLanguage;
|
||||||
|
this.customTargetLanguage = this.SettingsManager.ConfigurationData.PreselectedTextSummarizerOtherLanguage;
|
||||||
|
this.selectedComplexity = this.SettingsManager.ConfigurationData.PreselectedTextSummarizerComplexity;
|
||||||
|
this.expertInField = this.SettingsManager.ConfigurationData.PreselectedTextSummarizerExpertInField;
|
||||||
|
this.providerSettings = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.SettingsManager.ConfigurationData.PreselectedTextSummarizerProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private string? ValidatingText(string text)
|
private string? ValidatingText(string text)
|
||||||
{
|
{
|
||||||
if(string.IsNullOrWhiteSpace(text))
|
if(string.IsNullOrWhiteSpace(text))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using AIStudio.Components.Pages.Coding;
|
using AIStudio.Components.Pages.Coding;
|
||||||
using AIStudio.Components.Pages.IconFinder;
|
using AIStudio.Components.Pages.IconFinder;
|
||||||
|
using AIStudio.Components.Pages.TextSummarizer;
|
||||||
using AIStudio.Settings.DataModel;
|
using AIStudio.Settings.DataModel;
|
||||||
using AIStudio.Tools;
|
using AIStudio.Tools;
|
||||||
|
|
||||||
@ -76,4 +77,10 @@ public static class ConfigurationSelectDataFactory
|
|||||||
foreach (var language in Enum.GetValues<CommonCodingLanguages>())
|
foreach (var language in Enum.GetValues<CommonCodingLanguages>())
|
||||||
yield return new(language.Name(), language);
|
yield return new(language.Name(), language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<ConfigurationSelectData<Complexity>> GetComplexityData()
|
||||||
|
{
|
||||||
|
foreach (var complexity in Enum.GetValues<Complexity>())
|
||||||
|
yield return new(complexity.Name(), complexity);
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using AIStudio.Components.Pages.Coding;
|
using AIStudio.Components.Pages.Coding;
|
||||||
using AIStudio.Components.Pages.IconFinder;
|
using AIStudio.Components.Pages.IconFinder;
|
||||||
|
using AIStudio.Components.Pages.TextSummarizer;
|
||||||
using AIStudio.Tools;
|
using AIStudio.Tools;
|
||||||
|
|
||||||
namespace AIStudio.Settings.DataModel;
|
namespace AIStudio.Settings.DataModel;
|
||||||
@ -154,4 +155,38 @@ public sealed class Data
|
|||||||
public string PreselectedCodingProvider { get; set; } = string.Empty;
|
public string PreselectedCodingProvider { get; set; } = string.Empty;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Assistant: Text Summarizer Settings
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect any text summarizer options?
|
||||||
|
/// </summary>
|
||||||
|
public bool PreselectTextSummarizerOptions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect the target language?
|
||||||
|
/// </summary>
|
||||||
|
public CommonLanguages PreselectedTextSummarizerTargetLanguage { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect any other language?
|
||||||
|
/// </summary>
|
||||||
|
public string PreselectedTextSummarizerOtherLanguage { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect the complexity?
|
||||||
|
/// </summary>
|
||||||
|
public Complexity PreselectedTextSummarizerComplexity { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect any expertise in a field?
|
||||||
|
/// </summary>
|
||||||
|
public string PreselectedTextSummarizerExpertInField { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Preselect a text summarizer provider?
|
||||||
|
/// </summary>
|
||||||
|
public string PreselectedTextSummarizerProvider { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -2,6 +2,7 @@
|
|||||||
- Added the possibility to provide default options for the icon finder assistant
|
- Added the possibility to provide default options for the icon finder assistant
|
||||||
- Added the possibility to provide default options for the translation assistant
|
- Added the possibility to provide default options for the translation assistant
|
||||||
- Added the possibility to provide default options for the coding assistant
|
- Added the possibility to provide default options for the coding assistant
|
||||||
|
- Added the possibility to provide default options for the text summarizer assistant
|
||||||
- Improved switch component for settings: when an option is enabled, the switch is using a different color
|
- Improved switch component for settings: when an option is enabled, the switch is using a different color
|
||||||
- Fixed the applying of spellchecking settings to the single-line dialog
|
- Fixed the applying of spellchecking settings to the single-line dialog
|
||||||
- Restructured the layout of the settings page
|
- Restructured the layout of the settings page
|
||||||
|
Loading…
Reference in New Issue
Block a user