Add option "Preselect important aspects"

This commit is contained in:
hart_s3 2026-02-24 13:43:14 +01:00
parent 6d00f176fd
commit fea0c63d43
9 changed files with 95 additions and 84 deletions

View File

@ -1336,9 +1336,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::WRITINGSTYLESEXTENSIONS::
-- Marketing (advertisements, sales texts)
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::WRITINGSTYLESEXTENSIONS::T945714286"] = "Marketing (advertisements, sales texts)"
-- This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and supplement the content, either as text you write yourself or as an uploaded document. Set the number of slides either by direct specification or based on your desired presentation duration. The output can be flexibly generated in various languages and with adjustable complexity.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1062229406"] = "This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and supplement the content, either as text you write yourself or as an uploaded document. Set the number of slides either by direct specification or based on your desired presentation duration. The output can be flexibly generated in various languages and with adjustable complexity."
-- Your title
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1790167032"] = "Your title"
@ -1354,18 +1351,21 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T24391765"]
-- Target group
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651"] = "Target group"
-- Please provide a title
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3049299559"] = "Please provide a title"
-- Create Slides
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593"] = "Create Slides"
-- Please a title
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3359269886"] = "Please a title"
-- (Optional) Specify aspects that the LLM should consider when creating the slides. For example, the use of emojis or specific topics that should be highlighted.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3476149293"] = "(Optional) Specify aspects that the LLM should consider when creating the slides. For example, the use of emojis or specific topics that should be highlighted."
-- Custom target language
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3848935911"] = "Custom target language"
-- This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and provide the content either as self-written text or as an uploaded document. Important aspects allow you to add instructions to the LLM regarding output or formatting. Set the number of slides either directly or based on your desired presentation duration. You can also specify the number of bullet points. If the default value of 0 is not changed, the LLM will independently determine how many slides or bullet points to generate. The output can be flexibly generated in various languages and with adjustable complexity.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3996977501"] = "This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and provide the content either as self-written text or as an uploaded document. Important aspects allow you to add instructions to the LLM regarding output or formatting. Set the number of slides either directly or based on your desired presentation duration. You can also specify the number of bullet points. If the default value of 0 is not changed, the LLM will independently determine how many slides or bullet points to generate. The output can be flexibly generated in various languages and with adjustable complexity."
-- Your content
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T526734495"] = "Your content"
@ -4441,6 +4441,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T12200
-- When enabled, you can preselect slide builder options. This is might be useful when you prefer a specific language or LLM model.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T1393378753"] = "When enabled, you can preselect slide builder options. This is might be useful when you prefer a specific language or LLM model."
-- Preselect aspects for the LLM to focus on when generating slides, such as bullet points or specific topics to emphasize.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T1528169602"] = "Preselect aspects for the LLM to focus on when generating slides, such as bullet points or specific topics to emphasize."
-- Would you like to preselect one of your profiles?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T2221665527"] = "Would you like to preselect one of your profiles?"
@ -4462,6 +4465,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T32155
-- Close
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T3448155331"] = "Close"
-- Preselect important aspects
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T3705987833"] = "Preselect important aspects"
-- Preselect one of your profiles?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T4004501229"] = "Preselect one of your profiles?"

View File

@ -1,11 +1,11 @@
@attribute [Route(Routes.ASSISTANT_SLIDE_BUILDER)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogSlideBuilder>
<MudTextField T="string" @bind-Text="@this.inputTitle" Validation="@this.ValidatingText" Adornment="Adornment.Start" Label="@T("Your title")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Text="@this.inputTitle" Validation="@this.ValidatingTitle" Adornment="Adornment.Start" Label="@T("Your title")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Text="@this.inputContext" Adornment="Adornment.Start" Lines="6" MaxLines="12" AutoGrow="@false" Label="@T("Your content")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" AutoGrow="true" Lines="2" @bind-Text="@this.importantAspects" class="mb-3" Label="@T("(Optional) Important Aspects")" HelperText="@T("(Optional) Specify aspects that the LLM should consider when creating the slides. For example, the use of emojis or specific topics that should be highlighted.")" ShrinkLabel="true" Variant="Variant.Outlined" AdornmentIcon="@Icons.Material.Filled.List" Adornment="Adornment.Start"/>
<MudTextField T="string" @bind-Text="@this.inputContext" Validation="@this.ValidatingContext" Adornment="Adornment.Start" Lines="6" MaxLines="12" AutoGrow="@false" Label="@T("Your content")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ReadFileContent @bind-FileContent="@this.inputContext"/>
<MudTextField T="string" AutoGrow="true" Lines="2" @bind-Text="@this.importantAspects" class="mb-3" Label="@T("(Optional) Important Aspects")" HelperText="@T("(Optional) Specify aspects that the LLM should consider when creating the slides. For example, the use of emojis or specific topics that should be highlighted.")" ShrinkLabel="true" Variant="Variant.Outlined" AdornmentIcon="@Icons.Material.Filled.List" Adornment="Adornment.Start"/>
<MudGrid>
<MudItem xs="4">
@ -13,7 +13,7 @@
Label="Number of slides"
Variant="Variant.Outlined"
Class="mb-3"
Min="0.0" />
Min="0" />
</MudItem>
<MudItem xs="4">
@ -30,7 +30,7 @@
Label="Time specification (minutes)"
Variant="Variant.Outlined"
Class="mb-3"
Min="0.0" />
Min="0" />
</MudItem>
</MudGrid>

View File

@ -9,7 +9,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
protected override string Title => T("Slide Assistant");
protected override string Description => T("This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and supplement the content, either as text you write yourself or as an uploaded document. Set the number of slides either by direct specification or based on your desired presentation duration. The output can be flexibly generated in various languages and with adjustable complexity. ");
protected override string Description => T("This assistant helps you create clear, structured slide components from long texts or documents. Enter a presentation title and provide the content either as self-written text or as an uploaded document. Important aspects allow you to add instructions to the LLM regarding output or formatting. Set the number of slides either directly or based on your desired presentation duration. You can also specify the number of bullet points. If the default value of 0 is not changed, the LLM will independently determine how many slides or bullet points to generate. The output can be flexibly generated in various languages and with adjustable complexity. ");
protected override string SystemPrompt =>
$$$"""
@ -22,9 +22,7 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
# Content
- You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT.
# Important aspects
- Emphasize the following aspects in your presentation {{{this.PromptImportantAspects()}}}
- {{{this.PromptImportantAspects()}}}
# Subheadings
- Rule for creating the individual subheadings:
@ -112,9 +110,9 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
private string customTargetLanguage = string.Empty;
private TargetGroup selectedTargetGroup;
private CommonLanguages selectedTargetLanguage;
private double numberOfSheets;
private double numberOfBulletPoints;
private double timeSpecification;
private int numberOfSheets;
private int numberOfBulletPoints;
private int timeSpecification;
private int calculatedNumberOfSlides = 0;
private string importantAspects = string.Empty;
@ -131,10 +129,17 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
#endregion
private string? ValidatingText(string text)
private string? ValidatingTitle(string text)
{
if(string.IsNullOrWhiteSpace(text))
return T("Please a title");
return T("Please provide a title");
return null;
}
private string? ValidatingContext(string text)
{
if(string.IsNullOrWhiteSpace(text))
return T("Please provide context");
return null;
}
@ -158,8 +163,8 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
return string.Empty;
return $"""
Emphasize the following aspects in your slides:
{this.importantAspects}
# Important aspects
- Emphasize the following aspects in your presentation {this.importantAspects}
""";
}
@ -173,18 +178,19 @@ public partial class SlideAssistant : AssistantBaseCore<SettingsDialogSlideBuild
this.CreateChatThread();
var time = this.AddUserRequest(
$"""
# PRESENTATION_TITLE
```
{this.inputTitle}
```
# PRESENTATION_CONTENT
```
{this.inputContext}
```
""",
hideContentFromUser: true);
$"""
# PRESENTATION_TITLE
```
{this.inputTitle}
```
# PRESENTATION_CONTENT
```
{this.inputContext}
```
""",
hideContentFromUser: true);
await this.AddAIResponseAsync(time);
}

View File

@ -0,0 +1,13 @@
namespace AIStudio.Assistants.SlideBuilder;
public enum TargetGroup
{
NO_CHANGE,
CHILDREN,
STUDENTS,
SCIENTISTS,
OFFICE_WORKERS,
MANAGEMENT_BOARD,
}

View File

@ -0,0 +1,32 @@
namespace AIStudio.Assistants.SlideBuilder;
public static class TargetGroupExtensions
{
private static string TB(string fallbackEN) => Tools.PluginSystem.I18N.I.T(fallbackEN, typeof(TargetGroupExtensions).Namespace, nameof(TargetGroupExtensions));
public static string Name(this TargetGroup group) => group switch
{
TargetGroup.NO_CHANGE => TB("No target group"),
TargetGroup.CHILDREN => TB("Children"),
TargetGroup.STUDENTS => TB("Students"),
TargetGroup.SCIENTISTS => TB("Scientists"),
TargetGroup.OFFICE_WORKERS => TB("Office workers"),
TargetGroup.MANAGEMENT_BOARD => TB("Executive committee"),
_ => TB("No target group"),
};
public static string Prompt(this TargetGroup group) => group switch
{
TargetGroup.NO_CHANGE => "Do not tailor the text to a specific target group.",
TargetGroup.CHILDREN => "Write for children. Keep the language simple and concrete.",
TargetGroup.STUDENTS => "Write for students. Keep it structured and easy to study.",
TargetGroup.SCIENTISTS => "Use precise, technical language. Structure logically with clear methods/results.",
TargetGroup.OFFICE_WORKERS => "Be clear, practical, and concise. Use bullet points. Focus on action.",
TargetGroup.MANAGEMENT_BOARD => "Focus on strategy, ROI, risks. Summarize. Recommend decisions.",
_ => "Do not tailor the text to a specific target group.",
};
}

View File

@ -1,5 +1,5 @@
@using AIStudio.Settings
@using AIStudio.Assistants.SlideBuilder
@using AIStudio.Settings
@using AIStudio.Settings
@inherits SettingsDialogBase
<MudDialog>
@ -12,6 +12,7 @@
<DialogContent>
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect Slide Assistant options?")" LabelOn="@T("Slide Assistant options are preselected")" LabelOff="@T("No Slide Assistant options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions = updatedState)" OptionHelp="@T("When enabled, you can preselect slide builder options. This is might be useful when you prefer a specific language or LLM model.")"/>
<ConfigurationText OptionDescription="@T("Preselect important aspects")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" Text="@(() => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedImportantAspects)" TextUpdate="@(updatedText => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedImportantAspects = updatedText)" NumLines="2" OptionHelp="@T("Preselect aspects for the LLM to focus on when generating slides, such as bullet points or specific topics to emphasize.")" Icon="@Icons.Material.Filled.List"/>
<ConfigurationSelect OptionDescription="@T("Preselect the language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesOptionalData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage = selectedValue)" OptionHelp="@T("Which language should be preselected?")"/>
@if (this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage is CommonLanguages.OTHER)
{
@ -28,4 +29,4 @@
@T("Close")
</MudButton>
</DialogActions>
</MudDialog>
</MudDialog>

View File

@ -229,40 +229,6 @@ public sealed class DataV1V3
/// </summary>
public string PreselectedTextSummarizerProvider { get; set; } = string.Empty;
#endregion
#region Assiatant: Slide Builder Settings
/// <summary>
/// Preselect any slide builder options?
/// </summary>
public bool PreselectSlideBuilderOptions { get; set; }
/// <summary>
/// Preselect any slide builder profile?
/// </summary>
public string PreselectedSlideBuilderProfile { get; set; } = string.Empty;
/// <summary>
/// Preselect a text summarizer provider?
/// </summary>
public string PreselectedSlideBuilderProvider { get; set; } = string.Empty;
/// <summary>
/// Preselect the target group?
/// </summary>
public TargetGroup PreselectedSlideBuilderTargetGroup { get; set; }
/// <summary>
/// Preselect the target language?
/// </summary>
public CommonLanguages PreselectedSlideBuilderTargetLanguage { get; set; }
/// <summary>
/// Preselect any other language?
/// </summary>
public string PreselectedSlideBuilderOtherLanguage { get; set; } = string.Empty;
#endregion
#region Agent: Text Content Cleaner Settings

View File

@ -57,8 +57,6 @@ public sealed class DataV4
public DataEMail EMail { get; set; } = new();
public DataSlideBuilder SlideBuilder {get; set; } = new();
public DataLegalCheck LegalCheck { get; set; } = new();
public DataSynonyms Synonyms { get; set; } = new();

View File

@ -200,16 +200,6 @@ public static class SettingsMigrations
PreselectWebContentReader = previousConfig.PreselectWebContentReaderForTextSummarizer,
},
SlideBuilder = new()
{
PreselectOptions = previousConfig.PreselectSlideBuilderOptions,
PreselectedProfile = previousConfig.PreselectedSlideBuilderProfile,
PreselectedProvider = previousConfig.PreselectedSlideBuilderProvider,
PreselectedTargetGroup = previousConfig.PreselectedSlideBuilderTargetGroup,
PreselectedTargetLanguage = previousConfig.PreselectedSlideBuilderTargetLanguage,
PreselectedOtherLanguage = previousConfig.PreselectedSlideBuilderOtherLanguage,
},
TextContentCleaner = new()
{
PreselectAgentOptions = previousConfig.PreselectAgentTextContentCleanerOptions,
@ -246,7 +236,6 @@ public static class SettingsMigrations
GrammarSpelling = previousConfig.GrammarSpelling,
RewriteImprove = previousConfig.RewriteImprove,
EMail = previousConfig.EMail,
SlideBuilder = previousConfig.SlideBuilder,
LegalCheck = previousConfig.LegalCheck,
Synonyms = previousConfig.Synonyms,
MyTasks = previousConfig.MyTasks,