mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-23 06:13:48 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
119 lines
5.5 KiB
Plaintext
119 lines
5.5 KiB
Plaintext
@using AIStudio.Chat.Compression
|
|
@inherits MSGComponentBase
|
|
|
|
<MudDialog DefaultFocus="DefaultFocus.FirstChild">
|
|
<DialogContent>
|
|
<MudStack Spacing="3">
|
|
<MudJustifiedText Typo="Typo.body1">
|
|
@if (this.Target is ChatCompressionTarget.SAME_CHAT)
|
|
{
|
|
@TA("The AI summarizes this conversation, the content of its documents included. The summary then takes the place of the earlier messages, while your last message and the last answer of the AI stay as they are. AI Studio does not keep the earlier messages. Since the conversation is much shorter afterward, every further message costs fewer tokens.")
|
|
}
|
|
else
|
|
{
|
|
@TA("The AI summarizes this chat, the content of its documents included, and the conversation continues in a new chat. It holds the summary, your last message with its files, and the last answer of the AI. Since the new chat is much shorter, every further message costs fewer tokens. This chat stays as it is, so the whole conversation remains available.")
|
|
}
|
|
</MudJustifiedText>
|
|
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@this.SummaryScope
|
|
</MudJustifiedText>
|
|
|
|
@if (this.Plan.PendingQuestion is not null)
|
|
{
|
|
<MudAlert Severity="Severity.Info" Dense="true">
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@TA("Your last message has no answer yet. It goes into the input field of the new chat, so you can send it there.")
|
|
</MudJustifiedText>
|
|
</MudAlert>
|
|
}
|
|
|
|
@if (this.StoresChatFirst)
|
|
{
|
|
<MudAlert Severity="Severity.Info" Dense="true">
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@T("This chat has changes which are not saved yet. AI Studio saves it first, so that the whole conversation remains available.")
|
|
</MudJustifiedText>
|
|
</MudAlert>
|
|
}
|
|
|
|
@if (this.HasDocumentsToSummarize)
|
|
{
|
|
<MudAlert Severity="Severity.Info" Dense="true">
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@T("The summary takes in the content of the documents attached in this chat. This takes longer than summarizing the messages alone.")
|
|
</MudJustifiedText>
|
|
</MudAlert>
|
|
}
|
|
|
|
@if (this.HasImagesToSummarize)
|
|
{
|
|
<MudAlert Severity="Severity.Info" Dense="true">
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@T("The AI does not look at the images in this chat again. The summary keeps what the conversation said about them.")
|
|
</MudJustifiedText>
|
|
</MudAlert>
|
|
}
|
|
|
|
<MudForm @ref="this.form">
|
|
@if (this.Target is ChatCompressionTarget.NEW_CHAT)
|
|
{
|
|
<MudTextField T="string"
|
|
@bind-Value="@this.chatName"
|
|
Label="@T("Name of the new chat")"
|
|
Variant="Variant.Outlined"
|
|
Immediate="@true"
|
|
Disabled="@this.isSummarizing"
|
|
OnKeyDown="@this.HandleChatNameKeyDown"
|
|
UserAttributes="@USER_INPUT_ATTRIBUTES"
|
|
Validation="@this.ValidateChatName"/>
|
|
}
|
|
|
|
<MudTextField T="string"
|
|
@bind-Text="@this.focus"
|
|
Label="@T("What should the summary pay particular attention to? (optional)")"
|
|
Placeholder="@T("For example: the decisions about the budget, with all figures.")"
|
|
Variant="Variant.Outlined"
|
|
Lines="3"
|
|
Sizing="InputSizing.Auto"
|
|
MaxLines="8"
|
|
Immediate="@true"
|
|
Disabled="@this.isSummarizing"
|
|
UserAttributes="@USER_INPUT_ATTRIBUTES"
|
|
Class="mt-3"/>
|
|
</MudForm>
|
|
|
|
@if (this.isSummarizing)
|
|
{
|
|
<MudProgressLinear Indeterminate="true" Color="Color.Primary"/>
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@this.ProgressMessage
|
|
</MudJustifiedText>
|
|
}
|
|
|
|
@if (!string.IsNullOrWhiteSpace(this.issue))
|
|
{
|
|
<MudAlert Severity="Severity.Error" Dense="true">
|
|
<MudJustifiedText Typo="Typo.body2">
|
|
@this.issue
|
|
</MudJustifiedText>
|
|
</MudAlert>
|
|
}
|
|
</MudStack>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudButton OnClick="@this.Cancel" Variant="Variant.Filled">
|
|
@T("Cancel")
|
|
</MudButton>
|
|
<MudButton OnClick="@this.CompressAsync" Variant="Variant.Filled" Color="Color.Primary" StartIcon="@AppIcons.COMPRESS_CHAT" Disabled="@this.isSummarizing">
|
|
@if (this.Target is ChatCompressionTarget.SAME_CHAT)
|
|
{
|
|
@T("Compress")
|
|
}
|
|
else
|
|
{
|
|
@T("Compress & switch")
|
|
}
|
|
</MudButton>
|
|
</DialogActions>
|
|
</MudDialog> |