From edacfb196bde6d8b927c5f06478f558fcf772dd1 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Thu, 29 Jan 2026 13:07:52 +0100 Subject: [PATCH 01/19] Create a new Assistant --- .../Assistants/PowerPoint/PowerPoint.razor | 8 + .../Assistants/PowerPoint/PowerPoint.razor.cs | 169 ++++++++++++++++++ .../Settings/SettingsDialogPowerPoint.razor | 28 +++ .../SettingsDialogPowerPoint.razor.cs | 7 + 4 files changed, 212 insertions(+) create mode 100644 app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor create mode 100644 app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs create mode 100644 app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor create mode 100644 app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor new file mode 100644 index 000000000..49e811a95 --- /dev/null +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -0,0 +1,8 @@ +@attribute [Route(Routes.ASSISTANT_SYNONYMS)] +@inherits AssistantBaseCore + + + + + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs new file mode 100644 index 000000000..bbbe22932 --- /dev/null +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -0,0 +1,169 @@ +using Microsoft.AspNetCore.Components; +using AIStudio.Chat; +using AIStudio.Dialogs.Settings; + +namespace AIStudio.Assistants.PowerPoint; + +public partial class PowerPoint : AssistantBaseCore +{ + public override Tools.Components Component => Tools.Components.SYNONYMS_ASSISTANT; + + protected override string Title => T("Synonyms"); + + protected override string Description => T("Find synonyms for words or phrases."); + + protected override string SystemPrompt => + $""" + You have a PhD in linguistics. Therefore, you are an expert in the {this.SystemPromptLanguage()} language. + You receive a word or phrase as input. You might also receive some context. You then provide + a list of synonyms as a Markdown list. + + First, derive possible meanings from the word, phrase, and context, when available. Then, provide + possible synonyms for each meaning. + + Example for the word "learn" and the language English (US): + + Derive possible meanings (*this list is not part of the output*): + - Meaning "to learn" + - Meaning "to retain" + + Next, provide possible synonyms for each meaning, which is your output: + + # Meaning "to learn" + - absorb + - study + - acquire + - advance + - practice + + # Meaning "to retain" + - remember + - note + - realize + + You do not ask follow-up questions and never repeat the task instructions. When you do not know + any synonyms for the given word or phrase, you state this. Your output is always in + the {this.SystemPromptLanguage()} language. + """; + + protected override bool AllowProfiles => false; + + protected override IReadOnlyList FooterButtons => []; + + protected override string SubmitText => T("Find synonyms"); + + protected override Func SubmitAction => this.FindSynonyms; + + protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with + { + SystemPrompt = SystemPrompts.DEFAULT, + }; + + protected override void ResetForm() + { + this.inputText = string.Empty; + this.inputContext = string.Empty; + if (!this.MightPreselectValues()) + { + this.selectedLanguage = CommonLanguages.AS_IS; + this.customTargetLanguage = string.Empty; + } + } + + protected override bool MightPreselectValues() + { + if (this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions) + { + this.selectedLanguage = this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage; + this.customTargetLanguage = this.SettingsManager.ConfigurationData.Synonyms.PreselectedOtherLanguage; + return true; + } + + return false; + } + + private string inputText = string.Empty; + private string inputContext = string.Empty; + private CommonLanguages selectedLanguage; + private string customTargetLanguage = string.Empty; + + #region Overrides of ComponentBase + + protected override async Task OnInitializedAsync() + { + var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SEND_TO_SYNONYMS_ASSISTANT).FirstOrDefault(); + if (deferredContent is not null) + this.inputContext = deferredContent; + + await base.OnInitializedAsync(); + } + + #endregion + + private string? ValidatingText(string text) + { + if(string.IsNullOrWhiteSpace(text)) + return T("Please provide a word or phrase as input."); + + return null; + } + + private string? ValidateCustomLanguage(string language) + { + if(this.selectedLanguage == CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language)) + return T("Please provide a custom language."); + + return null; + } + + private string SystemPromptLanguage() + { + var lang = this.selectedLanguage switch + { + CommonLanguages.AS_IS => "source", + CommonLanguages.OTHER => this.customTargetLanguage, + + _ => $"{this.selectedLanguage.Name()}", + }; + + if (string.IsNullOrWhiteSpace(lang)) + return "source"; + + return lang; + } + + private string UserPromptContext() + { + if(string.IsNullOrWhiteSpace(this.inputContext)) + return string.Empty; + + return $""" + The given context is: + + ``` + {this.inputContext} + ``` + + """; + } + + private async Task FindSynonyms() + { + await this.form!.Validate(); + if (!this.inputIsValid) + return; + + this.CreateChatThread(); + var time = this.AddUserRequest( + $""" + {this.UserPromptContext()} + The given word or phrase is: + + ``` + {this.inputText} + ``` + """); + + await this.AddAIResponseAsync(time); + } +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor new file mode 100644 index 000000000..46b5b8f21 --- /dev/null +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor @@ -0,0 +1,28 @@ +@using AIStudio.Settings +@inherits SettingsDialogBase + + + + + + @T("Assistant: Synonyms Options") + + + + + + + @if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER) + { + + } + + + + + + + @T("Close") + + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs new file mode 100644 index 000000000..da9bc0c7b --- /dev/null +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs @@ -0,0 +1,7 @@ +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Dialogs.Settings; + +public partial class SettingsDialogPowerPoint : SettingsDialogBase +{ +} \ No newline at end of file From 51154ec6b38268e472ca42718c87cd875038691a Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Thu, 29 Jan 2026 13:50:20 +0100 Subject: [PATCH 02/19] Integrate the assistant into the code --- .../Assistants/PowerPoint/PowerPoint.razor | 4 ++-- .../Assistants/PowerPoint/PowerPoint.razor.cs | 8 ++++---- .../Dialogs/Settings/SettingsDialogPowerPoint.razor | 4 ++-- app/MindWork AI Studio/Pages/Assistants.razor | 4 +++- app/MindWork AI Studio/Routes.razor.cs | 3 ++- app/MindWork AI Studio/Tools/Components.cs | 1 + app/MindWork AI Studio/Tools/ComponentsExtensions.cs | 1 + 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 49e811a95..5f915adea 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -1,8 +1,8 @@ -@attribute [Route(Routes.ASSISTANT_SYNONYMS)] +@attribute [Route(Routes.ASSISTANT_POWERPOINT)] @inherits AssistantBaseCore - \ No newline at end of file + diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index bbbe22932..5a0c586c2 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -6,11 +6,11 @@ namespace AIStudio.Assistants.PowerPoint; public partial class PowerPoint : AssistantBaseCore { - public override Tools.Components Component => Tools.Components.SYNONYMS_ASSISTANT; + public override Tools.Components Component => Tools.Components.POWER_POINT_ASSISTANT; - protected override string Title => T("Synonyms"); + protected override string Title => T("Power Point"); - protected override string Description => T("Find synonyms for words or phrases."); + protected override string Description => T("Create and refine PowerPoint slide text from a topic or outline."); protected override string SystemPrompt => $""" @@ -50,7 +50,7 @@ Derive possible meanings (*this list is not part of the output*): protected override IReadOnlyList FooterButtons => []; - protected override string SubmitText => T("Find synonyms"); + protected override string SubmitText => T("Create Power Point"); protected override Func SubmitAction => this.FindSynonyms; diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor index 46b5b8f21..553883b16 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor @@ -5,12 +5,12 @@ - @T("Assistant: Synonyms Options") + @T("Assistant: Power Point Options") - + @if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER) { diff --git a/app/MindWork AI Studio/Pages/Assistants.razor b/app/MindWork AI Studio/Pages/Assistants.razor index 250aa06c4..6003e1b35 100644 --- a/app/MindWork AI Studio/Pages/Assistants.razor +++ b/app/MindWork AI Studio/Pages/Assistants.razor @@ -37,7 +37,8 @@ (Components.AGENDA_ASSISTANT, PreviewFeatures.NONE), (Components.JOB_POSTING_ASSISTANT, PreviewFeatures.NONE), (Components.LEGAL_CHECK_ASSISTANT, PreviewFeatures.NONE), - (Components.ICON_FINDER_ASSISTANT, PreviewFeatures.NONE) + (Components.ICON_FINDER_ASSISTANT, PreviewFeatures.NONE), + (Components.POWER_POINT_ASSISTANT, PreviewFeatures.NONE) )) { @@ -51,6 +52,7 @@ + } diff --git a/app/MindWork AI Studio/Routes.razor.cs b/app/MindWork AI Studio/Routes.razor.cs index 836cab0ee..a4a633d6f 100644 --- a/app/MindWork AI Studio/Routes.razor.cs +++ b/app/MindWork AI Studio/Routes.razor.cs @@ -22,6 +22,7 @@ public sealed partial class Routes public const string ASSISTANT_EMAIL = "/assistant/email"; public const string ASSISTANT_LEGAL_CHECK = "/assistant/legal-check"; public const string ASSISTANT_SYNONYMS = "/assistant/synonyms"; + public const string ASSISTANT_POWERPOINT = "/assistant/powerpoint"; public const string ASSISTANT_MY_TASKS = "/assistant/my-tasks"; public const string ASSISTANT_JOB_POSTING = "/assistant/job-posting"; public const string ASSISTANT_BIAS = "/assistant/bias-of-the-day"; @@ -29,4 +30,4 @@ public sealed partial class Routes public const string ASSISTANT_AI_STUDIO_I18N = "/assistant/ai-studio/i18n"; public const string ASSISTANT_DOCUMENT_ANALYSIS = "/assistant/document-analysis"; // ReSharper restore InconsistentNaming -} \ No newline at end of file +} diff --git a/app/MindWork AI Studio/Tools/Components.cs b/app/MindWork AI Studio/Tools/Components.cs index 1004188cd..f8c6f6d15 100644 --- a/app/MindWork AI Studio/Tools/Components.cs +++ b/app/MindWork AI Studio/Tools/Components.cs @@ -19,6 +19,7 @@ public enum Components BIAS_DAY_ASSISTANT, ERI_ASSISTANT, DOCUMENT_ANALYSIS_ASSISTANT, + POWER_POINT_ASSISTANT, // ReSharper disable InconsistentNaming I18N_ASSISTANT, diff --git a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs index 54eb2cfa4..dd488ffa8 100644 --- a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs +++ b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs @@ -43,6 +43,7 @@ public static class ComponentsExtensions Components.ERI_ASSISTANT => TB("ERI Server"), Components.I18N_ASSISTANT => TB("Localization Assistant"), Components.DOCUMENT_ANALYSIS_ASSISTANT => TB("Document Analysis Assistant"), + Components.POWER_POINT_ASSISTANT => TB("Power Point"), Components.CHAT => TB("New Chat"), From 5e44259e444f215d0674df57bbfb192877469ce0 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Thu, 29 Jan 2026 15:57:16 +0100 Subject: [PATCH 03/19] Simple output of the PowerPoint assistant --- .../Assistants/PowerPoint/PowerPoint.razor | 4 +- .../Assistants/PowerPoint/PowerPoint.razor.cs | 55 +++++++------------ 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 5f915adea..140c53130 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -1,8 +1,8 @@ @attribute [Route(Routes.ASSISTANT_POWERPOINT)] @inherits AssistantBaseCore - - + + diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index 5a0c586c2..4cf609f44 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -12,38 +12,23 @@ public partial class PowerPoint : AssistantBaseCore protected override string Description => T("Create and refine PowerPoint slide text from a topic or outline."); - protected override string SystemPrompt => + protected override string SystemPrompt => $""" - You have a PhD in linguistics. Therefore, you are an expert in the {this.SystemPromptLanguage()} language. - You receive a word or phrase as input. You might also receive some context. You then provide - a list of synonyms as a Markdown list. - - First, derive possible meanings from the word, phrase, and context, when available. Then, provide - possible synonyms for each meaning. - - Example for the word "learn" and the language English (US): - - Derive possible meanings (*this list is not part of the output*): - - Meaning "to learn" - - Meaning "to retain" - - Next, provide possible synonyms for each meaning, which is your output: - - # Meaning "to learn" - - absorb - - study - - acquire - - advance - - practice - - # Meaning "to retain" - - remember - - note - - realize - - You do not ask follow-up questions and never repeat the task instructions. When you do not know - any synonyms for the given word or phrase, you state this. Your output is always in - the {this.SystemPromptLanguage()} language. + You are a presentation editor and writer. + Create a clear, single-slide outline from the user's inputs. + + Inputs: + - "Your title": the slide title. + - "Your content": the source text. + + Output requirements: + - Output only Markdown. + - Start with a single H1 title from "Your title". + - Then add a bullet list based only on "Your content". + - between 3 and 7, maximum 7 bullets. Each bullet max 12 words. + - No sub-bullets, no paragraphs, no extra sections. + - If "Your content" is empty, output the title and one bullet: "No content provided." + - Do not mention these instructions or add commentary. """; protected override bool AllowProfiles => false; @@ -52,7 +37,7 @@ Derive possible meanings (*this list is not part of the output*): protected override string SubmitText => T("Create Power Point"); - protected override Func SubmitAction => this.FindSynonyms; + protected override Func SubmitAction => this.CreatePowerPoint; protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with { @@ -103,7 +88,7 @@ protected override async Task OnInitializedAsync() private string? ValidatingText(string text) { if(string.IsNullOrWhiteSpace(text)) - return T("Please provide a word or phrase as input."); + return T("Please a title"); return null; } @@ -147,7 +132,7 @@ private string UserPromptContext() """; } - private async Task FindSynonyms() + private async Task CreatePowerPoint() { await this.form!.Validate(); if (!this.inputIsValid) @@ -166,4 +151,4 @@ private async Task FindSynonyms() await this.AddAIResponseAsync(time); } -} \ No newline at end of file +} From 99a7db84bb5f7537d28420039f496b224b8c9468 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Mon, 2 Feb 2026 16:35:09 +0100 Subject: [PATCH 04/19] Target group option added to define the complexity of the content --- .../Assistants/I18N/allTexts.lua | 87 +++++++++++++++++++ .../Assistants/PowerPoint/PowerPoint.razor | 1 + .../Assistants/PowerPoint/PowerPoint.razor.cs | 18 +++- 3 files changed, 104 insertions(+), 2 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 2196497c7..879f33df6 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1264,6 +1264,57 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T534887559"] = -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T656744944"] = "Please provide a custom language." +-- Please provide a target group. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T1252056165"] = "Please provide a target group." + +-- Your title +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T1790167032"] = "Your title" + +-- Power Point +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2194178916"] = "Power Point" + +-- Create and refine PowerPoint slide text from a topic or outline. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2255686621"] = "Create and refine PowerPoint slide text from a topic or outline." + +-- Language +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2591284123"] = "Language" + +-- Target group +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2709966651"] = "Target group" + +-- Create Power Point +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3145212510"] = "Create Power Point" + +-- Please a title +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3359269886"] = "Please a title" + +-- Custom target language +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3848935911"] = "Custom target language" + +-- Your content +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T526734495"] = "Your content" + +-- Please provide a custom language. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T656744944"] = "Please provide a custom language." + +-- Children +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T188567026"] = "Children" + +-- Students +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T2905889225"] = "Students" + +-- Scientists +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T332785734"] = "Scientists" + +-- No target group +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T3644477204"] = "No target group" + +-- Office workers +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T3873911022"] = "Office workers" + +-- Executive committee +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T537362216"] = "Executive committee" + -- Please provide a text as input. You might copy the desired text from a document or a website. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::ASSISTANTREWRITEIMPROVE::T137304886"] = "Please provide a text as input. You might copy the desired text from a document or a website." @@ -4297,6 +4348,33 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGMYTASKS::T42672465"] -- When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGMYTASKS::T711745239"] = "When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model." +-- When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T183953912"] = "When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model." + +-- No Power Point options are preselected +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2203742337"] = "No Power Point options are preselected" + +-- Preselect Power Point options? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2253853076"] = "Preselect Power Point options?" + +-- Which language should be preselected? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2345162613"] = "Which language should be preselected?" + +-- Preselect another language +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2382415529"] = "Preselect another language" + +-- Preselect the language +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2571465005"] = "Preselect the language" + +-- Power Point options are preselected +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T3094929560"] = "Power Point options are preselected" + +-- Close +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T3448155331"] = "Close" + +-- Assistant: Power Point Options +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T426362386"] = "Assistant: Power Point Options" + -- Edit Profile UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPROFILES::T1143111468"] = "Edit Profile" @@ -4825,6 +4903,12 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1934717573"] = "Check grammar and -- Translate text into another language. UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T209791153"] = "Translate text into another language." +-- Power Point +UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2194178916"] = "Power Point" + +-- Create and refine PowerPoint slide text from a topic or outline. +UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2255686621"] = "Create and refine PowerPoint slide text from a topic or outline." + -- Generate an e-mail for a given context. UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2383649630"] = "Generate an e-mail for a given context." @@ -5722,6 +5806,9 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T166453786"] = "Grammar -- Legal Check Assistant UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T1886447798"] = "Legal Check Assistant" +-- Power Point +UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T2194178916"] = "Power Point" + -- Job Posting Assistant UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T2212811874"] = "Job Posting Assistant" diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 140c53130..3ce4bf464 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -5,4 +5,5 @@ + diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index 4cf609f44..f75d12f02 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -1,5 +1,4 @@ -using Microsoft.AspNetCore.Components; -using AIStudio.Chat; +using AIStudio.Chat; using AIStudio.Dialogs.Settings; namespace AIStudio.Assistants.PowerPoint; @@ -20,6 +19,7 @@ You are a presentation editor and writer. Inputs: - "Your title": the slide title. - "Your content": the source text. + {this.selectedTargetGroup.Prompt()} Output requirements: - Output only Markdown. @@ -48,6 +48,9 @@ protected override void ResetForm() { this.inputText = string.Empty; this.inputContext = string.Empty; + this.expertInField = string.Empty; + this.selectedTargetGroup = TargetGroup.NO_CHANGE; + this.customTargetGroup = string.Empty; if (!this.MightPreselectValues()) { this.selectedLanguage = CommonLanguages.AS_IS; @@ -71,6 +74,9 @@ protected override bool MightPreselectValues() private string inputContext = string.Empty; private CommonLanguages selectedLanguage; private string customTargetLanguage = string.Empty; + private string expertInField = string.Empty; + private TargetGroup selectedTargetGroup; + private string customTargetGroup = string.Empty; #region Overrides of ComponentBase @@ -101,6 +107,14 @@ protected override async Task OnInitializedAsync() return null; } + private string? ValidateTargetGroup(string group) + { + if(this.selectedTargetGroup == TargetGroup.NO_CHANGE && string.IsNullOrWhiteSpace(group)) + return T("Please provide a target group."); + + return null; + } + private string SystemPromptLanguage() { var lang = this.selectedLanguage switch From 96bcc33071a49edef3196633b6b4874e6abb1c98 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Tue, 3 Feb 2026 15:27:53 +0100 Subject: [PATCH 05/19] Add Button and Option "Use file content as input" --- .../Assistants/PowerPoint/PowerPoint.razor | 6 ++-- .../Assistants/PowerPoint/PowerPoint.razor.cs | 29 +++---------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 3ce4bf464..3c15afcb8 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -2,8 +2,10 @@ @inherits AssistantBaseCore - - + + + + diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index f75d12f02..c2f6e3c65 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -15,9 +15,11 @@ public partial class PowerPoint : AssistantBaseCore $""" You are a presentation editor and writer. Create a clear, single-slide outline from the user's inputs. + {this.selectedTargetLanguage.PromptTranslation(this.customTargetLanguage)} Inputs: - - "Your title": the slide title. + - "Your title": the slide title. + {this.inputText} - "Your content": the source text. {this.selectedTargetGroup.Prompt()} @@ -77,6 +79,7 @@ protected override bool MightPreselectValues() private string expertInField = string.Empty; private TargetGroup selectedTargetGroup; private string customTargetGroup = string.Empty; + private CommonLanguages selectedTargetLanguage; #region Overrides of ComponentBase @@ -106,30 +109,6 @@ protected override async Task OnInitializedAsync() return null; } - - private string? ValidateTargetGroup(string group) - { - if(this.selectedTargetGroup == TargetGroup.NO_CHANGE && string.IsNullOrWhiteSpace(group)) - return T("Please provide a target group."); - - return null; - } - - private string SystemPromptLanguage() - { - var lang = this.selectedLanguage switch - { - CommonLanguages.AS_IS => "source", - CommonLanguages.OTHER => this.customTargetLanguage, - - _ => $"{this.selectedLanguage.Name()}", - }; - - if (string.IsNullOrWhiteSpace(lang)) - return "source"; - - return lang; - } private string UserPromptContext() { From 3b0939819b91412c32873e5cd111243a90938265 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Wed, 4 Feb 2026 15:52:29 +0100 Subject: [PATCH 06/19] Update PowerPoint assistant: improve Markdown formatting instructions and refine UI text labels --- app/MindWork AI Studio/Assistants/I18N/allTexts.lua | 7 ++----- .../Assistants/PowerPoint/PowerPoint.razor.cs | 8 ++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 879f33df6..e6db25230 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1264,9 +1264,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T534887559"] = -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T656744944"] = "Please provide a custom language." --- Please provide a target group. -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T1252056165"] = "Please provide a target group." - -- Your title UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T1790167032"] = "Your title" @@ -1276,8 +1273,8 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2194178916"] = " -- Create and refine PowerPoint slide text from a topic or outline. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2255686621"] = "Create and refine PowerPoint slide text from a topic or outline." --- Language -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2591284123"] = "Language" +-- Target language +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T237828418"] = "Target language" -- Target group UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2709966651"] = "Target group" diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index c2f6e3c65..07330c00e 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -22,13 +22,17 @@ You are a presentation editor and writer. {this.inputText} - "Your content": the source text. {this.selectedTargetGroup.Prompt()} + + - You are a Markdown formatter. + - Your task is to identify headings in the input text that are marked with either # (for h1–h6) or **bold text** (used as pseudo-headings). + - Convert all such headings into proper Markdown subheadings using ## for subheadings (level 2), preserving the original text. + - Do not change any other content. + - between 3 and 7, maximum 7 bullets per heading. Each bullet max 12 words. Output requirements: - Output only Markdown. - Start with a single H1 title from "Your title". - Then add a bullet list based only on "Your content". - - between 3 and 7, maximum 7 bullets. Each bullet max 12 words. - - No sub-bullets, no paragraphs, no extra sections. - If "Your content" is empty, output the title and one bullet: "No content provided." - Do not mention these instructions or add commentary. """; From e99fa14a4c9d724f29eade85a14682fb6dbe4538 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Fri, 6 Feb 2026 12:11:25 +0100 Subject: [PATCH 07/19] Add option "Number of sheets" and "Time specification" --- .../Assistants/PowerPoint/PowerPoint.razor | 16 +++++++ .../Assistants/PowerPoint/PowerPoint.razor.cs | 43 +++++++++++++------ 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 3c15afcb8..470254f07 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -6,6 +6,22 @@ + + + + + + + + + + diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index 07330c00e..6b117a034 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -12,27 +12,33 @@ public partial class PowerPoint : AssistantBaseCore protected override string Description => T("Create and refine PowerPoint slide text from a topic or outline."); protected override string SystemPrompt => - $""" - You are a presentation editor and writer. + $$""" + You are a professional presentation editor and writer. Create a clear, single-slide outline from the user's inputs. - {this.selectedTargetLanguage.PromptTranslation(this.customTargetLanguage)} + {{this.selectedTargetLanguage.PromptTranslation(this.customTargetLanguage)}} Inputs: - - "Your title": the slide title. - {this.inputText} + - "Your title": the main title. + {{this.inputText}} - "Your content": the source text. - {this.selectedTargetGroup.Prompt()} + {{this.selectedTargetGroup.Prompt()}} - - You are a Markdown formatter. - - Your task is to identify headings in the input text that are marked with either # (for h1–h6) or **bold text** (used as pseudo-headings). - - Convert all such headings into proper Markdown subheadings using ## for subheadings (level 2), preserving the original text. - - Do not change any other content. - - between 3 and 7, maximum 7 bullets per heading. Each bullet max 12 words. + Rule for creating the individual subheadings: + - If {{this.numberOfSheets}} is NOT 0 + - Generate exactly {{this.numberOfSheets}} precise subheadings, each heading represents one slide in a presentation. + - If {{this.timeSpecification}} is NOT 0 + - Generate exactly {{this.calculatedNumberOfSlides}} precise subheadings, each heading represents one slide in a presentation. + - If either parameter is 0, ignore that rules. + + - Each subheadings must have: + - A clear, concise, and thematically meaningful heading. + - 3 to 7 bullet points (max 7) summarizing the slide’s content. + - Each bullet point must be max 12 words. Output requirements: - Output only Markdown. - Start with a single H1 title from "Your title". - - Then add a bullet list based only on "Your content". + - Then add headings with own bullet lists based only on "Your content". - If "Your content" is empty, output the title and one bullet: "No content provided." - Do not mention these instructions or add commentary. """; @@ -84,7 +90,10 @@ protected override bool MightPreselectValues() private TargetGroup selectedTargetGroup; private string customTargetGroup = string.Empty; private CommonLanguages selectedTargetLanguage; - + private double numberOfSheets; + private decimal timeSpecification; + private int calculatedNumberOfSlides = 0; + #region Overrides of ComponentBase protected override async Task OnInitializedAsync() @@ -114,6 +123,11 @@ protected override async Task OnInitializedAsync() return null; } + private int CalculateNumberOfSlides() + { + return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / (decimal)1.5); + } + private string UserPromptContext() { if(string.IsNullOrWhiteSpace(this.inputContext)) @@ -135,11 +149,12 @@ private async Task CreatePowerPoint() if (!this.inputIsValid) return; + this.calculatedNumberOfSlides = this.timeSpecification > 0 ? this.CalculateNumberOfSlides() : 0; + this.CreateChatThread(); var time = this.AddUserRequest( $""" {this.UserPromptContext()} - The given word or phrase is: ``` {this.inputText} From 766fbf16b66abceece0394bf6c2bbaf7b305e400 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Mon, 9 Feb 2026 14:40:09 +0100 Subject: [PATCH 08/19] Update SystemPrompt rules --- .../Assistants/PowerPoint/PowerPoint.razor | 2 +- .../Assistants/PowerPoint/PowerPoint.razor.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor index 470254f07..cc380fcc4 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor @@ -18,7 +18,7 @@ + Min="0.0" /> diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs index 6b117a034..a48c65141 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs @@ -32,8 +32,9 @@ You are a professional presentation editor and writer. - Each subheadings must have: - A clear, concise, and thematically meaningful heading. - - 3 to 7 bullet points (max 7) summarizing the slide’s content. + - 1 to 7 bullet points (maximum 7) summarizing the slide’s content — use as many as needed, but never more than 7. - Each bullet point must be max 12 words. + - Place *** on its own line immediately before each heading. Output requirements: - Output only Markdown. @@ -91,7 +92,7 @@ protected override bool MightPreselectValues() private string customTargetGroup = string.Empty; private CommonLanguages selectedTargetLanguage; private double numberOfSheets; - private decimal timeSpecification; + private double timeSpecification; private int calculatedNumberOfSlides = 0; #region Overrides of ComponentBase @@ -125,7 +126,7 @@ protected override async Task OnInitializedAsync() private int CalculateNumberOfSlides() { - return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / (decimal)1.5); + return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / 1.5); } private string UserPromptContext() From 109239cd32c288397df8aff2a4aa2f18aba32698 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Wed, 11 Feb 2026 14:18:15 +0100 Subject: [PATCH 09/19] Modify SystemPrompt and rename Slide Assistant --- .../Assistants/I18N/allTexts.lua | 168 +++++++++--------- .../SlideAssistant.razor} | 8 +- .../SlideAssistant.razor.cs} | 72 ++++---- ...razor => SettingsDialogSlideBuilder.razor} | 4 +- ...cs => SettingsDialogSlideBuilder.razor.cs} | 2 +- app/MindWork AI Studio/Pages/Assistants.razor | 4 +- .../Tools/CommonLanguageExtensions.cs | 8 + app/MindWork AI Studio/Tools/Components.cs | 2 +- .../Tools/ComponentsExtensions.cs | 2 +- 9 files changed, 136 insertions(+), 134 deletions(-) rename app/MindWork AI Studio/Assistants/{PowerPoint/PowerPoint.razor => SlideBuilder/SlideAssistant.razor} (80%) rename app/MindWork AI Studio/Assistants/{PowerPoint/PowerPoint.razor.cs => SlideBuilder/SlideAssistant.razor.cs} (75%) rename app/MindWork AI Studio/Dialogs/Settings/{SettingsDialogPowerPoint.razor => SettingsDialogSlideBuilder.razor} (82%) rename app/MindWork AI Studio/Dialogs/Settings/{SettingsDialogPowerPoint.razor.cs => SettingsDialogSlideBuilder.razor.cs} (54%) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index e6db25230..ad373db59 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1264,54 +1264,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T534887559"] = -- Please provide a custom language. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::MYTASKS::ASSISTANTMYTASKS::T656744944"] = "Please provide a custom language." --- Your title -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T1790167032"] = "Your title" - --- Power Point -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2194178916"] = "Power Point" - --- Create and refine PowerPoint slide text from a topic or outline. -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2255686621"] = "Create and refine PowerPoint slide text from a topic or outline." - --- Target language -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T237828418"] = "Target language" - --- Target group -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T2709966651"] = "Target group" - --- Create Power Point -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3145212510"] = "Create Power Point" - --- Please a title -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3359269886"] = "Please a title" - --- Custom target language -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T3848935911"] = "Custom target language" - --- Your content -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T526734495"] = "Your content" - --- Please provide a custom language. -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::POWERPOINT::T656744944"] = "Please provide a custom language." - --- Children -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T188567026"] = "Children" - --- Students -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T2905889225"] = "Students" - --- Scientists -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T332785734"] = "Scientists" - --- No target group -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T3644477204"] = "No target group" - --- Office workers -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T3873911022"] = "Office workers" - --- Executive committee -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::POWERPOINT::TARGETGROUPEXTENSIONS::T537362216"] = "Executive committee" - -- Please provide a text as input. You might copy the desired text from a document or a website. UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::ASSISTANTREWRITEIMPROVE::T137304886"] = "Please provide a text as input. You might copy the desired text from a document or a website." @@ -1384,6 +1336,54 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::WRITINGSTYLESEXTENSIONS:: -- Marketing (advertisements, sales texts) UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::REWRITEIMPROVE::WRITINGSTYLESEXTENSIONS::T945714286"] = "Marketing (advertisements, sales texts)" +-- Your title +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1790167032"] = "Your title" + +-- Slide Assistant +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1883918574"] = "Slide Assistant" + +-- Target language +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T237828418"] = "Target language" + +-- Target group +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651"] = "Target group" + +-- Create Slides +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593"] = "Create Slides" + +-- Develop slide content based on a given topic and content. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T311912219"] = "Develop slide content based on a given topic and content." + +-- Please a title +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3359269886"] = "Please a title" + +-- Custom target language +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3848935911"] = "Custom target language" + +-- Your content +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T526734495"] = "Your content" + +-- Please provide a custom language. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T656744944"] = "Please provide a custom language." + +-- Children +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T188567026"] = "Children" + +-- Students +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T2905889225"] = "Students" + +-- Scientists +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T332785734"] = "Scientists" + +-- No target group +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T3644477204"] = "No target group" + +-- Office workers +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T3873911022"] = "Office workers" + +-- Executive committee +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::TARGETGROUPEXTENSIONS::T537362216"] = "Executive committee" + -- Your word or phrase UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SYNONYM::ASSISTANTSYNONYMS::T1847246020"] = "Your word or phrase" @@ -4345,33 +4345,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGMYTASKS::T42672465"] -- When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGMYTASKS::T711745239"] = "When enabled, you can preselect options. This is might be useful when you prefer a specific language or LLM model." --- When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model. -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T183953912"] = "When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model." - --- No Power Point options are preselected -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2203742337"] = "No Power Point options are preselected" - --- Preselect Power Point options? -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2253853076"] = "Preselect Power Point options?" - --- Which language should be preselected? -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2345162613"] = "Which language should be preselected?" - --- Preselect another language -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2382415529"] = "Preselect another language" - --- Preselect the language -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T2571465005"] = "Preselect the language" - --- Power Point options are preselected -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T3094929560"] = "Power Point options are preselected" - --- Close -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T3448155331"] = "Close" - --- Assistant: Power Point Options -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPOWERPOINT::T426362386"] = "Assistant: Power Point Options" - -- Edit Profile UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGPROFILES::T1143111468"] = "Edit Profile" @@ -4453,6 +4426,33 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGREWRITE::T3745021518 -- No rewrite & improve text options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGREWRITE::T553954963"] = "No rewrite & improve text options are preselected" +-- When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model. +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T183953912"] = "When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model." + +-- Preselect Slide Assistant options? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T227645894"] = "Preselect Slide Assistant options?" + +-- Which language should be preselected? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T2345162613"] = "Which language should be preselected?" + +-- Preselect another language +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T2382415529"] = "Preselect another language" + +-- Preselect the language +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T2571465005"] = "Preselect the language" + +-- Assistant: Slide Assistant Options +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T3215549988"] = "Assistant: Slide Assistant Options" + +-- Close +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T3448155331"] = "Close" + +-- No Slide Assistant options are preselected +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T4214398691"] = "No Slide Assistant options are preselected" + +-- Slide Assistant options are preselected +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T93124146"] = "Slide Assistant options are preselected" + -- When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model. UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSYNONYMS::T183953912"] = "When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model." @@ -4891,6 +4891,9 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1617786407"] = "Coding" -- Analyze a text or an email for tasks you need to complete. UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1728590051"] = "Analyze a text or an email for tasks you need to complete." +-- Slide Assistant +UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1883918574"] = "Slide Assistant" + -- Text Summarizer UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1907192403"] = "Text Summarizer" @@ -4900,12 +4903,6 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T1934717573"] = "Check grammar and -- Translate text into another language. UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T209791153"] = "Translate text into another language." --- Power Point -UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2194178916"] = "Power Point" - --- Create and refine PowerPoint slide text from a topic or outline. -UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2255686621"] = "Create and refine PowerPoint slide text from a topic or outline." - -- Generate an e-mail for a given context. UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T2383649630"] = "Generate an e-mail for a given context." @@ -4936,6 +4933,9 @@ UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T3011450657"] = "My Tasks" -- E-Mail UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T3026443472"] = "E-Mail" +-- Develop slide content based on a given topic and content. +UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T311912219"] = "Develop slide content based on a given topic and content." + -- Translate AI Studio text content into other languages UI_TEXT_CONTENT["AISTUDIO::PAGES::ASSISTANTS::T3181803840"] = "Translate AI Studio text content into other languages" @@ -5800,12 +5800,12 @@ UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T1546040625"] = "My Task -- Grammar & Spelling Assistant UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T166453786"] = "Grammar & Spelling Assistant" +-- Slide Assistant +UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T1883918574"] = "Slide Assistant" + -- Legal Check Assistant UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T1886447798"] = "Legal Check Assistant" --- Power Point -UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T2194178916"] = "Power Point" - -- Job Posting Assistant UI_TEXT_CONTENT["AISTUDIO::TOOLS::COMPONENTSEXTENSIONS::T2212811874"] = "Job Posting Assistant" diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor similarity index 80% rename from app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor rename to app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index cc380fcc4..67b767918 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -1,7 +1,7 @@ -@attribute [Route(Routes.ASSISTANT_POWERPOINT)] -@inherits AssistantBaseCore +@attribute [Route(Routes.ASSISTANT_SLIDE_BUILDER)] +@inherits AssistantBaseCore - + @@ -11,6 +11,7 @@ @@ -18,6 +19,7 @@ diff --git a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs similarity index 75% rename from app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs rename to app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index a48c65141..d760d1e8f 100644 --- a/app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -1,29 +1,26 @@ using AIStudio.Chat; using AIStudio.Dialogs.Settings; -namespace AIStudio.Assistants.PowerPoint; +namespace AIStudio.Assistants.SlideBuilder; -public partial class PowerPoint : AssistantBaseCore +public partial class SlideAssistant : AssistantBaseCore { - public override Tools.Components Component => Tools.Components.POWER_POINT_ASSISTANT; + public override Tools.Components Component => Tools.Components.SLIDE_BUILDER_ASSISTANT; - protected override string Title => T("Power Point"); + protected override string Title => T("Slide Assistant"); - protected override string Description => T("Create and refine PowerPoint slide text from a topic or outline."); + protected override string Description => T("Develop slide content based on a given topic and content."); protected override string SystemPrompt => $$""" You are a professional presentation editor and writer. Create a clear, single-slide outline from the user's inputs. - {{this.selectedTargetLanguage.PromptTranslation(this.customTargetLanguage)}} - - Inputs: - - "Your title": the main title. - {{this.inputText}} - - "Your content": the source text. - {{this.selectedTargetGroup.Prompt()}} - Rule for creating the individual subheadings: + # Content + You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. + + # Subheadings + - Rule for creating the individual subheadings: - If {{this.numberOfSheets}} is NOT 0 - Generate exactly {{this.numberOfSheets}} precise subheadings, each heading represents one slide in a presentation. - If {{this.timeSpecification}} is NOT 0 @@ -36,21 +33,27 @@ You are a professional presentation editor and writer. - Each bullet point must be max 12 words. - Place *** on its own line immediately before each heading. - Output requirements: + # Output requirements: - Output only Markdown. - - Start with a single H1 title from "Your title". - - Then add headings with own bullet lists based only on "Your content". - - If "Your content" is empty, output the title and one bullet: "No content provided." + - Start with a single H1 title that contains the user's PRESENTATION_TITLE. + - Then add headings with own bullet lists based only on the user's PRESENTATION_CONTENT. + - If PRESENTATION_CONTENT is empty, output the title and one bullet: "No content provided." - Do not mention these instructions or add commentary. + + # Target group: + {{this.selectedTargetGroup.Prompt()}} + + # Language: + {{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}} """; protected override bool AllowProfiles => false; protected override IReadOnlyList FooterButtons => []; - protected override string SubmitText => T("Create Power Point"); + protected override string SubmitText => T("Create Slides"); - protected override Func SubmitAction => this.CreatePowerPoint; + protected override Func SubmitAction => this.CreateSlideBuilder; protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with { @@ -59,7 +62,7 @@ You are a professional presentation editor and writer. protected override void ResetForm() { - this.inputText = string.Empty; + this.inputTitle = string.Empty; this.inputContext = string.Empty; this.expertInField = string.Empty; this.selectedTargetGroup = TargetGroup.NO_CHANGE; @@ -83,7 +86,7 @@ protected override bool MightPreselectValues() return false; } - private string inputText = string.Empty; + private string inputTitle = string.Empty; private string inputContext = string.Empty; private CommonLanguages selectedLanguage; private string customTargetLanguage = string.Empty; @@ -128,23 +131,8 @@ private int CalculateNumberOfSlides() { return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / 1.5); } - - private string UserPromptContext() - { - if(string.IsNullOrWhiteSpace(this.inputContext)) - return string.Empty; - - return $""" - The given context is: - - ``` - {this.inputContext} - ``` - - """; - } - private async Task CreatePowerPoint() + private async Task CreateSlideBuilder() { await this.form!.Validate(); if (!this.inputIsValid) @@ -155,11 +143,15 @@ private async Task CreatePowerPoint() this.CreateChatThread(); var time = this.AddUserRequest( $""" - {this.UserPromptContext()} - + # PRESENTATION_TITLE ``` - {this.inputText} + {this.inputTitle} ``` + + # PRESENTATION_CONTENT + ``` + {this.inputContext} + ``` """); await this.AddAIResponseAsync(time); diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor similarity index 82% rename from app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor rename to app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor index 553883b16..800144326 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor @@ -5,12 +5,12 @@ - @T("Assistant: Power Point Options") + @T("Assistant: Slide Assistant Options") - + @if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER) { diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs similarity index 54% rename from app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs rename to app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs index da9bc0c7b..236c16168 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogPowerPoint.razor.cs +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs @@ -2,6 +2,6 @@ namespace AIStudio.Dialogs.Settings; -public partial class SettingsDialogPowerPoint : SettingsDialogBase +public partial class SettingsDialogSlideBuilder : SettingsDialogBase { } \ No newline at end of file diff --git a/app/MindWork AI Studio/Pages/Assistants.razor b/app/MindWork AI Studio/Pages/Assistants.razor index 6003e1b35..55d8c95fb 100644 --- a/app/MindWork AI Studio/Pages/Assistants.razor +++ b/app/MindWork AI Studio/Pages/Assistants.razor @@ -38,7 +38,7 @@ (Components.JOB_POSTING_ASSISTANT, PreviewFeatures.NONE), (Components.LEGAL_CHECK_ASSISTANT, PreviewFeatures.NONE), (Components.ICON_FINDER_ASSISTANT, PreviewFeatures.NONE), - (Components.POWER_POINT_ASSISTANT, PreviewFeatures.NONE) + (Components.SLIDE_BUILDER_ASSISTANT, PreviewFeatures.NONE) )) { @@ -52,7 +52,7 @@ - + } diff --git a/app/MindWork AI Studio/Tools/CommonLanguageExtensions.cs b/app/MindWork AI Studio/Tools/CommonLanguageExtensions.cs index 02c24f759..734e18610 100644 --- a/app/MindWork AI Studio/Tools/CommonLanguageExtensions.cs +++ b/app/MindWork AI Studio/Tools/CommonLanguageExtensions.cs @@ -58,6 +58,14 @@ public static class CommonLanguageExtensions _ => $"Translate the given text in {language.Name()} ({language}).", }; + + public static string PromptGeneralPurpose(this CommonLanguages language, string customLanguage) => language switch + { + CommonLanguages.AS_IS => "Use the language the user input is written in for the output.", + CommonLanguages.OTHER => $"use the language {customLanguage} for your output.", + + _ => $"Use the language {language.Name()} ({language}) for your output.", + }; public static string NameSelecting(this CommonLanguages language) { diff --git a/app/MindWork AI Studio/Tools/Components.cs b/app/MindWork AI Studio/Tools/Components.cs index f8c6f6d15..89c1fa01d 100644 --- a/app/MindWork AI Studio/Tools/Components.cs +++ b/app/MindWork AI Studio/Tools/Components.cs @@ -19,7 +19,7 @@ public enum Components BIAS_DAY_ASSISTANT, ERI_ASSISTANT, DOCUMENT_ANALYSIS_ASSISTANT, - POWER_POINT_ASSISTANT, + SLIDE_BUILDER_ASSISTANT, // ReSharper disable InconsistentNaming I18N_ASSISTANT, diff --git a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs index dd488ffa8..20d8ebebd 100644 --- a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs +++ b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs @@ -43,7 +43,7 @@ public static class ComponentsExtensions Components.ERI_ASSISTANT => TB("ERI Server"), Components.I18N_ASSISTANT => TB("Localization Assistant"), Components.DOCUMENT_ANALYSIS_ASSISTANT => TB("Document Analysis Assistant"), - Components.POWER_POINT_ASSISTANT => TB("Power Point"), + Components.SLIDE_BUILDER_ASSISTANT => TB("Slide Assistant"), Components.CHAT => TB("New Chat"), From 91a63138ad80eb2d6af328cc9225fa115585fe13 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Wed, 11 Feb 2026 15:59:40 +0100 Subject: [PATCH 10/19] Modify system prompt --- .../Assistants/SlideBuilder/SlideAssistant.razor | 8 ++++---- .../Assistants/SlideBuilder/SlideAssistant.razor.cs | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index 67b767918..cb4749a43 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -9,16 +9,16 @@ diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index d760d1e8f..315d4183f 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -34,16 +34,17 @@ You are a professional presentation editor and writer. - Place *** on its own line immediately before each heading. # Output requirements: - - Output only Markdown. - - Start with a single H1 title that contains the user's PRESENTATION_TITLE. - - Then add headings with own bullet lists based only on the user's PRESENTATION_CONTENT. - - If PRESENTATION_CONTENT is empty, output the title and one bullet: "No content provided." - - Do not mention these instructions or add commentary. + - Output only Markdown. + - Start with a single H1 title that contains the user's PRESENTATION_TITLE. + - Then add headings with own bullet lists based only on the user's PRESENTATION_CONTENT. + - If PRESENTATION_CONTENT is empty, output the title and one bullet: "No content provided." + - Do not mention these instructions or add commentary. # Target group: {{this.selectedTargetGroup.Prompt()}} # Language: + - Ignore the language written in PRESENTATION_TITLE {{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}} """; From dbefdb80c6dc456c27aa2e1bd10d783b19be2f05 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Thu, 12 Feb 2026 11:52:26 +0100 Subject: [PATCH 11/19] Modify SystemPrompt and Description --- .../Assistants/I18N/allTexts.lua | 6 ++-- .../SlideBuilder/SlideAssistant.razor.cs | 32 +++++++++++++------ app/MindWork AI Studio/Routes.razor.cs | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index ad373db59..10f69c880 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1336,6 +1336,9 @@ 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" @@ -1351,9 +1354,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651 -- Create Slides UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593"] = "Create Slides" --- Develop slide content based on a given topic and content. -UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T311912219"] = "Develop slide content based on a given topic and content." - -- Please a title UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3359269886"] = "Please a title" diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index 315d4183f..c5389db74 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -9,22 +9,26 @@ public partial class SlideAssistant : AssistantBaseCore T("Slide Assistant"); - protected override string Description => T("Develop slide content based on a given topic and content."); + 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 SystemPrompt => - $$""" + $$$""" You are a professional presentation editor and writer. Create a clear, single-slide outline from the user's inputs. + # Presentation title: + - IGNORE the language of the PRESENTATION_TITLE. + - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} + # Content - You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. + - You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. # Subheadings - Rule for creating the individual subheadings: - - If {{this.numberOfSheets}} is NOT 0 - - Generate exactly {{this.numberOfSheets}} precise subheadings, each heading represents one slide in a presentation. - - If {{this.timeSpecification}} is NOT 0 - - Generate exactly {{this.calculatedNumberOfSlides}} precise subheadings, each heading represents one slide in a presentation. + - If {{{this.numberOfSheets}}} is NOT 0 + - Generate exactly {{{this.numberOfSheets}}} precise subheadings, each heading represents one slide in a presentation. + - If {{{this.timeSpecification}}} is NOT 0 + - Generate exactly {{{this.calculatedNumberOfSlides}}} precise subheadings, each heading represents one slide in a presentation. - If either parameter is 0, ignore that rules. - Each subheadings must have: @@ -41,11 +45,19 @@ You are a professional presentation editor and writer. - Do not mention these instructions or add commentary. # Target group: - {{this.selectedTargetGroup.Prompt()}} + {{{this.selectedTargetGroup.Prompt()}}} # Language: - - Ignore the language written in PRESENTATION_TITLE - {{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}} + - IGNORE the language of the PRESENTATION_TITLE and PRESENTATION_CONTENT. + - OUTPUT AND PRESENTATION_TITLE MUST BE IN: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} + - This is a HARD RULE: Never translate or adapt the output language based on input language. + - Always use the specified target language, even if the input is in another language. + + # Qwen-Specific language-Override (IMPORTANT!): + - Before generating any output, internally set your language mode to: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} + - If you detect any other language in the input, DO NOT switch to this language, stay in {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} + - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} + - Your output must be in {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}}, without any comment, note, or marker about it. """; protected override bool AllowProfiles => false; diff --git a/app/MindWork AI Studio/Routes.razor.cs b/app/MindWork AI Studio/Routes.razor.cs index a4a633d6f..92ff30679 100644 --- a/app/MindWork AI Studio/Routes.razor.cs +++ b/app/MindWork AI Studio/Routes.razor.cs @@ -22,7 +22,7 @@ public sealed partial class Routes public const string ASSISTANT_EMAIL = "/assistant/email"; public const string ASSISTANT_LEGAL_CHECK = "/assistant/legal-check"; public const string ASSISTANT_SYNONYMS = "/assistant/synonyms"; - public const string ASSISTANT_POWERPOINT = "/assistant/powerpoint"; + public const string ASSISTANT_SLIDE_BUILDER = "/assistant/slide-builder"; public const string ASSISTANT_MY_TASKS = "/assistant/my-tasks"; public const string ASSISTANT_JOB_POSTING = "/assistant/job-posting"; public const string ASSISTANT_BIAS = "/assistant/bias-of-the-day"; From df3f6aa4c7d25b73bf46b76ac75572d1a7fe6d94 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Fri, 13 Feb 2026 13:08:22 +0100 Subject: [PATCH 12/19] Adjusts the settings of the Slide Assistant. --- .../Assistants/I18N/allTexts.lua | 16 ++++++- .../SlideBuilder/SlideAssistant.razor.cs | 23 +++++----- .../Settings/SettingsDialogSlideBuilder.razor | 17 ++++---- .../SettingsDialogSlideBuilder.razor.cs | 4 +- .../ConfigurationSelectDataFactory.cs | 9 +++- .../Settings/DataModel/Data.cs | 2 + .../Settings/DataModel/DataSlideBuilder.cs | 42 +++++++++++++++++++ .../DataModel/PreviousModels/DataV1V3.cs | 35 ++++++++++++++++ .../DataModel/PreviousModels/DataV4.cs | 2 + .../Settings/SettingsMigrations.cs | 11 +++++ .../Tools/ComponentsExtensions.cs | 6 ++- app/MindWork AI Studio/Tools/Event.cs | 1 + 12 files changed, 141 insertions(+), 27 deletions(-) create mode 100644 app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 10f69c880..c80d13a85 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -4426,8 +4426,17 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGREWRITE::T3745021518 -- No rewrite & improve text options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGREWRITE::T553954963"] = "No rewrite & improve text options are preselected" --- When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model. -UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T183953912"] = "When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model." +-- Which target group should be preselected? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T121159821"] = "Which target group should be preselected?" + +-- Preselect the target group +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T122000493"] = "Preselect the target group" + +-- 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." + +-- 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?" -- Preselect Slide Assistant options? UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T227645894"] = "Preselect Slide Assistant options?" @@ -4447,6 +4456,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T32155 -- Close UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T3448155331"] = "Close" +-- Preselect one of your profiles? +UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T4004501229"] = "Preselect one of your profiles?" + -- No Slide Assistant options are preselected UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGSLIDEBUILDER::T4214398691"] = "No Slide Assistant options are preselected" diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index c5389db74..9cd656f50 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -60,7 +60,7 @@ You are a professional presentation editor and writer. - Your output must be in {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}}, without any comment, note, or marker about it. """; - protected override bool AllowProfiles => false; + protected override bool AllowProfiles => true; protected override IReadOnlyList FooterButtons => []; @@ -77,22 +77,21 @@ protected override void ResetForm() { this.inputTitle = string.Empty; this.inputContext = string.Empty; - this.expertInField = string.Empty; this.selectedTargetGroup = TargetGroup.NO_CHANGE; - this.customTargetGroup = string.Empty; if (!this.MightPreselectValues()) { - this.selectedLanguage = CommonLanguages.AS_IS; + this.selectedTargetLanguage = CommonLanguages.AS_IS; this.customTargetLanguage = string.Empty; } } protected override bool MightPreselectValues() { - if (this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions) + if (this.SettingsManager.ConfigurationData.SlideBuilder.PreselectOptions) { - this.selectedLanguage = this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage; - this.customTargetLanguage = this.SettingsManager.ConfigurationData.Synonyms.PreselectedOtherLanguage; + this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage; + this.customTargetLanguage = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedOtherLanguage; + this.selectedTargetGroup = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetGroup; return true; } @@ -101,11 +100,8 @@ protected override bool MightPreselectValues() private string inputTitle = string.Empty; private string inputContext = string.Empty; - private CommonLanguages selectedLanguage; private string customTargetLanguage = string.Empty; - private string expertInField = string.Empty; private TargetGroup selectedTargetGroup; - private string customTargetGroup = string.Empty; private CommonLanguages selectedTargetLanguage; private double numberOfSheets; private double timeSpecification; @@ -115,7 +111,7 @@ protected override bool MightPreselectValues() protected override async Task OnInitializedAsync() { - var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SEND_TO_SYNONYMS_ASSISTANT).FirstOrDefault(); + var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SEND_TO_SLIDE_BUILDER_ASSISTANT).FirstOrDefault(); if (deferredContent is not null) this.inputContext = deferredContent; @@ -134,7 +130,7 @@ protected override async Task OnInitializedAsync() private string? ValidateCustomLanguage(string language) { - if(this.selectedLanguage == CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language)) + if(this.selectedTargetLanguage == CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language)) return T("Please provide a custom language."); return null; @@ -165,7 +161,8 @@ private async Task CreateSlideBuilder() ``` {this.inputContext} ``` - """); + """, + hideContentFromUser: true); await this.AddAIResponseAsync(time); } diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor index 800144326..3446ae74a 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor @@ -1,4 +1,5 @@ @using AIStudio.Settings +@using AIStudio.Assistants.SlideBuilder @inherits SettingsDialogBase @@ -10,14 +11,16 @@ - - - @if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER) + + + @if (this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage is CommonLanguages.OTHER) { - + } - - + + + + @@ -25,4 +28,4 @@ @T("Close") - \ No newline at end of file + diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs index 236c16168..6d05294f0 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor.cs @@ -2,6 +2,4 @@ namespace AIStudio.Dialogs.Settings; -public partial class SettingsDialogSlideBuilder : SettingsDialogBase -{ -} \ No newline at end of file +public partial class SettingsDialogSlideBuilder : SettingsDialogBase; \ No newline at end of file diff --git a/app/MindWork AI Studio/Settings/ConfigurationSelectDataFactory.cs b/app/MindWork AI Studio/Settings/ConfigurationSelectDataFactory.cs index 3aa9342b3..59a7a8aa3 100644 --- a/app/MindWork AI Studio/Settings/ConfigurationSelectDataFactory.cs +++ b/app/MindWork AI Studio/Settings/ConfigurationSelectDataFactory.cs @@ -2,6 +2,7 @@ using AIStudio.Assistants.Coding; using AIStudio.Assistants.IconFinder; using AIStudio.Assistants.RewriteImprove; +using AIStudio.Assistants.SlideBuilder; using AIStudio.Assistants.TextSummarizer; using AIStudio.Assistants.EMail; using AIStudio.Provider; @@ -197,6 +198,12 @@ public static IEnumerable> GetSentenc foreach (var voice in Enum.GetValues()) yield return new(voice.Name(), voice); } + + public static IEnumerable> GetSlideBuilderTargetGroupData() + { + foreach (var group in Enum.GetValues()) + yield return new(group.Name(), group); + } public static IEnumerable> GetProfilesData(IEnumerable profiles) { @@ -254,4 +261,4 @@ public static IEnumerable> GetThemesData() foreach (var theme in Enum.GetValues()) yield return new(theme.GetName(), theme); } -} \ No newline at end of file +} diff --git a/app/MindWork AI Studio/Settings/DataModel/Data.cs b/app/MindWork AI Studio/Settings/DataModel/Data.cs index 622d737e1..5cec36635 100644 --- a/app/MindWork AI Studio/Settings/DataModel/Data.cs +++ b/app/MindWork AI Studio/Settings/DataModel/Data.cs @@ -113,6 +113,8 @@ public sealed class Data public DataEMail EMail { get; init; } = new(); + public DataSlideBuilder SlideBuilder { get; init; } = new(); + public DataLegalCheck LegalCheck { get; init; } = new(); public DataSynonyms Synonyms { get; init; } = new(); diff --git a/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs b/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs new file mode 100644 index 000000000..0b97e3657 --- /dev/null +++ b/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs @@ -0,0 +1,42 @@ +using AIStudio.Assistants.SlideBuilder; +using AIStudio.Provider; + +namespace AIStudio.Settings.DataModel; + +public class DataSlideBuilder +{ + /// + /// Preselect any Slide Builder options? + /// + public bool PreselectOptions { get; set; } = true; + + /// + /// Preselect a profile? + /// + public string PreselectedProfile { get; set; } = string.Empty; + + /// + /// Preselect a Slide Builder provider? + /// + public string PreselectedProvider { get; set; } = string.Empty; + + /// + /// Preselect the target language? + /// + public CommonLanguages PreselectedTargetLanguage { get; set; } + + /// + /// Preselect any other language? + /// + public string PreselectedOtherLanguage { get; set; } = string.Empty; + + /// + /// Preselect the complexity? + /// + public TargetGroup PreselectedTargetGroup { get; set; } + + /// + /// The minimum confidence level required for a provider to be considered. + /// + public ConfidenceLevel MinimumProviderConfidence { get; set; } = ConfidenceLevel.NONE; +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs index 88a8a3d29..633a777ff 100644 --- a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs +++ b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs @@ -1,5 +1,6 @@ using AIStudio.Assistants.Coding; using AIStudio.Assistants.IconFinder; +using AIStudio.Assistants.SlideBuilder; using AIStudio.Assistants.TextSummarizer; namespace AIStudio.Settings.DataModel.PreviousModels; @@ -228,6 +229,40 @@ public sealed class DataV1V3 /// public string PreselectedTextSummarizerProvider { get; set; } = string.Empty; + #endregion + + #region Assiatant: Slide Builder Settings + + /// + /// Preselect any slide builder options? + /// + public bool PreselectSlideBuilderOptions { get; set; } + + /// + /// Preselect any slide builder profile? + /// + public string PreselectedSlideBuilderProfile { get; set; } = string.Empty; + + /// + /// Preselect a text summarizer provider? + /// + public string PreselectedSlideBuilderProvider { get; set; } = string.Empty; + + /// + /// Preselect the target group? + /// + public TargetGroup PreselectedSlideBuilderTargetGroup { get; set; } + + /// + /// Preselect the target language? + /// + public CommonLanguages PreselectedSlideBuilderTargetLanguage { get; set; } + + /// + /// Preselect any other language? + /// + public string PreselectedSlideBuilderOtherLanguage { get; set; } = string.Empty; + #endregion #region Agent: Text Content Cleaner Settings diff --git a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs index 61555a3c2..f5b09098c 100644 --- a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs +++ b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs @@ -57,6 +57,8 @@ 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(); diff --git a/app/MindWork AI Studio/Settings/SettingsMigrations.cs b/app/MindWork AI Studio/Settings/SettingsMigrations.cs index e50418178..65263abe3 100644 --- a/app/MindWork AI Studio/Settings/SettingsMigrations.cs +++ b/app/MindWork AI Studio/Settings/SettingsMigrations.cs @@ -200,6 +200,16 @@ private static DataV4 MigrateV3ToV4(ILogger logger, DataV1V3 pr 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, @@ -236,6 +246,7 @@ private static Data MigrateV4ToV5(ILogger logger, DataV4 previo GrammarSpelling = previousConfig.GrammarSpelling, RewriteImprove = previousConfig.RewriteImprove, EMail = previousConfig.EMail, + SlideBuilder = previousConfig.SlideBuilder, LegalCheck = previousConfig.LegalCheck, Synonyms = previousConfig.Synonyms, MyTasks = previousConfig.MyTasks, diff --git a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs index 20d8ebebd..eaf64ba95 100644 --- a/app/MindWork AI Studio/Tools/ComponentsExtensions.cs +++ b/app/MindWork AI Studio/Tools/ComponentsExtensions.cs @@ -65,6 +65,7 @@ public static class ComponentsExtensions Components.MY_TASKS_ASSISTANT => new(Event.SEND_TO_MY_TASKS_ASSISTANT, Routes.ASSISTANT_MY_TASKS), Components.JOB_POSTING_ASSISTANT => new(Event.SEND_TO_JOB_POSTING_ASSISTANT, Routes.ASSISTANT_JOB_POSTING), Components.DOCUMENT_ANALYSIS_ASSISTANT => new(Event.SEND_TO_DOCUMENT_ANALYSIS_ASSISTANT, Routes.ASSISTANT_DOCUMENT_ANALYSIS), + Components.SLIDE_BUILDER_ASSISTANT => new(Event.SEND_TO_SLIDE_BUILDER_ASSISTANT, Routes.ASSISTANT_SLIDE_BUILDER), Components.CHAT => new(Event.SEND_TO_CHAT, Routes.CHAT), @@ -87,6 +88,7 @@ public static class ComponentsExtensions Components.JOB_POSTING_ASSISTANT => settingsManager.ConfigurationData.JobPostings.PreselectOptions ? settingsManager.ConfigurationData.JobPostings.MinimumProviderConfidence : default, Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.BiasOfTheDay.MinimumProviderConfidence : default, Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.ERI.MinimumProviderConfidence : default, + Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.SlideBuilder.MinimumProviderConfidence : default, #warning Add minimum confidence for DOCUMENT_ANALYSIS_ASSISTANT: //Components.DOCUMENT_ANALYSIS_ASSISTANT => settingsManager.ConfigurationData.DocumentAnalysis.PreselectOptions ? settingsManager.ConfigurationData.DocumentAnalysis.MinimumProviderConfidence : default, @@ -114,6 +116,7 @@ public static AIStudio.Settings.Provider PreselectedProvider(this Components com Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.BiasOfTheDay.PreselectedProvider) : null, Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.ERI.PreselectedProvider) : null, Components.I18N_ASSISTANT => settingsManager.ConfigurationData.I18N.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.I18N.PreselectedProvider) : null, + Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.SlideBuilder.PreselectedProvider) : null, #warning Add preselected provider for DOCUMENT_ANALYSIS_ASSISTANT: //Components.DOCUMENT_ANALYSIS_ASSISTANT => settingsManager.ConfigurationData.DocumentAnalysis.PreselectOptions ? settingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.DocumentAnalysis.PreselectedProvider) : null, @@ -141,7 +144,8 @@ public static AIStudio.Settings.Provider PreselectedProvider(this Components com Components.MY_TASKS_ASSISTANT => settingsManager.ConfigurationData.MyTasks.PreselectOptions ? settingsManager.ConfigurationData.Profiles.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.MyTasks.PreselectedProfile) ?? Profile.NO_PROFILE : Profile.NO_PROFILE, Components.BIAS_DAY_ASSISTANT => settingsManager.ConfigurationData.BiasOfTheDay.PreselectOptions ? settingsManager.ConfigurationData.Profiles.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.BiasOfTheDay.PreselectedProfile) ?? Profile.NO_PROFILE : Profile.NO_PROFILE, Components.ERI_ASSISTANT => settingsManager.ConfigurationData.ERI.PreselectOptions ? settingsManager.ConfigurationData.Profiles.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.ERI.PreselectedProfile) ?? Profile.NO_PROFILE : Profile.NO_PROFILE, - + Components.SLIDE_BUILDER_ASSISTANT => settingsManager.ConfigurationData.SlideBuilder.PreselectOptions ? settingsManager.ConfigurationData.Profiles.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.SlideBuilder.PreselectedProfile) ?? Profile.NO_PROFILE : Profile.NO_PROFILE, + Components.CHAT => settingsManager.ConfigurationData.Chat.PreselectOptions ? settingsManager.ConfigurationData.Profiles.FirstOrDefault(x => x.Id == settingsManager.ConfigurationData.Chat.PreselectedProfile) ?? Profile.NO_PROFILE : Profile.NO_PROFILE, _ => Profile.NO_PROFILE, diff --git a/app/MindWork AI Studio/Tools/Event.cs b/app/MindWork AI Studio/Tools/Event.cs index b3d3628f9..225e25006 100644 --- a/app/MindWork AI Studio/Tools/Event.cs +++ b/app/MindWork AI Studio/Tools/Event.cs @@ -54,4 +54,5 @@ public enum Event SEND_TO_MY_TASKS_ASSISTANT, SEND_TO_JOB_POSTING_ASSISTANT, SEND_TO_DOCUMENT_ANALYSIS_ASSISTANT, + SEND_TO_SLIDE_BUILDER_ASSISTANT } From 3346f3218c91a18f5b66fd79742fbd89d07c5e15 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Fri, 13 Feb 2026 13:58:47 +0100 Subject: [PATCH 13/19] Hide the content from the user in the text summarizer when it is sent to chat. --- .../Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs index 257ff39c8..4e0cfb446 100644 --- a/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs +++ b/app/MindWork AI Studio/Assistants/TextSummarizer/AssistantTextSummarizer.razor.cs @@ -138,7 +138,8 @@ private async Task SummarizeText() ``` {this.inputText} ``` - """); + """, + hideContentFromUser: true); await this.AddAIResponseAsync(time); } From ac3135f84d40f39579caedc76a497ce7c21817a5 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Thu, 19 Feb 2026 15:13:12 +0100 Subject: [PATCH 14/19] Add configurable bullet point count per slide in SlideAssistant --- .../SlideBuilder/SlideAssistant.razor | 13 +++++++++++-- .../SlideBuilder/SlideAssistant.razor.cs | 18 ++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index cb4749a43..8c712556a 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -7,15 +7,24 @@ - + + + + + - + Date: Mon, 23 Feb 2026 14:09:53 +0100 Subject: [PATCH 15/19] Add optional "Important Aspects" field to Slide Assistant --- .../Assistants/I18N/allTexts.lua | 6 ++++++ .../Assistants/SlideBuilder/SlideAssistant.razor | 1 + .../SlideBuilder/SlideAssistant.razor.cs | 16 ++++++++++++++++ .../Settings/DataModel/DataSlideBuilder.cs | 5 +++++ 4 files changed, 28 insertions(+) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index c80d13a85..6ab18459d 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1348,6 +1348,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1883918574 -- Target language UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T237828418"] = "Target language" +-- (Optional) Important Aspects +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T24391765"] = "(Optional) Important Aspects" + -- Target group UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651"] = "Target group" @@ -1357,6 +1360,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593 -- 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" diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index 8c712556a..ca2671b45 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -4,6 +4,7 @@ + diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index b237ceae8..f52d26a4b 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -22,6 +22,9 @@ You are a professional presentation editor and writer. # Content - You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. + + # Important aspects + - Emphasize the following aspects in your presentation {{{this.PromptImportantAspects()}}} # Subheadings - Rule for creating the individual subheadings: @@ -97,6 +100,7 @@ protected override bool MightPreselectValues() this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage; this.customTargetLanguage = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedOtherLanguage; this.selectedTargetGroup = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetGroup; + this.importantAspects = this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedImportantAspects; return true; } @@ -112,6 +116,7 @@ protected override bool MightPreselectValues() private double numberOfBulletPoints; private double timeSpecification; private int calculatedNumberOfSlides = 0; + private string importantAspects = string.Empty; #region Overrides of ComponentBase @@ -147,6 +152,17 @@ private int CalculateNumberOfSlides() return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / 1.5); } + private string PromptImportantAspects() + { + if (string.IsNullOrWhiteSpace(this.importantAspects)) + return string.Empty; + + return $""" + Emphasize the following aspects in your slides: + {this.importantAspects} + """; + } + private async Task CreateSlideBuilder() { await this.form!.Validate(); diff --git a/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs b/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs index 0b97e3657..a2e1cf2b6 100644 --- a/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs +++ b/app/MindWork AI Studio/Settings/DataModel/DataSlideBuilder.cs @@ -35,6 +35,11 @@ public class DataSlideBuilder /// public TargetGroup PreselectedTargetGroup { get; set; } + /// + /// Preselect any important aspects that the Slide Builder should take into account? + /// + public string PreselectedImportantAspects { get; set; } = string.Empty; + /// /// The minimum confidence level required for a provider to be considered. /// From fea0c63d439ed5e141db6f004917b8319b9a17c2 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Tue, 24 Feb 2026 13:43:14 +0100 Subject: [PATCH 16/19] Add option "Preselect important aspects" --- .../Assistants/I18N/allTexts.lua | 18 ++++--- .../SlideBuilder/SlideAssistant.razor | 10 ++-- .../SlideBuilder/SlideAssistant.razor.cs | 52 +++++++++++-------- .../Assistants/SlideBuilder/TargetGroup.cs | 13 +++++ .../SlideBuilder/TargetGroupExtensions.cs | 32 ++++++++++++ .../Settings/SettingsDialogSlideBuilder.razor | 7 +-- .../DataModel/PreviousModels/DataV1V3.cs | 34 ------------ .../DataModel/PreviousModels/DataV4.cs | 2 - .../Settings/SettingsMigrations.cs | 11 ---- 9 files changed, 95 insertions(+), 84 deletions(-) create mode 100644 app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroup.cs create mode 100644 app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroupExtensions.cs diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 6ab18459d..59358491a 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -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?" diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index ca2671b45..f1413a088 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -1,11 +1,11 @@ @attribute [Route(Routes.ASSISTANT_SLIDE_BUILDER)] @inherits AssistantBaseCore - + - - + + @@ -13,7 +13,7 @@ Label="Number of slides" Variant="Variant.Outlined" Class="mb-3" - Min="0.0" /> + Min="0" /> @@ -30,7 +30,7 @@ Label="Time specification (minutes)" Variant="Variant.Outlined" Class="mb-3" - Min="0.0" /> + Min="0" /> diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index f52d26a4b..4674af2d6 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -9,7 +9,7 @@ public partial class SlideAssistant : AssistantBaseCore 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 @@ You are a professional presentation editor and writer. # 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 @@ protected override bool MightPreselectValues() 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 @@ protected override async Task OnInitializedAsync() #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 @@ private string PromptImportantAspects() 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 @@ private async Task CreateSlideBuilder() 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); } diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroup.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroup.cs new file mode 100644 index 000000000..d8890c60d --- /dev/null +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroup.cs @@ -0,0 +1,13 @@ +namespace AIStudio.Assistants.SlideBuilder; + +public enum TargetGroup +{ + NO_CHANGE, + + CHILDREN, + STUDENTS, + SCIENTISTS, + OFFICE_WORKERS, + MANAGEMENT_BOARD, + +} diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroupExtensions.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroupExtensions.cs new file mode 100644 index 000000000..a9be78ffa --- /dev/null +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/TargetGroupExtensions.cs @@ -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.", + }; +} diff --git a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor index 3446ae74a..1e283c274 100644 --- a/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor +++ b/app/MindWork AI Studio/Dialogs/Settings/SettingsDialogSlideBuilder.razor @@ -1,5 +1,5 @@ -@using AIStudio.Settings -@using AIStudio.Assistants.SlideBuilder +@using AIStudio.Settings +@using AIStudio.Settings @inherits SettingsDialogBase @@ -12,6 +12,7 @@ + @if (this.SettingsManager.ConfigurationData.SlideBuilder.PreselectedTargetLanguage is CommonLanguages.OTHER) { @@ -28,4 +29,4 @@ @T("Close") - + \ No newline at end of file diff --git a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs index 633a777ff..bad14761d 100644 --- a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs +++ b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV1V3.cs @@ -229,40 +229,6 @@ public sealed class DataV1V3 /// public string PreselectedTextSummarizerProvider { get; set; } = string.Empty; - #endregion - - #region Assiatant: Slide Builder Settings - - /// - /// Preselect any slide builder options? - /// - public bool PreselectSlideBuilderOptions { get; set; } - - /// - /// Preselect any slide builder profile? - /// - public string PreselectedSlideBuilderProfile { get; set; } = string.Empty; - - /// - /// Preselect a text summarizer provider? - /// - public string PreselectedSlideBuilderProvider { get; set; } = string.Empty; - - /// - /// Preselect the target group? - /// - public TargetGroup PreselectedSlideBuilderTargetGroup { get; set; } - - /// - /// Preselect the target language? - /// - public CommonLanguages PreselectedSlideBuilderTargetLanguage { get; set; } - - /// - /// Preselect any other language? - /// - public string PreselectedSlideBuilderOtherLanguage { get; set; } = string.Empty; - #endregion #region Agent: Text Content Cleaner Settings diff --git a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs index f5b09098c..61555a3c2 100644 --- a/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs +++ b/app/MindWork AI Studio/Settings/DataModel/PreviousModels/DataV4.cs @@ -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(); diff --git a/app/MindWork AI Studio/Settings/SettingsMigrations.cs b/app/MindWork AI Studio/Settings/SettingsMigrations.cs index 65263abe3..e50418178 100644 --- a/app/MindWork AI Studio/Settings/SettingsMigrations.cs +++ b/app/MindWork AI Studio/Settings/SettingsMigrations.cs @@ -200,16 +200,6 @@ private static DataV4 MigrateV3ToV4(ILogger logger, DataV1V3 pr 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 @@ private static Data MigrateV4ToV5(ILogger logger, DataV4 previo GrammarSpelling = previousConfig.GrammarSpelling, RewriteImprove = previousConfig.RewriteImprove, EMail = previousConfig.EMail, - SlideBuilder = previousConfig.SlideBuilder, LegalCheck = previousConfig.LegalCheck, Synonyms = previousConfig.Synonyms, MyTasks = previousConfig.MyTasks, From 7f5efc80447b3ddf7aba3c603cc5a035e426c26d Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Wed, 25 Feb 2026 13:20:17 +0100 Subject: [PATCH 17/19] Refine SystemPrompt --- .../Assistants/SlideBuilder/SlideAssistant.razor.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index 4674af2d6..a35ee7669 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -22,7 +22,8 @@ You are a professional presentation editor and writer. # Content - You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. - - {{{this.PromptImportantAspects()}}} + + {{{this.PromptImportantAspects()}}} # Subheadings - Rule for creating the individual subheadings: @@ -35,9 +36,8 @@ You are a professional presentation editor and writer. - A clear, concise, and thematically meaningful heading. - Place *** on its own line immediately before each heading. - # BulletPoints (Per Subheading) + # Bullet points (per subheading) - You MUST generate exactly this {{{this.numberOfBulletPoints}}} many bullet points per subheading: - - Set as many bullet points as specified by variable {{{this.numberOfBulletPoints}}}. - If {{{this.numberOfBulletPoints}}} == 0 → choose a number between 1 and 7 (your choice, but max 7). - Each bullet point must have: - Each bullet point must be max 12 words. @@ -59,7 +59,7 @@ You are a professional presentation editor and writer. - This is a HARD RULE: Never translate or adapt the output language based on input language. - Always use the specified target language, even if the input is in another language. - # Qwen-Specific language-Override (IMPORTANT!): + # Language-Override (IMPORTANT!): - Before generating any output, internally set your language mode to: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} - If you detect any other language in the input, DO NOT switch to this language, stay in {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} @@ -139,7 +139,7 @@ protected override async Task OnInitializedAsync() private string? ValidatingContext(string text) { if(string.IsNullOrWhiteSpace(text)) - return T("Please provide context"); + return T("Please provide some input"); return null; } @@ -164,7 +164,8 @@ private string PromptImportantAspects() return $""" # Important aspects - - Emphasize the following aspects in your presentation {this.importantAspects} + Emphasize the following aspects in your presentation: + {this.importantAspects} """; } From ec23b0c3425b66fa8736bb32c7baca4b68d9f997 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Wed, 25 Feb 2026 14:52:21 +0100 Subject: [PATCH 18/19] Add AttachDocuments option in SlideAssistant --- .../Assistants/I18N/allTexts.lua | 6 ++ .../SlideBuilder/SlideAssistant.razor | 5 +- .../SlideBuilder/SlideAssistant.razor.cs | 86 +++++++++++++++++-- 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 59358491a..0601278a4 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1342,6 +1342,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1790167032 -- Slide Assistant UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T1883918574"] = "Slide Assistant" +-- Please provide some input +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2236278390"] = "Please provide some input" + -- Target language UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T237828418"] = "Target language" @@ -1354,6 +1357,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651 -- Please provide a title UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3049299559"] = "Please provide a title" +-- Upload documents for input +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3064715989"] = "Upload documents for input" + -- Create Slides UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593"] = "Create Slides" diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index f1413a088..5e98996bf 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -3,8 +3,9 @@ - - + + @T("Upload documents for input") + diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index a35ee7669..8dbe12ef0 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -1,4 +1,5 @@ -using AIStudio.Chat; +using System.Text; +using AIStudio.Chat; using AIStudio.Dialogs.Settings; namespace AIStudio.Assistants.SlideBuilder; @@ -21,8 +22,8 @@ You are a professional presentation editor and writer. - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} # Content - - You get the following inputs: PRESENTATION_TITLE and PRESENTATION_CONTENT. - + - You get the following inputs: PRESENTATION_TITLE, PRESENTATION_CONTENT, and any attached documents that may provide additional context or source material. + {{{this.PromptImportantAspects()}}} # Subheadings @@ -115,6 +116,7 @@ protected override bool MightPreselectValues() private int timeSpecification; private int calculatedNumberOfSlides = 0; private string importantAspects = string.Empty; + private HashSet loadedDocumentPaths = []; #region Overrides of ComponentBase @@ -168,7 +170,76 @@ private string PromptImportantAspects() {this.importantAspects} """; } - + + private async Task PromptLoadDocumentsContent() + { + if (this.loadedDocumentPaths.Count == 0) + return string.Empty; + + var documents = this.loadedDocumentPaths.Where(n => n is { Exists: true, IsImage: false }).ToList(); + var sb = new StringBuilder(); + + if (documents.Count > 0) + { + sb.AppendLine(""" + # DOCUMENTS: + + """); + } + + var numDocuments = 1; + foreach (var document in documents) + { + if (document.IsForbidden) + { + this.Logger.LogWarning($"Skipping forbidden file: '{document.FilePath}'."); + continue; + } + + var fileContent = await this.RustService.ReadArbitraryFileData(document.FilePath, int.MaxValue); + sb.AppendLine($""" + + ## DOCUMENT {numDocuments}: + File path: {document.FilePath} + Content: + ``` + {fileContent} + ``` + + --- + + """); + numDocuments++; + } + + var numImages = this.loadedDocumentPaths.Count(x => x is { IsImage: true, Exists: true }); + if (numImages > 0) + { + if (documents.Count == 0) + { + sb.AppendLine($""" + + There are {numImages} image file(s) attached as documents. + Please consider them as documents as well and use them to + answer accordingly. + + """); + } + else + { + sb.AppendLine($""" + + Additionally, there are {numImages} image file(s) attached. + Please consider them as documents as well and use them to + answer accordingly. + + """); + } + } + + return sb.ToString(); + } + private async Task CreateSlideBuilder() { await this.form!.Validate(); @@ -178,6 +249,9 @@ private async Task CreateSlideBuilder() this.calculatedNumberOfSlides = this.timeSpecification > 0 ? this.CalculateNumberOfSlides() : 0; this.CreateChatThread(); + var documentContent = await this.PromptLoadDocumentsContent(); + var imageAttachments = this.loadedDocumentPaths.Where(n => n is { Exists: true, IsImage: true }).ToList(); + var time = this.AddUserRequest( $""" # PRESENTATION_TITLE @@ -189,9 +263,11 @@ private async Task CreateSlideBuilder() ``` {this.inputContext} + {documentContent} ``` """, - hideContentFromUser: true); + hideContentFromUser: true, + imageAttachments); await this.AddAIResponseAsync(time); } From b3b0fbe588ff02a3bbf5609f3a0213d39548e963 Mon Sep 17 00:00:00 2001 From: hart_s3 Date: Fri, 27 Feb 2026 14:46:45 +0100 Subject: [PATCH 19/19] Improve context handling in SlideAssistant --- .../Assistants/I18N/allTexts.lua | 9 ++ .../SlideBuilder/SlideAssistant.razor | 6 +- .../SlideBuilder/SlideAssistant.razor.cs | 106 ++++++++++++++++-- 3 files changed, 108 insertions(+), 13 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua index 0601278a4..f7af10626 100644 --- a/app/MindWork AI Studio/Assistants/I18N/allTexts.lua +++ b/app/MindWork AI Studio/Assistants/I18N/allTexts.lua @@ -1354,6 +1354,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T24391765"] -- Target group UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T2709966651"] = "Target group" +-- The result of your previous slide builder session. +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3000286990"] = "The result of your previous slide builder session." + -- Please provide a title UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3049299559"] = "Please provide a title" @@ -1366,9 +1369,15 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3079776593 -- (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." +-- Empty +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3512147854"] = "Empty" + -- Custom target language UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3848935911"] = "Custom target language" +-- {0} - Slide Builder Session +UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::SLIDEBUILDER::SLIDEASSISTANT::T3922788056"] = "{0} - Slide Builder Session" + -- 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." diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor index 5e98996bf..1b3f13f41 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor @@ -3,10 +3,10 @@ - - @T("Upload documents for input") + + @T("Upload documents for input") - + diff --git a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs index 8dbe12ef0..409c07fe5 100644 --- a/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs +++ b/app/MindWork AI Studio/Assistants/SlideBuilder/SlideAssistant.razor.cs @@ -22,9 +22,10 @@ You are a professional presentation editor and writer. - Translate PRESENTATION_TITLE in: {{{this.selectedTargetLanguage.PromptGeneralPurpose(this.customTargetLanguage)}}} # Content - - You get the following inputs: PRESENTATION_TITLE, PRESENTATION_CONTENT, and any attached documents that may provide additional context or source material. + - You get the following inputs: PRESENTATION_TITLE, PRESENTATION_CONTENT, and any attached documents that may provide additional context or source material (DOCUMENTS). - {{{this.PromptImportantAspects()}}} + {{{this.GetDocumentTaskDescription()}}} + {{{this.PromptImportantAspects()}}} # Subheadings - Rule for creating the individual subheadings: @@ -75,15 +76,76 @@ You are a professional presentation editor and writer. protected override Func SubmitAction => this.CreateSlideBuilder; - protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with + protected override ChatThread ConvertToChatThread { - SystemPrompt = SystemPrompts.DEFAULT, - }; + get + { + if (this.chatThread is null || this.chatThread.Blocks.Count < 2) + { + return new ChatThread + { + SystemPrompt = SystemPrompts.DEFAULT + }; + } + + var presentationTitle = string.IsNullOrWhiteSpace(this.inputTitle) ? this.T("Empty") : this.inputTitle; + + return new ChatThread + { + ChatId = Guid.NewGuid(), + Name = string.Format(T("{0} - Slide Builder Session"), presentationTitle), + SystemPrompt = SystemPrompts.DEFAULT, + Blocks = + [ + // Visible user block: + new ContentBlock + { + Time = this.chatThread.Blocks.First().Time, + Role = ChatRole.USER, + HideFromUser = false, + ContentType = ContentType.TEXT, + Content = new ContentText + { + Text = this.T("The result of your previous slide builder session."), + FileAttachments = this.loadedDocumentPaths.ToList(), + } + }, + + // Hidden user block with inputContent data: + new ContentBlock + { + Time = this.chatThread.Blocks.First().Time, + Role = ChatRole.USER, + HideFromUser = true, + ContentType = ContentType.TEXT, + Content = new ContentText + { + Text = $""" + # PRESENTATION_TITLE + ``` + {presentationTitle} + ``` + + # PRESENTATION_CONTENT + ``` + {this.inputContent} + ``` + """, + } + }, + + // Then, append the last block of the current chat thread + // (which is expected to be the AI response): + this.chatThread.Blocks.Last(), + ] + }; + } + } protected override void ResetForm() { this.inputTitle = string.Empty; - this.inputContext = string.Empty; + this.inputContent = string.Empty; this.selectedTargetGroup = TargetGroup.NO_CHANGE; if (!this.MightPreselectValues()) { @@ -107,7 +169,7 @@ protected override bool MightPreselectValues() } private string inputTitle = string.Empty; - private string inputContext = string.Empty; + private string inputContent = string.Empty; private string customTargetLanguage = string.Empty; private TargetGroup selectedTargetGroup; private CommonLanguages selectedTargetLanguage; @@ -124,7 +186,7 @@ protected override async Task OnInitializedAsync() { var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages(Event.SEND_TO_SLIDE_BUILDER_ASSISTANT).FirstOrDefault(); if (deferredContent is not null) - this.inputContext = deferredContent; + this.inputContent = deferredContent; await base.OnInitializedAsync(); } @@ -165,11 +227,34 @@ private string PromptImportantAspects() return string.Empty; return $""" + # Important aspects Emphasize the following aspects in your presentation: {this.importantAspects} """; } + + private string GetDocumentTaskDescription() + { + var numDocuments = this.loadedDocumentPaths.Count(x => x is { Exists: true, IsImage: false }); + var numImages = this.loadedDocumentPaths.Count(x => x is { Exists: true, IsImage: true }); + + return (numDocuments, numImages) switch + { + (0, 1) => "Your task is to analyze a single image file attached as a document.", + (0, > 1) => $"Your task is to analyze {numImages} image file(s) attached as documents.", + + (1, 0) => "Your task is to analyze a single DOCUMENT.", + (1, 1) => "Your task is to analyze a single DOCUMENT and 1 image file attached as a document.", + (1, > 1) => $"Your task is to analyze a single DOCUMENT and {numImages} image file(s) attached as documents.", + + (> 0, 0) => $"Your task is to analyze {numDocuments} DOCUMENTS. Different DOCUMENTS are divided by a horizontal rule in markdown formatting followed by the name of the document.", + (> 0, 1) => $"Your task is to analyze {numDocuments} DOCUMENTS and 1 image file attached as a document. Different DOCUMENTS are divided by a horizontal rule in Markdown formatting followed by the name of the document.", + (> 0, > 0) => $"Your task is to analyze {numDocuments} DOCUMENTS and {numImages} image file(s) attached as documents. Different DOCUMENTS are divided by a horizontal rule in Markdown formatting followed by the name of the document.", + + _ => "Your task is to analyze a single DOCUMENT." + }; + } private async Task PromptLoadDocumentsContent() { @@ -262,9 +347,10 @@ private async Task CreateSlideBuilder() # PRESENTATION_CONTENT ``` - {this.inputContext} - {documentContent} + {this.inputContent} ``` + + {documentContent} """, hideContentFromUser: true, imageAttachments);