Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions app/MindWork AI Studio/Assistants/I18N/allTexts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,54 @@ 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."

Expand Down Expand Up @@ -4297,6 +4345,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"

Expand Down Expand Up @@ -4825,6 +4900,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."

Expand Down Expand Up @@ -5722,6 +5803,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"

Expand Down
27 changes: 27 additions & 0 deletions app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@attribute [Route(Routes.ASSISTANT_POWERPOINT)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogPowerPoint>

<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidatingText" Adornment="Adornment.Start" Label="@T("Your title")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>

<MudTextField T="string" @bind-Text="@this.inputContext" Adornment="Adornment.Start" Lines="6" MaxLines="12" AutoGrow="@false" Label="@T("Your content")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ReadFileContent @bind-FileContent="@this.inputContext"/>

<MudGrid>
<MudItem xs="6">
<MudNumericField @bind-Value="numberOfSheets"
Label="Number of sheets"
Variant="Variant.Text"
Min="0.0" />
</MudItem>

<MudItem xs="6">
<MudNumericField @bind-Value="timeSpecification"
Label="Time specification"
Variant="Variant.Text"
Step=".2M" />
</MudItem>
</MudGrid>

<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name())" @bind-Value="@this.selectedTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Target language")" AllowOther="@true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomLanguage" />
<EnumSelection T="TargetGroup" NameFunc="@(group => group.Name())" @bind-Value="@this.selectedTargetGroup" Icon="@Icons.Material.Filled.Groups" Label="@T("Target group")" />
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
166 changes: 166 additions & 0 deletions app/MindWork AI Studio/Assistants/PowerPoint/PowerPoint.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using AIStudio.Chat;
using AIStudio.Dialogs.Settings;

namespace AIStudio.Assistants.PowerPoint;

public partial class PowerPoint : AssistantBaseCore<SettingsDialogPowerPoint>
{
public override Tools.Components Component => Tools.Components.POWER_POINT_ASSISTANT;

protected override string Title => T("Power Point");

protected override string Description => T("Create and refine PowerPoint slide text from a topic or outline.");

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:
- 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 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.
""";

protected override bool AllowProfiles => false;

protected override IReadOnlyList<IButtonData> FooterButtons => [];

protected override string SubmitText => T("Create Power Point");

protected override Func<Task> SubmitAction => this.CreatePowerPoint;

protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{
SystemPrompt = SystemPrompts.DEFAULT,
};

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;
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;
private string expertInField = string.Empty;
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()
{
var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages<string>(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 a title");

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 int CalculateNumberOfSlides()
{
return this.calculatedNumberOfSlides = (int)Math.Round(this.timeSpecification / (decimal)1.5);
}

private string UserPromptContext()
{
if(string.IsNullOrWhiteSpace(this.inputContext))
return string.Empty;

return $"""
The given context is:

```
{this.inputContext}
```

""";
}

private async Task CreatePowerPoint()
{
await this.form!.Validate();
if (!this.inputIsValid)
return;

this.calculatedNumberOfSlides = this.timeSpecification > 0 ? this.CalculateNumberOfSlides() : 0;

this.CreateChatThread();
var time = this.AddUserRequest(
$"""
{this.UserPromptContext()}

```
{this.inputText}
```
""");

await this.AddAIResponseAsync(time);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@using AIStudio.Settings
@inherits SettingsDialogBase

<MudDialog>
<TitleContent>
<MudText Typo="Typo.h6" Class="d-flex align-center">
<MudIcon Icon="@Icons.Material.Filled.Spellcheck" Class="mr-2" />
@T("Assistant: Power Point Options")
</MudText>
</TitleContent>
<DialogContent>
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect Power Point options?")" LabelOn="@T("Power Point options are preselected")" LabelOff="@T("No Power Point options are preselected")" State="@(() => this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions)" StateUpdate="@(updatedState => this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions = updatedState)" OptionHelp="@T("When enabled, you can preselect synonym options. This is might be useful when you prefer a specific language or LLM model.")"/>
<ConfigurationSelect OptionDescription="@T("Preselect the language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage)" Data="@ConfigurationSelectDataFactory.GetCommonLanguagesOptionalData()" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage = selectedValue)" OptionHelp="@T("Which language should be preselected?")"/>
@if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER)
{
<ConfigurationText OptionDescription="@T("Preselect another language")" Disabled="@(() => !this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions)" Icon="@Icons.Material.Filled.Translate" Text="@(() => this.SettingsManager.ConfigurationData.Synonyms.PreselectedOtherLanguage)" TextUpdate="@(updatedText => this.SettingsManager.ConfigurationData.Synonyms.PreselectedOtherLanguage = updatedText)"/>
}
<ConfigurationMinConfidenceSelection Disabled="@(() => !this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions)" RestrictToGlobalMinimumConfidence="@true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.Synonyms.MinimumProviderConfidence)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.Synonyms.MinimumProviderConfidence = selectedValue)"/>
<ConfigurationProviderSelection Component="Components.SYNONYMS_ASSISTANT" Data="@this.availableLLMProviders" Disabled="@(() => !this.SettingsManager.ConfigurationData.Synonyms.PreselectOptions)" SelectedValue="@(() => this.SettingsManager.ConfigurationData.Synonyms.PreselectedProvider)" SelectionUpdate="@(selectedValue => this.SettingsManager.ConfigurationData.Synonyms.PreselectedProvider = selectedValue)"/>
</MudPaper>
</DialogContent>
<DialogActions>
<MudButton OnClick="@this.Close" Variant="Variant.Filled">
@T("Close")
</MudButton>
</DialogActions>
</MudDialog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Microsoft.AspNetCore.Components;

namespace AIStudio.Dialogs.Settings;

public partial class SettingsDialogPowerPoint : SettingsDialogBase
{
}
4 changes: 3 additions & 1 deletion app/MindWork AI Studio/Pages/Assistants.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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)
))
{
<MudText Typo="Typo.h4" Class="mb-2 mr-3 mt-6">
Expand All @@ -51,6 +52,7 @@
<AssistantBlock TSettings="SettingsDialogJobPostings" Component="Components.JOB_POSTING_ASSISTANT" Name="@T("Job Posting")" Description="@T("Generate a job posting for a given job description.")" Icon="@Icons.Material.Filled.Work" Link="@Routes.ASSISTANT_JOB_POSTING"/>
<AssistantBlock TSettings="SettingsDialogLegalCheck" Component="Components.LEGAL_CHECK_ASSISTANT" Name="@T("Legal Check")" Description="@T("Ask a question about a legal document.")" Icon="@Icons.Material.Filled.Gavel" Link="@Routes.ASSISTANT_LEGAL_CHECK"/>
<AssistantBlock TSettings="SettingsDialogIconFinder" Component="Components.ICON_FINDER_ASSISTANT" Name="@T("Icon Finder")" Description="@T("Use an LLM to find an icon for a given context.")" Icon="@Icons.Material.Filled.FindInPage" Link="@Routes.ASSISTANT_ICON_FINDER"/>
<AssistantBlock TSettings="SettingsDialogPowerPoint" Component="Components.POWER_POINT_ASSISTANT" Name="@T("Power Point")" Description="@T("Create and refine PowerPoint slide text from a topic or outline.")" Icon="@Icons.Material.Filled.Slideshow" Link="@Routes.ASSISTANT_POWERPOINT"/>
</MudStack>
}

Expand Down
3 changes: 2 additions & 1 deletion app/MindWork AI Studio/Routes.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ 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";
public const string ASSISTANT_ERI = "/assistant/eri";
public const string ASSISTANT_AI_STUDIO_I18N = "/assistant/ai-studio/i18n";
public const string ASSISTANT_DOCUMENT_ANALYSIS = "/assistant/document-analysis";
// ReSharper restore InconsistentNaming
}
}
1 change: 1 addition & 0 deletions app/MindWork AI Studio/Tools/Components.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum Components
BIAS_DAY_ASSISTANT,
ERI_ASSISTANT,
DOCUMENT_ANALYSIS_ASSISTANT,
POWER_POINT_ASSISTANT,

// ReSharper disable InconsistentNaming
I18N_ASSISTANT,
Expand Down
1 change: 1 addition & 0 deletions app/MindWork AI Studio/Tools/ComponentsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),

Expand Down