Removed the unnecessary SettingsPanels from the assistants and the enum

This commit is contained in:
Peer Schütt 2025-03-11 16:15:46 +01:00
parent 1568b56f70
commit 490b276495
19 changed files with 4 additions and 56 deletions

View File

@ -103,8 +103,6 @@ public partial class AssistantAgenda : AssistantBaseCore<SettingsDialogAgenda>
protected override Func<Task> SubmitAction => this.CreateAgenda; protected override Func<Task> SubmitAction => this.CreateAgenda;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_AGENDA_PANEL;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{ {
SystemPrompt = SystemPrompts.DEFAULT, SystemPrompt = SystemPrompts.DEFAULT,

View File

@ -76,8 +76,6 @@ public abstract partial class AssistantBase<TSettings> : ComponentBase, IMessage
protected abstract Func<Task> SubmitAction { get; } protected abstract Func<Task> SubmitAction { get; }
protected abstract SettingsPanel SettingsPanel { get; }
protected virtual bool SubmitDisabled => false; protected virtual bool SubmitDisabled => false;
private protected virtual RenderFragment? Body => null; private protected virtual RenderFragment? Body => null;
@ -326,12 +324,6 @@ public abstract partial class AssistantBase<TSettings> : ComponentBase, IMessage
return icon; return icon;
} }
protected void NavigateToSettings()
{
MessageBus.INSTANCE.DeferMessage(this, Event.SWITCH_TO_SETTINGS_PANEL, this.SettingsPanel);
this.NavigationManager.NavigateTo(Routes.SETTINGS);
}
protected async Task OpenSettingsDialog() protected async Task OpenSettingsDialog()
{ {
var dialogParameters = new DialogParameters(); var dialogParameters = new DialogParameters();

View File

@ -46,8 +46,6 @@ public partial class BiasOfTheDayAssistant : AssistantBaseCore<SettingsDialogAss
protected override Func<Task> SubmitAction => this.TellBias; protected override Func<Task> SubmitAction => this.TellBias;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_BIAS_OF_THE_DAY_PANEL;
protected override bool ShowSendTo => false; protected override bool ShowSendTo => false;
protected override bool ShowCopyResult => false; protected override bool ShowCopyResult => false;

View File

@ -34,8 +34,6 @@ public partial class AssistantCoding : AssistantBaseCore<SettingsDialogCoding>
protected override Func<Task> SubmitAction => this.GetSupport; protected override Func<Task> SubmitAction => this.GetSupport;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_CODING_PANEL;
protected override void ResetForm() protected override void ResetForm()
{ {
this.codingContexts.Clear(); this.codingContexts.Clear();

View File

@ -30,8 +30,6 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
protected override Func<Task> SubmitAction => this.CreateMail; protected override Func<Task> SubmitAction => this.CreateMail;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_EMAIL_PANEL;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{ {
SystemPrompt = SystemPrompts.DEFAULT, SystemPrompt = SystemPrompts.DEFAULT,

View File

@ -309,8 +309,6 @@ public partial class AssistantERI : AssistantBaseCore<SettingsDialogERIServer>
protected override Func<Task> SubmitAction => this.GenerateServer; protected override Func<Task> SubmitAction => this.GenerateServer;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_ERI_SERVER_PANEL;
protected override bool SubmitDisabled => this.IsNoneERIServerSelected; protected override bool SubmitDisabled => this.IsNoneERIServerSelected;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with

View File

@ -45,8 +45,6 @@ public partial class AssistantGrammarSpelling : AssistantBaseCore<SettingsDialog
protected override Func<Task> SubmitAction => this.ProofreadText; protected override Func<Task> SubmitAction => this.ProofreadText;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_GRAMMAR_SPELLING_PANEL;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{ {
SystemPrompt = SystemPrompts.DEFAULT, SystemPrompt = SystemPrompts.DEFAULT,

View File

@ -35,8 +35,6 @@ public partial class AssistantIconFinder : AssistantBaseCore<SettingsDialogIconF
protected override string SubmitText => "Find Icon"; protected override string SubmitText => "Find Icon";
protected override Func<Task> SubmitAction => this.FindIcon; protected override Func<Task> SubmitAction => this.FindIcon;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_ICON_FINDER_PANEL;
protected override void ResetForm() protected override void ResetForm()
{ {

View File

@ -52,8 +52,6 @@ public partial class AssistantJobPostings : AssistantBaseCore<SettingsDialogJobP
protected override Func<Task> SubmitAction => this.CreateJobPosting; protected override Func<Task> SubmitAction => this.CreateJobPosting;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_JOB_POSTING_PANEL;
protected override bool SubmitDisabled => false; protected override bool SubmitDisabled => false;
protected override bool AllowProfiles => false; protected override bool AllowProfiles => false;

View File

@ -32,8 +32,6 @@ public partial class AssistantLegalCheck : AssistantBaseCore<SettingsDialogLegal
protected override Func<Task> SubmitAction => this.AksQuestions; protected override Func<Task> SubmitAction => this.AksQuestions;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_LEGAL_CHECK_PANEL;
protected override bool SubmitDisabled => this.isAgentRunning; protected override bool SubmitDisabled => this.isAgentRunning;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with

View File

@ -36,8 +36,6 @@ public partial class AssistantMyTasks : AssistantBaseCore<SettingsDialogMyTasks>
protected override Func<Task> SubmitAction => this.AnalyzeText; protected override Func<Task> SubmitAction => this.AnalyzeText;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_MY_TASKS_PANEL;
protected override bool ShowProfileSelection => false; protected override bool ShowProfileSelection => false;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with

View File

@ -46,8 +46,6 @@ public partial class AssistantRewriteImprove : AssistantBaseCore<SettingsDialogR
protected override Func<Task> SubmitAction => this.RewriteText; protected override Func<Task> SubmitAction => this.RewriteText;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_REWRITE_PANEL;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{ {
SystemPrompt = SystemPrompts.DEFAULT, SystemPrompt = SystemPrompts.DEFAULT,

View File

@ -1,5 +1,5 @@
@attribute [Route(Routes.ASSISTANT_SYNONYMS)] @attribute [Route(Routes.ASSISTANT_SYNONYMS)]
@inherits AssistantBaseCore<AIStudio.Components.Settings.SettingsDialogSynonyms> @inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogSynonyms>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@Icons.Material.Filled.Spellcheck" Adornment="Adornment.Start" Label="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="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="(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="(Optional) The context for the given word or phrase" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>

View File

@ -1,5 +1,5 @@
using AIStudio.Chat; using AIStudio.Chat;
using AIStudio.Components.Settings; using AIStudio.Dialogs.Settings;
namespace AIStudio.Assistants.Synonym; namespace AIStudio.Assistants.Synonym;
@ -56,8 +56,6 @@ public partial class AssistantSynonyms : AssistantBaseCore<SettingsDialogSynonym
protected override Func<Task> SubmitAction => this.FindSynonyms; protected override Func<Task> SubmitAction => this.FindSynonyms;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_SYNONYMS_PANEL;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
{ {
SystemPrompt = SystemPrompts.DEFAULT, SystemPrompt = SystemPrompts.DEFAULT,

View File

@ -35,8 +35,6 @@ public partial class AssistantTextSummarizer : AssistantBaseCore<SettingsDialogT
protected override Func<Task> SubmitAction => this.SummarizeText; protected override Func<Task> SubmitAction => this.SummarizeText;
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_TEXT_SUMMARIZER_PANEL;
protected override bool SubmitDisabled => this.isAgentRunning; protected override bool SubmitDisabled => this.isAgentRunning;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with

View File

@ -31,8 +31,6 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
protected override Func<Task> SubmitAction => () => this.TranslateText(true); protected override Func<Task> SubmitAction => () => this.TranslateText(true);
protected override SettingsPanel SettingsPanel => SettingsPanel.ASSISTANT_TRANSLATION_PANEL;
protected override bool SubmitDisabled => this.isAgentRunning; protected override bool SubmitDisabled => this.isAgentRunning;
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with

View File

@ -12,7 +12,7 @@ namespace AIStudio.Components;
public partial class ProviderSelection : ComponentBase public partial class ProviderSelection : ComponentBase
{ {
[CascadingParameter] [CascadingParameter]
public AssistantBase<SettingsDialogProviders>? AssistantBase { get; set; } public AssistantBase<NoComponent>? AssistantBase { get; set; }
[Parameter] [Parameter]
public AIStudio.Settings.Provider ProviderSettings { get; set; } public AIStudio.Settings.Provider ProviderSettings { get; set; }

View File

@ -2,7 +2,7 @@
<MudTextSwitch Label="Read content from web?" Disabled="@this.AgentIsRunning" @bind-Value="@this.showWebContentReader" LabelOn="Show web content options" LabelOff="Hide web content options" /> <MudTextSwitch Label="Read content from web?" Disabled="@this.AgentIsRunning" @bind-Value="@this.showWebContentReader" LabelOn="Show web content options" LabelOff="Hide web content options" />
@if (this.showWebContentReader) @if (this.showWebContentReader)
{ {
<MudTextSwitch Label="Cleanup content by using a LLM agent?" @bind-Value="@this.useContentCleanerAgent" Validation="@this.ValidateProvider" Disabled="@this.AgentIsRunning" LabelOn="The content is cleaned using an LLM agent: the main content is extracted, advertisements and other irrelevant things are attempted to be removed; relative links are attempted to be converted into absolute links so that they can be used." LabelOff="No content cleaning" /> <MudTextSwitch Label="Cleanup content by using an LLM agent?" @bind-Value="@this.useContentCleanerAgent" Validation="@this.ValidateProvider" Disabled="@this.AgentIsRunning" LabelOn="The content is cleaned using an LLM agent: the main content is extracted, advertisements and other irrelevant things are attempted to be removed; relative links are attempted to be converted into absolute links so that they can be used." LabelOff="No content cleaning" />
<MudStack Row="@true" AlignItems="@AlignItems.Baseline" Class="mb-3"> <MudStack Row="@true" AlignItems="@AlignItems.Baseline" Class="mb-3">
<MudTextField T="string" Label="URL from which to load the content" @bind-Value="@this.providedURL" Validation="@this.ValidateURL" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Link" Placeholder="https://..." HelperText="Loads the content from your URL. Does not work when the content is hidden behind a paywall." Variant="Variant.Outlined" Immediate="@true" Disabled="@this.AgentIsRunning"/> <MudTextField T="string" Label="URL from which to load the content" @bind-Value="@this.providedURL" Validation="@this.ValidateURL" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Link" Placeholder="https://..." HelperText="Loads the content from your URL. Does not work when the content is hidden behind a paywall." Variant="Variant.Outlined" Immediate="@true" Disabled="@this.AgentIsRunning"/>
<MudButton Disabled="@(!this.IsReady || this.AgentIsRunning)" Variant="Variant.Filled" Size="Size.Large" Color="Color.Primary" StartIcon="@Icons.Material.Filled.Download" OnClick="() => this.LoadFromWeb()"> <MudButton Disabled="@(!this.IsReady || this.AgentIsRunning)" Variant="Variant.Filled" Size="Size.Large" Color="Color.Primary" StartIcon="@Icons.Material.Filled.Download" OnClick="() => this.LoadFromWeb()">

View File

@ -13,22 +13,6 @@ public enum SettingsPanel
CHAT_PANEL, CHAT_PANEL,
WORKSPACE_PANEL, WORKSPACE_PANEL,
// ASSISTANTS
ASSISTANT_GRAMMAR_SPELLING_PANEL,
ASSISTANT_ICON_FINDER_PANEL,
ASSISTANT_REWRITE_PANEL,
ASSISTANT_TRANSLATION_PANEL,
ASSISTANT_AGENDA_PANEL,
ASSISTANT_CODING_PANEL,
ASSISTANT_TEXT_SUMMARIZER_PANEL,
ASSISTANT_EMAIL_PANEL,
ASSISTANT_LEGAL_CHECK_PANEL,
ASSISTANT_SYNONYMS_PANEL,
ASSISTANT_MY_TASKS_PANEL,
ASSISTANT_JOB_POSTING_PANEL,
ASSISTANT_ERI_SERVER_PANEL,
ASSISTANT_BIAS_OF_THE_DAY_PANEL,
// Agents // Agents
AGENT_DATA_SOURCE_SELECTION_PANEL, AGENT_DATA_SOURCE_SELECTION_PANEL,
AGENT_RETRIEVAL_CONTEXT_VALIDATION_PANEL, AGENT_RETRIEVAL_CONTEXT_VALIDATION_PANEL,