mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 21:39:46 +00:00
Refactored "send to" buttons
This commit is contained in:
parent
83f79ac09d
commit
f6eafebebd
@ -95,13 +95,7 @@ public partial class AssistantAgenda : AssistantBaseCore
|
|||||||
- Mary Jane: Work package 3
|
- Mary Jane: Work package 3
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.AGENDA_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
|
@ -35,49 +35,64 @@
|
|||||||
</div>
|
</div>
|
||||||
</ChildContent>
|
</ChildContent>
|
||||||
<FooterContent>
|
<FooterContent>
|
||||||
@if (this.FooterButtons.Count > 0)
|
<MudStack Row="@true" Wrap="Wrap.Wrap" Class="ma-1">
|
||||||
{
|
|
||||||
<MudStack Row="@true" Wrap="Wrap.Wrap" Class="ma-1">
|
@if (!this.FooterButtons.Any(x => x.Type is ButtonTypes.SEND_TO))
|
||||||
@foreach (var button in this.FooterButtons)
|
{
|
||||||
{
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Color="Color.Info">
|
||||||
switch (button)
|
@foreach (var assistant in Enum.GetValues<Components>().OrderBy(n => n.Name().Length))
|
||||||
{
|
{
|
||||||
case ButtonData buttonData when !string.IsNullOrWhiteSpace(buttonData.Tooltip):
|
if (assistant is Components.NONE || this.Component == assistant)
|
||||||
<MudTooltip Text="@buttonData.Tooltip">
|
continue;
|
||||||
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
|
||||||
@buttonData.Text
|
|
||||||
</MudButton>
|
|
||||||
</MudTooltip>
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ButtonData buttonData:
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, new())">
|
||||||
|
@assistant.Name()
|
||||||
|
</MudMenuItem>
|
||||||
|
}
|
||||||
|
</MudMenu>
|
||||||
|
}
|
||||||
|
|
||||||
|
@foreach (var button in this.FooterButtons)
|
||||||
|
{
|
||||||
|
switch (button)
|
||||||
|
{
|
||||||
|
case ButtonData buttonData when !string.IsNullOrWhiteSpace(buttonData.Tooltip):
|
||||||
|
<MudTooltip Text="@buttonData.Tooltip">
|
||||||
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
||||||
@buttonData.Text
|
@buttonData.Text
|
||||||
</MudButton>
|
</MudButton>
|
||||||
break;
|
</MudTooltip>
|
||||||
|
break;
|
||||||
|
|
||||||
case SendToButton sendToButton:
|
case ButtonData buttonData:
|
||||||
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Color="Color.Info">
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
||||||
@foreach (var assistant in Enum.GetValues<Components>().OrderBy(n => n.Name().Length))
|
@buttonData.Text
|
||||||
{
|
</MudButton>
|
||||||
if(assistant is Components.NONE || sendToButton.Self == assistant)
|
break;
|
||||||
continue;
|
|
||||||
|
|
||||||
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
case SendToButton sendToButton:
|
||||||
@assistant.Name()
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Color="Color.Info">
|
||||||
</MudMenuItem>
|
@foreach (var assistant in Enum.GetValues<Components>().OrderBy(n => n.Name().Length))
|
||||||
}
|
{
|
||||||
</MudMenu>
|
if(assistant is Components.NONE || sendToButton.Self == assistant)
|
||||||
break;
|
continue;
|
||||||
}
|
|
||||||
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
||||||
|
@assistant.Name()
|
||||||
|
</MudMenuItem>
|
||||||
|
}
|
||||||
|
</MudMenu>
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.ContentCopy" OnClick="() => this.CopyToClipboard()">
|
}
|
||||||
Copy result
|
|
||||||
</MudButton>
|
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.ContentCopy" OnClick="() => this.CopyToClipboard()">
|
||||||
<MudButton Variant="Variant.Filled" Color="Color.Warning" StartIcon="@Icons.Material.Filled.Refresh" OnClick="() => this.InnerResetForm()">
|
Copy result
|
||||||
Reset
|
</MudButton>
|
||||||
</MudButton>
|
|
||||||
</MudStack>
|
<MudButton Variant="Variant.Filled" Color="Color.Warning" StartIcon="@Icons.Material.Filled.Refresh" OnClick="() => this.InnerResetForm()">
|
||||||
}
|
Reset
|
||||||
|
</MudButton>
|
||||||
|
</MudStack>
|
||||||
</FooterContent>
|
</FooterContent>
|
||||||
</InnerScrolling>
|
</InnerScrolling>
|
@ -26,13 +26,7 @@ public partial class AssistantCoding : AssistantBaseCore
|
|||||||
When the user asks in a different language than English, you answer in the same language!
|
When the user asks in a different language than English, you answer in the same language!
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.CODING_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override void ResetFrom()
|
protected override void ResetFrom()
|
||||||
{
|
{
|
||||||
|
@ -22,13 +22,7 @@ public partial class AssistantEMail : AssistantBaseCore
|
|||||||
{this.SystemPromptGreeting()} {this.SystemPromptName()} You write the email in the following language: {this.SystemPromptLanguage()}.
|
{this.SystemPromptGreeting()} {this.SystemPromptName()} You write the email in the following language: {this.SystemPromptLanguage()}.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.EMAIL_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
|
@ -25,13 +25,7 @@ public partial class AssistantIconFinder : AssistantBaseCore
|
|||||||
quotation marks.
|
quotation marks.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.ICON_FINDER_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override void ResetFrom()
|
protected override void ResetFrom()
|
||||||
{
|
{
|
||||||
|
@ -22,13 +22,7 @@ public partial class AssistantLegalCheck : AssistantBaseCore
|
|||||||
Never invent facts!
|
Never invent facts!
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.LEGAL_CHECK_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override void ResetFrom()
|
protected override void ResetFrom()
|
||||||
{
|
{
|
||||||
|
@ -25,13 +25,7 @@ public partial class AssistantTextSummarizer : AssistantBaseCore
|
|||||||
a summary with the requested complexity. In any case, do not add any information.
|
a summary with the requested complexity. In any case, do not add any information.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.TEXT_SUMMARIZER_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
|
@ -21,13 +21,7 @@ public partial class AssistantTranslation : AssistantBaseCore
|
|||||||
language requires, e.g., shorter sentences, you should split the text into shorter sentences.
|
language requires, e.g., shorter sentences, you should split the text into shorter sentences.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
protected override IReadOnlyList<IButtonData> FooterButtons => [];
|
||||||
[
|
|
||||||
new SendToButton
|
|
||||||
{
|
|
||||||
Self = Tools.Components.TRANSLATION_ASSISTANT,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
protected override ChatThread ConvertToChatThread => (this.chatThread ?? new()) with
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user