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,8 +1,8 @@
@attribute [Route(Routes.ASSISTANT_SYNONYMS)] @attribute [Route(Routes.ASSISTANT_POWERPOINT)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogPowerPoint> @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"/> <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"/>
<MudTextField T="string" @bind-Text="@this.inputContext" AdornmentIcon="@Icons.Material.Filled.Description" Adornment="Adornment.Start" Lines="2" AutoGrow="@false" Label="@T("(Optional) The context for the given word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/> <MudTextField T="string" @bind-Text="@this.inputContext" AdornmentIcon="@Icons.Material.Filled.Description" Adornment="Adornment.Start" Lines="2" AutoGrow="@false" Label="@T("(Optional) The context for the given word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelectingOptional())" @bind-Value="@this.selectedLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" /> <EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelectingOptional())" @bind-Value="@this.selectedLanguage" Icon="@Icons.Material.Filled.Translate" Label="@T("Language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" />
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/> <ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>

View File

@ -6,11 +6,11 @@ namespace AIStudio.Assistants.PowerPoint;
public partial class PowerPoint : AssistantBaseCore<SettingsDialogPowerPoint> 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 => protected override string SystemPrompt =>
$""" $"""
@ -50,7 +50,7 @@ public partial class PowerPoint : AssistantBaseCore<SettingsDialogPowerPoint>
protected override IReadOnlyList<IButtonData> FooterButtons => []; 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; protected override Func<Task> SubmitAction => this.FindSynonyms;

View File

@ -5,12 +5,12 @@
<TitleContent> <TitleContent>
<MudText Typo="Typo.h6" Class="d-flex align-center"> <MudText Typo="Typo.h6" Class="d-flex align-center">
<MudIcon Icon="@Icons.Material.Filled.Spellcheck" Class="mr-2" /> <MudIcon Icon="@Icons.Material.Filled.Spellcheck" Class="mr-2" />
@T("Assistant: Synonyms Options") @T("Assistant: Power Point Options")
</MudText> </MudText>
</TitleContent> </TitleContent>
<DialogContent> <DialogContent>
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg"> <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?")"/> <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) @if (this.SettingsManager.ConfigurationData.Synonyms.PreselectedLanguage is CommonLanguages.OTHER)
{ {

View File

@ -37,7 +37,8 @@
(Components.AGENDA_ASSISTANT, PreviewFeatures.NONE), (Components.AGENDA_ASSISTANT, PreviewFeatures.NONE),
(Components.JOB_POSTING_ASSISTANT, PreviewFeatures.NONE), (Components.JOB_POSTING_ASSISTANT, PreviewFeatures.NONE),
(Components.LEGAL_CHECK_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"> <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="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="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="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> </MudStack>
} }

View File

@ -22,6 +22,7 @@ public sealed partial class Routes
public const string ASSISTANT_EMAIL = "/assistant/email"; public const string ASSISTANT_EMAIL = "/assistant/email";
public const string ASSISTANT_LEGAL_CHECK = "/assistant/legal-check"; public const string ASSISTANT_LEGAL_CHECK = "/assistant/legal-check";
public const string ASSISTANT_SYNONYMS = "/assistant/synonyms"; 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_MY_TASKS = "/assistant/my-tasks";
public const string ASSISTANT_JOB_POSTING = "/assistant/job-posting"; public const string ASSISTANT_JOB_POSTING = "/assistant/job-posting";
public const string ASSISTANT_BIAS = "/assistant/bias-of-the-day"; 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_AI_STUDIO_I18N = "/assistant/ai-studio/i18n";
public const string ASSISTANT_DOCUMENT_ANALYSIS = "/assistant/document-analysis"; public const string ASSISTANT_DOCUMENT_ANALYSIS = "/assistant/document-analysis";
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming
} }

View File

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

View File

@ -43,6 +43,7 @@ public static class ComponentsExtensions
Components.ERI_ASSISTANT => TB("ERI Server"), Components.ERI_ASSISTANT => TB("ERI Server"),
Components.I18N_ASSISTANT => TB("Localization Assistant"), Components.I18N_ASSISTANT => TB("Localization Assistant"),
Components.DOCUMENT_ANALYSIS_ASSISTANT => TB("Document Analysis Assistant"), Components.DOCUMENT_ANALYSIS_ASSISTANT => TB("Document Analysis Assistant"),
Components.POWER_POINT_ASSISTANT => TB("Power Point"),
Components.CHAT => TB("New Chat"), Components.CHAT => TB("New Chat"),