mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 12:59:47 +00:00
50 lines
2.4 KiB
Plaintext
50 lines
2.4 KiB
Plaintext
@page "/chat"
|
|
@using AIStudio.Chat
|
|
@using AIStudio.Settings
|
|
|
|
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
|
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
|
|
Chats
|
|
</MudText>
|
|
<MudTooltip Text="Your workspaces" Placement="Placement.Bottom">
|
|
<MudIconButton Icon="@Icons.Material.Filled.SnippetFolder" Variant="Variant.Filled" Color="Color.Default" Size="Size.Large" OnClick="() => this.ToggleWorkspaces()"/>
|
|
</MudTooltip>
|
|
</MudStack>
|
|
|
|
<MudSelect T="Provider" @bind-Value="@this.selectedProvider" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Apps" Margin="Margin.Dense" Label="Provider" Class="mb-2 rounded-lg" Variant="Variant.Outlined">
|
|
@foreach (var provider in this.SettingsManager.ConfigurationData.Providers)
|
|
{
|
|
<MudSelectItem Value="@provider"/>
|
|
}
|
|
</MudSelect>
|
|
|
|
<InnerScrolling HeaderHeight="12.3em">
|
|
<ChildContent>
|
|
@if (this.chatThread is not null)
|
|
{
|
|
foreach (var block in this.chatThread.Blocks.OrderBy(n => n.Time))
|
|
{
|
|
<ContentBlockComponent Role="@block.Role" Type="@block.ContentType" Time="@block.Time" Content="@block.Content"/>
|
|
}
|
|
}
|
|
</ChildContent>
|
|
<FooterContent>
|
|
<MudPaper Style="flex: 0 0 auto;">
|
|
<MudTextField T="string" @ref="@this.inputField" @bind-Text="@this.userInput" Variant="Variant.Outlined" AutoGrow="@true" Lines="3" MaxLines="12" Label="@this.InputLabel" Placeholder="@this.ProviderPlaceholder" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.Send" OnAdornmentClick="() => this.SendMessage()" ReadOnly="!this.IsProviderSelected || this.isStreaming" Immediate="@true" OnKeyUp="this.InputKeyEvent" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
|
|
</MudPaper>
|
|
</FooterContent>
|
|
</InnerScrolling>
|
|
|
|
<MudDrawer @bind-Open="@this.workspacesVisible" Width="40em" Height="100%" Anchor="Anchor.Start" Variant="DrawerVariant.Temporary" Elevation="1">
|
|
<MudDrawerHeader>
|
|
<MudStack Row="@true" AlignItems="AlignItems.Center">
|
|
<MudText Typo="Typo.h6" Class="mr-3">
|
|
Your workspaces
|
|
</MudText>
|
|
<MudIconButton Icon="@Icons.Material.Filled.Close" Variant="Variant.Filled" Color="Color.Default" Size="Size.Small" OnClick="() => this.ToggleWorkspaces()"/>
|
|
</MudStack>
|
|
</MudDrawerHeader>
|
|
<MudDrawerContainer Class="ml-6">
|
|
<Workspaces/>
|
|
</MudDrawerContainer>
|
|
</MudDrawer> |