2024-07-14 19:46:17 +00:00
|
|
|
@using AIStudio.Chat
|
2024-08-21 06:30:01 +00:00
|
|
|
|
2024-07-14 19:46:17 +00:00
|
|
|
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
|
2024-08-18 19:48:35 +00:00
|
|
|
@(this.Title)
|
2024-07-14 19:46:17 +00:00
|
|
|
</MudText>
|
|
|
|
|
2024-08-23 11:44:27 +00:00
|
|
|
<InnerScrolling HeaderHeight="6em">
|
2024-07-14 19:46:17 +00:00
|
|
|
<ChildContent>
|
2024-08-18 19:48:35 +00:00
|
|
|
<MudForm @ref="@(this.form)" @bind-IsValid="@(this.inputIsValid)" @bind-Errors="@(this.inputIssues)" Class="pr-2">
|
2024-07-14 19:46:17 +00:00
|
|
|
<MudText Typo="Typo.body1" Align="Align.Justify" Class="mb-6">
|
2024-09-11 21:08:02 +00:00
|
|
|
@this.Description
|
2024-07-14 19:46:17 +00:00
|
|
|
</MudText>
|
|
|
|
|
|
|
|
@if (this.Body is not null)
|
|
|
|
{
|
2024-09-14 17:20:33 +00:00
|
|
|
<CascadingValue Value="@this">
|
|
|
|
@this.Body
|
|
|
|
</CascadingValue>
|
2024-09-11 21:08:02 +00:00
|
|
|
|
|
|
|
<MudButton Disabled="@this.SubmitDisabled" Variant="Variant.Filled" Class="mb-3" OnClick="() => this.SubmitAction()" Style="@this.SubmitButtonStyle">
|
|
|
|
@this.SubmitText
|
|
|
|
</MudButton>
|
2024-07-14 19:46:17 +00:00
|
|
|
}
|
|
|
|
</MudForm>
|
2024-08-18 19:48:35 +00:00
|
|
|
<Issues IssuesData="@(this.inputIssues)"/>
|
2024-08-13 06:57:58 +00:00
|
|
|
|
2024-08-13 18:53:09 +00:00
|
|
|
@if (this.ShowDedicatedProgress && this.isProcessing)
|
2024-08-13 06:57:58 +00:00
|
|
|
{
|
|
|
|
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="mb-6" />
|
|
|
|
}
|
2024-08-21 06:59:55 +00:00
|
|
|
|
2024-08-21 06:30:01 +00:00
|
|
|
<div id="@RESULT_DIV_ID" class="mr-2 mt-3">
|
2024-08-13 06:57:58 +00:00
|
|
|
</div>
|
2024-09-15 20:46:48 +00:00
|
|
|
|
|
|
|
<div id="@BEFORE_RESULT_DIV_ID" class="mt-3">
|
|
|
|
</div>
|
2024-08-21 06:59:55 +00:00
|
|
|
|
|
|
|
@if (this.ShowResult && this.resultingContentBlock is not null)
|
|
|
|
{
|
|
|
|
<ContentBlockComponent Role="@(this.resultingContentBlock.Role)" Type="@(this.resultingContentBlock.ContentType)" Time="@(this.resultingContentBlock.Time)" Content="@(this.resultingContentBlock.Content)"/>
|
|
|
|
}
|
2024-08-13 06:57:58 +00:00
|
|
|
|
|
|
|
<div id="@AFTER_RESULT_DIV_ID" class="mt-3">
|
|
|
|
</div>
|
2024-08-23 11:44:27 +00:00
|
|
|
</ChildContent>
|
|
|
|
<FooterContent>
|
2024-09-04 13:44:23 +00:00
|
|
|
<MudStack Row="@true" Wrap="Wrap.Wrap" Class="ma-1">
|
|
|
|
|
|
|
|
@if (!this.FooterButtons.Any(x => x.Type is ButtonTypes.SEND_TO))
|
|
|
|
{
|
2024-10-28 14:41:00 +00:00
|
|
|
@if (this.ShowSendTo)
|
|
|
|
{
|
|
|
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
2024-11-02 10:55:09 +00:00
|
|
|
@foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
|
2024-10-28 14:41:00 +00:00
|
|
|
{
|
|
|
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, new())">
|
|
|
|
@assistant.Name()
|
|
|
|
</MudMenuItem>
|
|
|
|
}
|
|
|
|
</MudMenu>
|
|
|
|
}
|
2024-09-04 13:44:23 +00:00
|
|
|
}
|
2024-08-13 06:57:58 +00:00
|
|
|
|
2024-09-04 13:44:23 +00:00
|
|
|
@foreach (var button in this.FooterButtons)
|
|
|
|
{
|
|
|
|
switch (button)
|
|
|
|
{
|
|
|
|
case ButtonData buttonData when !string.IsNullOrWhiteSpace(buttonData.Tooltip):
|
|
|
|
<MudTooltip Text="@buttonData.Tooltip">
|
2024-08-13 06:57:58 +00:00
|
|
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
|
|
|
@buttonData.Text
|
|
|
|
</MudButton>
|
2024-09-04 13:44:23 +00:00
|
|
|
</MudTooltip>
|
|
|
|
break;
|
2024-08-23 11:44:27 +00:00
|
|
|
|
2024-09-04 13:44:23 +00:00
|
|
|
case ButtonData buttonData:
|
|
|
|
<MudButton Variant="Variant.Filled" Color="@buttonData.Color" StartIcon="@GetButtonIcon(buttonData.Icon)" OnClick="async () => await buttonData.AsyncAction()">
|
|
|
|
@buttonData.Text
|
|
|
|
</MudButton>
|
|
|
|
break;
|
2024-08-23 11:44:27 +00:00
|
|
|
|
2024-09-04 13:44:23 +00:00
|
|
|
case SendToButton sendToButton:
|
2024-09-15 10:30:07 +00:00
|
|
|
<MudMenu StartIcon="@Icons.Material.Filled.Apps" EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="Send to ..." Variant="Variant.Filled" Style="@this.GetSendToColor()" Class="rounded">
|
2024-11-02 10:55:09 +00:00
|
|
|
@foreach (var assistant in Enum.GetValues<Components>().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length))
|
2024-09-04 13:44:23 +00:00
|
|
|
{
|
|
|
|
<MudMenuItem OnClick="() => this.SendToAssistant(assistant, sendToButton)">
|
|
|
|
@assistant.Name()
|
|
|
|
</MudMenuItem>
|
|
|
|
}
|
|
|
|
</MudMenu>
|
|
|
|
break;
|
2024-08-13 06:57:58 +00:00
|
|
|
}
|
2024-09-04 13:44:23 +00:00
|
|
|
}
|
|
|
|
|
2024-10-28 14:41:00 +00:00
|
|
|
@if (this.ShowCopyResult)
|
|
|
|
{
|
|
|
|
<MudButton Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.ContentCopy" OnClick="() => this.CopyToClipboard()">
|
|
|
|
Copy result
|
|
|
|
</MudButton>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (this.ShowReset)
|
|
|
|
{
|
|
|
|
<MudButton Variant="Variant.Filled" Style="@this.GetResetColor()" StartIcon="@Icons.Material.Filled.Refresh" OnClick="() => this.InnerResetForm()">
|
|
|
|
Reset
|
|
|
|
</MudButton>
|
|
|
|
}
|
2024-09-11 21:08:02 +00:00
|
|
|
|
|
|
|
@if (this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence)
|
|
|
|
{
|
2024-09-13 19:50:00 +00:00
|
|
|
<ConfidenceInfo Mode="ConfidenceInfoMode.BUTTON" LLMProvider="@this.providerSettings.UsedLLMProvider"/>
|
2024-09-11 21:08:02 +00:00
|
|
|
}
|
|
|
|
|
2024-09-09 13:08:16 +00:00
|
|
|
@if (this.AllowProfiles && this.ShowProfileSelection)
|
2024-09-08 19:01:51 +00:00
|
|
|
{
|
|
|
|
<ProfileSelection MarginLeft="" @bind-CurrentProfile="@this.currentProfile"/>
|
|
|
|
}
|
2024-09-04 13:44:23 +00:00
|
|
|
</MudStack>
|
2024-08-23 11:44:27 +00:00
|
|
|
</FooterContent>
|
2024-07-14 19:46:17 +00:00
|
|
|
</InnerScrolling>
|