Integrate the assistant into the code

This commit is contained in:
hart_s3 2026-01-29 13:50:20 +01:00
parent edacfb196b
commit 51154ec6b3
7 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,4 @@
@attribute [Route(Routes.ASSISTANT_SYNONYMS)]
@attribute [Route(Routes.ASSISTANT_POWERPOINT)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogPowerPoint>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@Icons.Material.Filled.Spellcheck" Adornment="Adornment.Start" Label="@T("Your word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>

View File

@ -6,11 +6,11 @@ namespace AIStudio.Assistants.PowerPoint;
public partial class PowerPoint : AssistantBaseCore<SettingsDialogPowerPoint>
{
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 @@ public partial class PowerPoint : AssistantBaseCore<SettingsDialogPowerPoint>
protected override IReadOnlyList<IButtonData> FooterButtons => [];
protected override string SubmitText => T("Find synonyms");
protected override string SubmitText => T("Create Power Point");
protected override Func<Task> SubmitAction => this.FindSynonyms;

View File

@ -5,12 +5,12 @@
<TitleContent>
<MudText Typo="Typo.h6" Class="d-flex align-center">
<MudIcon Icon="@Icons.Material.Filled.Spellcheck" Class="mr-2" />
@T("Assistant: Synonyms Options")
@T("Assistant: Power Point Options")
</MudText>
</TitleContent>
<DialogContent>
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<ConfigurationOption OptionDescription="@T("Preselect synonym options?")" LabelOn="@T("Synonym options are preselected")" LabelOff="@T("No synonym 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.")"/>
<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)
{

View File

@ -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">
@ -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>
}

View File

@ -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";

View File

@ -19,6 +19,7 @@ public enum Components
BIAS_DAY_ASSISTANT,
ERI_ASSISTANT,
DOCUMENT_ANALYSIS_ASSISTANT,
POWER_POINT_ASSISTANT,
// ReSharper disable InconsistentNaming
I18N_ASSISTANT,

View File

@ -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"),