mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-27 23:39:48 +00:00
Some checks are pending
Build and Release / Read metadata (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis updater) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage deb updater) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
98 lines
4.2 KiB
Plaintext
98 lines
4.2 KiB
Plaintext
@using AIStudio.Tools
|
|
@using MudBlazor
|
|
@inherits AIStudio.Components.MSGComponentBase
|
|
<MudCard Class="@this.CardClasses" Outlined="@true">
|
|
<MudCardHeader>
|
|
<CardHeaderAvatar>
|
|
<MudAvatar Color="@this.Role.ToColor()">
|
|
<MudIcon Icon="@this.Role.ToIcon()"/>
|
|
</MudAvatar>
|
|
</CardHeaderAvatar>
|
|
<CardHeaderContent>
|
|
<MudText Typo="Typo.body1">
|
|
@this.Role.ToName() (@this.Time)
|
|
</MudText>
|
|
</CardHeaderContent>
|
|
<CardHeaderActions>
|
|
@if (this.IsSecondToLastBlock && this.Role is ChatRole.USER && this.EditLastUserBlockFunc is not null)
|
|
{
|
|
<MudTooltip Text="@T("Edit")" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Edit" Color="Color.Default" OnClick="@this.EditLastUserBlock"/>
|
|
</MudTooltip>
|
|
}
|
|
@if (this.IsLastContentBlock && this.Role is ChatRole.USER && this.EditLastBlockFunc is not null)
|
|
{
|
|
<MudTooltip Text="@T("Edit")" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Edit" Color="Color.Default" OnClick="@this.EditLastBlock"/>
|
|
</MudTooltip>
|
|
}
|
|
@if (this.IsLastContentBlock && this.Role is ChatRole.AI && this.RegenerateFunc is not null)
|
|
{
|
|
<MudTooltip Text="@T("Regenerate")" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Recycling" Color="Color.Default" Disabled="@(!this.RegenerateEnabled())" OnClick="@this.RegenerateBlock"/>
|
|
</MudTooltip>
|
|
}
|
|
@if (this.RemoveBlockFunc is not null)
|
|
{
|
|
<MudTooltip Text="@T("Removes this block")" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Delete" Color="Color.Error" OnClick="@this.RemoveBlock"/>
|
|
</MudTooltip>
|
|
}
|
|
<MudTooltip Text="@T("Copies the content to the clipboard")" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.ContentCopy" Color="Color.Default" OnClick="@this.CopyToClipboard"/>
|
|
</MudTooltip>
|
|
</CardHeaderActions>
|
|
</MudCardHeader>
|
|
<MudCardContent>
|
|
@if (!this.HideContent)
|
|
{
|
|
if (this.Content.IsStreaming)
|
|
{
|
|
<MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="mb-6" />
|
|
}
|
|
|
|
switch (this.Type)
|
|
{
|
|
case ContentType.TEXT:
|
|
if (this.Content is ContentText textContent)
|
|
{
|
|
if (textContent.InitialRemoteWait)
|
|
{
|
|
<MudSkeleton Width="30%" Height="42px;"/>
|
|
<MudSkeleton Width="80%"/>
|
|
<MudSkeleton Width="100%"/>
|
|
}
|
|
else
|
|
{
|
|
@if (this.Content.IsStreaming)
|
|
{
|
|
<MudText Typo="Typo.body1" Style="white-space: pre-wrap;">
|
|
@textContent.Text
|
|
</MudText>
|
|
}
|
|
else
|
|
{
|
|
<MudMarkdown Value="@textContent.Text" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo" CodeBlockTheme="@this.CodeColorPalette"/>
|
|
}
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
case ContentType.IMAGE:
|
|
if (this.Content is ContentImage { SourceType: ContentImageSource.URL or ContentImageSource.LOCAL_PATH } imageContent)
|
|
{
|
|
<MudImage Src="@imageContent.Source"/>
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
<MudText Typo="Typo.body2">
|
|
@string.Format(T("Cannot render content of type {0} yet."), this.Type)
|
|
</MudText>
|
|
break;
|
|
}
|
|
}
|
|
</MudCardContent>
|
|
</MudCard> |