included a dropdown to select a broader assistant category

This commit is contained in:
Nils Kruthoff 2026-06-23 11:36:08 +02:00
parent 629d3243fa
commit 37271d65b1
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C
4 changed files with 50 additions and 2 deletions

View File

@ -1,4 +1,5 @@
@attribute [Route(Routes.ASSISTANT_META_ASSISTANT)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.NoSettingsPanel>
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
<EnumSelection T="AssistantCategory" NameFunc="@(category => category.NameSelecting())" @bind-Value="@this.selectedCategory" ValidateSelection="@this.ValidatingCategory" Icon="@Icons.Material.Filled.Category" Label="@T("Assistant category")" AllowOther="@true" OtherValue="AssistantCategory.OTHER" @bind-OtherInput="@this.customCategory" ValidateOther="@this.ValidateCustomCategory" LabelOther="@T("Custom assistant category")" />
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>

View File

@ -17,7 +17,8 @@
(Components.GRAMMAR_SPELLING_ASSISTANT, PreviewFeatures.NONE),
(Components.REWRITE_ASSISTANT, PreviewFeatures.NONE),
(Components.PROMPT_OPTIMIZER_ASSISTANT, PreviewFeatures.NONE),
(Components.SYNONYMS_ASSISTANT, PreviewFeatures.NONE)
(Components.SYNONYMS_ASSISTANT, PreviewFeatures.NONE),
(Components.META_ASSISTANT, PreviewFeatures.NONE)
))
{
<MudText Typo="Typo.h4" Class="mb-2 mr-3">

View File

@ -0,0 +1,15 @@
namespace AIStudio.Tools;
public enum AssistantCategory
{
AS_IS,
GENERAL,
SCIENTIFIC,
PRODUCTIVITY,
BUSINESS,
LEARNING,
DEVELOPMENT,
AI_STUDIO,
OTHER,
}

View File

@ -0,0 +1,31 @@
using AIStudio.Tools.PluginSystem;
namespace AIStudio.Tools;
public static class AssistantCategoryExtensions
{
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(AssistantCategoryExtensions).Namespace, nameof(AssistantCategoryExtensions));
public static string Name(this AssistantCategory category) => category switch
{
AssistantCategory.AS_IS => TB("Please select the assistant category"),
AssistantCategory.GENERAL => TB("General"),
AssistantCategory.SCIENTIFIC => TB("Scientific"),
AssistantCategory.BUSINESS => TB("Business"),
AssistantCategory.PRODUCTIVITY => TB("Productivity"),
AssistantCategory.DEVELOPMENT => TB("Software Development"),
AssistantCategory.LEARNING => TB("Learning"),
AssistantCategory.AI_STUDIO => TB("AI Studio Development"),
AssistantCategory.OTHER => TB("Other"),
_ => string.Empty,
};
public static string NameSelecting(this AssistantCategory category)
{
if(category is AssistantCategory.AS_IS)
return TB("Please select the assistant category");
return category.Name();
}
}