mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-02-12 09:41:36 +00:00
Integrate the assistant into the code
This commit is contained in:
parent
edacfb196b
commit
51154ec6b3
@ -1,8 +1,8 @@
|
||||
@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"/>
|
||||
<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")" />
|
||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
|
||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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>
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ public enum Components
|
||||
BIAS_DAY_ASSISTANT,
|
||||
ERI_ASSISTANT,
|
||||
DOCUMENT_ANALYSIS_ASSISTANT,
|
||||
POWER_POINT_ASSISTANT,
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
I18N_ASSISTANT,
|
||||
|
||||
@ -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"),
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user